Skip to content

Commit

Permalink
Removed javaOptions and volumes
Browse files Browse the repository at this point in the history
  • Loading branch information
etomaselli committed Dec 11, 2023
1 parent 27dc93d commit b480dc8
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 46 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ kubectl apply -f config/samples/operator_v1_dremiorestserver.yaml
The custom resource's properties are:

- `tables`: **Required**. Comma-separated list of tables to expose
- `javaOptions`: *Optional*. Corresponds to *JAVA_TOOL_OPTIONS*: on JDK 9+, `--add-opens=java.base/java.nio=ALL-UNNAMED` is required
- `connection`:
- `host`: **Required**.
- `port`: *Optional*.
Expand All @@ -34,7 +33,6 @@ A valid sample spec configuration is:
``` yaml
...
spec:
javaOptions: --add-opens=java.base/java.nio=ALL-UNNAMED
tables: postgres.myschema.mytable
connection:
host: 192.168.123.123
Expand All @@ -46,7 +44,6 @@ Another valid sample:
``` yaml
...
spec:
javaOptions: --add-opens=java.base/java.nio=ALL-UNNAMED
tables: postgres.myschema.mytable
connection:
host: 192.168.123.123
Expand Down
4 changes: 0 additions & 4 deletions api/v1/dremiorestserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import (

// Dremio REST Server properties
type DremioRestServerSpec struct {
// Corresponds to JAVA_TOOL_OPTIONS: on JDK 9+, --add-opens=java.base/java.nio=ALL-UNNAMED is required
// +operator-sdk:csv:customresourcedefinitions:type=spec
JavaOptions string `json:"javaOptions,omitempty"` // JAVA_TOOL_OPTIONS

// Comma-separated list of tables to expose
// +operator-sdk:csv:customresourcedefinitions:type=spec
Tables string `json:"tables,omitempty"` // DREMIO_TABLES (comma-separated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ spec:
user:
type: string
type: object
javaOptions:
description: 'Corresponds to JAVA_TOOL_OPTIONS: on JDK 9+, --add-opens=java.base/java.nio=ALL-UNNAMED
is required'
type: string
tables:
description: Comma-separated list of tables to expose
type: string
Expand Down
1 change: 0 additions & 1 deletion config/samples/operator_v1_dremiorestserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ metadata:
name: drs
namespace: dremio-rest-server-operator-system
spec:
javaOptions: --add-opens=java.base/java.nio=ALL-UNNAMED -Djava.io.tmpdir=/tmp/tomcat -Dserver.tomcat.access-log-enabled=false
tables: postgres.instagram.utenti
connection:
host: 192.168.178.120
Expand Down
4 changes: 0 additions & 4 deletions deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ spec:
user:
type: string
type: object
javaOptions:
description: 'Corresponds to JAVA_TOOL_OPTIONS: on JDK 9+, --add-opens=java.base/java.nio=ALL-UNNAMED
is required'
type: string
tables:
description: Comma-separated list of tables to expose
type: string
Expand Down
30 changes: 0 additions & 30 deletions internal/controller/dremiorestserver_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,6 @@ func crUpdated(dep *appsv1.Deployment, cr *operatorv1.DremioRestServer, newDremi

// Check if CR spec (JavaOptions, Tables) has been modified
for _, env := range dep.Spec.Template.Spec.Containers[0].Env {
if env.Name == "JAVA_TOOL_OPTIONS" {
// Compare with current JavaOptions
if cr.Spec.JavaOptions != env.Value {
return true
}
}
if env.Name == "DREMIO_TABLES" {
// Compare with current Tables
if cr.Spec.Tables != env.Value {
Expand Down Expand Up @@ -400,8 +394,6 @@ func (r *DremioRestServerReconciler) deploymentForDremiorestserver(
return nil, errors.New("tables missing from spec")
}

emptyDirSize := resource.MustParse("10Mi")

ls := labelsForDremioRestServer(dremiorestserver.Name, tag)
selectors := selectorsForDremioRestServer(dremiorestserver.Name)

Expand Down Expand Up @@ -457,26 +449,10 @@ func (r *DremioRestServerReconciler) deploymentForDremiorestserver(
Type: corev1.SeccompProfileTypeRuntimeDefault,
},
},
Volumes: []corev1.Volume{
{
Name: "tomcat-tmp",
VolumeSource: corev1.VolumeSource{
EmptyDir: &corev1.EmptyDirVolumeSource{
SizeLimit: &emptyDirSize,
},
},
},
},
Containers: []corev1.Container{{
Image: strings.Join([]string{image, tag}, ":"),
Name: "dremiorestserver",
ImagePullPolicy: corev1.PullIfNotPresent,
VolumeMounts: []corev1.VolumeMount{
{
MountPath: "/tmp/tomcat",
Name: "tomcat-tmp",
},
},
Resources: corev1.ResourceRequirements{
Limits: getLimits(),
Requests: getRequests(),
Expand All @@ -490,13 +466,8 @@ func (r *DremioRestServerReconciler) deploymentForDremiorestserver(
"ALL",
},
},
ReadOnlyRootFilesystem: &[]bool{true}[0],
},
Env: []corev1.EnvVar{
{
Name: "JAVA_TOOL_OPTIONS",
Value: dremiorestserver.Spec.JavaOptions,
},
{
Name: "DREMIO_URL",
ValueFrom: &corev1.EnvVarSource{
Expand Down Expand Up @@ -680,7 +651,6 @@ func selectorsForDremioRestServer(name string) map[string]string {
// SetupWithManager sets up the controller with the Manager.
// Note that the Deployment will be also watched in order to ensure its
// desirable state on the cluster
// TODO add Owns to other resources?
func (r *DremioRestServerReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&operatorv1.DremioRestServer{}).
Expand Down

0 comments on commit b480dc8

Please sign in to comment.