diff --git a/charts/posit-chronicle/Makefile b/charts/posit-chronicle/Makefile index 64cf85ed..64262604 100644 --- a/charts/posit-chronicle/Makefile +++ b/charts/posit-chronicle/Makefile @@ -5,3 +5,8 @@ lint: template: helm template -f ci/complex-values.yaml . --debug + +template-all: + helm template -f ci/empty-values.yaml . + helm template -f ci/simple-values.yaml . + helm template -f ci/complex-values.yaml . diff --git a/charts/posit-chronicle/README.md b/charts/posit-chronicle/README.md index af3e7d0e..484a57ac 100644 --- a/charts/posit-chronicle/README.md +++ b/charts/posit-chronicle/README.md @@ -190,12 +190,12 @@ config: | pod.rest.port | int | `5252` | | | pod.tolerations | list | `[]` | An array used verbatim as the pod's "tolerations" definition | | replicas | int | `1` | The number of replica pods to maintain for this service | -| service.rest.annotations | object | `{}` | Additional annotations to add to the chronicle-server service | -| service.rest.labels | object | `{}` | Additional labels to add to the chronicle-server service | -| service.rest.port | int | `80` | The port to use for the REST service | -| service.rest.targetPort | int | `5252` | The port to forward REST requests to on the pod. Also see pod.port | +| service..annotations | object | `{}` | Additional annotations to add to the chronicle-server service | +| service..labels | object | `{}` | Additional labels to add to the chronicle-server service | +| service..port | int | `80` | The port to use for the REST service | +| service..targetPort | int | `5252` | The port to forward REST requests to on the pod. Also see pod.port | | serviceaccount.annotations | object | `{}` | Additional annotations to add to the chronicle-server serviceaccount | -| serviceaccount.enabled | bool | `false` | | +| serviceaccount.create | bool | `false` | | | serviceaccount.labels | object | `{}` | Additional labels to add to the chronicle-server serviceaccount | | storage.persistentVolumeSize | string | `"1Gi"` | | diff --git a/charts/posit-chronicle/ci/complex-values.yaml b/charts/posit-chronicle/ci/complex-values.yaml index 1b979eaa..cc2eaaf5 100644 --- a/charts/posit-chronicle/ci/complex-values.yaml +++ b/charts/posit-chronicle/ci/complex-values.yaml @@ -8,11 +8,8 @@ serviceaccount: eks.amazonaws.com/role-arn: arn:aws:iam::123123123123123:role/chronicle-serviceaccount-role service: - rest: - # -- The port to use for the REST service - port: 12345 - # -- The port to forward REST requests to on the pod. Also see pod.port - targetPort: 12346 + # -- The port to use for the REST service + port: 12345 annotations: test-annotation: test-service-annotation labels: @@ -26,8 +23,6 @@ pod: replicas: 4 command: "/bash" args: ["echo", "hello word"] - rest: - port: 12345 # -- Optional environment variables env: - name: "TEST_ENV_VAR" @@ -49,7 +44,6 @@ config: # If https.enabled=true, we will ignore any http # values and enable https in our config instead enabled: true - listen: ":443" key: "" certificate: "" localStorage: @@ -68,9 +62,6 @@ config: profiling: enabled: true listen: :3030 - tracing: - enabled: true - address: "" logging: serviceLog: "STDOUT" serviceLogLevel: "DEBUG" diff --git a/charts/posit-chronicle/ci/simple-values.yaml b/charts/posit-chronicle/ci/simple-values.yaml index 33a774ef..21ba0719 100644 --- a/charts/posit-chronicle/ci/simple-values.yaml +++ b/charts/posit-chronicle/ci/simple-values.yaml @@ -7,7 +7,6 @@ serviceaccount: eks.amazonaws.com/role-arn: arn:aws:iam::123123123123123:role/chronicle-serviceaccount-role } - storage: persistentVolumeSize: 10Gi diff --git a/charts/posit-chronicle/templates/_helpers.tpl b/charts/posit-chronicle/templates/_helpers.tpl index 1552c1f5..73745834 100644 --- a/charts/posit-chronicle/templates/_helpers.tpl +++ b/charts/posit-chronicle/templates/_helpers.tpl @@ -10,7 +10,7 @@ Generate annotations for various resources {{ end }} {{- if .Values.config.metrics.enabled }} prometheus.io/scrape: "true" -prometheus.io/port: "{{ .Values.pod.rest.port }}" +prometheus.io/port: "{{ .Values.service.targetPort }}" {{- end }} {{- end -}} diff --git a/charts/posit-chronicle/templates/configmap.yaml b/charts/posit-chronicle/templates/configmap.yaml index f0a36be1..169dcc78 100644 --- a/charts/posit-chronicle/templates/configmap.yaml +++ b/charts/posit-chronicle/templates/configmap.yaml @@ -9,14 +9,26 @@ data: # switch between http and https {{- if .Values.config.https.enabled }} [HTTPS] - Listen = {{ .Values.config.https.listen }} + Listen = 443 Key = {{ .Values.config.https.key }} Certificate = {{ .Values.config.https.certificate }} {{- else}} [HTTP] - Listen = {{ .Values.config.http.listen }} + Listen = 5252 {{- end }} + [Logging] + ServiceLog = {{ .Values.config.logging.serviceLog }} + ServiceLogLevel = {{ .Values.config.logging.serviceLogLevel }} + ServiceLogFormat = {{ .Values.config.logging.serviceLogFormat }} + + [Metrics] + Enabled = {{ .Values.config.metrics.enabled }} + + [Profiling] + Enabled = {{ .Values.config.profiling.enabled }} + Listen = 3030 + [LocalStorage] Enabled = {{ .Values.config.localStorage.enabled }} Location = {{ .Values.config.localStorage.location }} @@ -29,21 +41,5 @@ data: Profile = {{ .Values.config.s3Storage.profile }} Region = {{ .Values.config.s3Storage.region }} CompactionEnabled = {{ .Values.config.s3Storage.compactionEnabled }} - - [Metrics] - Enabled = {{ .Values.config.metrics.enabled }} - - [Profiling] - Enabled = {{ .Values.config.profiling.enabled }} - Listen = {{ .Values.config.profiling.listen }} - - [Tracing] - Enabled = {{ .Values.config.tracing.enabled }} - Address = {{ .Values.config.tracing.address }} - - [Logging] - ServiceLog = {{ .Values.config.logging.serviceLog }} - ServiceLogLevel = {{ .Values.config.logging.serviceLogLevel }} - ServiceLogFormat = {{ .Values.config.logging.serviceLogFormat }} --- diff --git a/charts/posit-chronicle/templates/serviceaccount.yaml b/charts/posit-chronicle/templates/serviceaccount.yaml index 1f766675..e26b058b 100644 --- a/charts/posit-chronicle/templates/serviceaccount.yaml +++ b/charts/posit-chronicle/templates/serviceaccount.yaml @@ -1,5 +1,5 @@ --- -{{- if .Values.serviceaccount.enabled -}} +{{- if .Values.serviceaccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/posit-chronicle/templates/stateful-set.yaml b/charts/posit-chronicle/templates/stateful-set.yaml index 13f6dbe8..7c54bf0d 100644 --- a/charts/posit-chronicle/templates/stateful-set.yaml +++ b/charts/posit-chronicle/templates/stateful-set.yaml @@ -13,10 +13,10 @@ spec: template: metadata: labels: - {{- include "posit-chronicle.service.labels" . | trim | nindent 8 }} - {{- include "posit-chronicle.service.selectorLabels" . | trim | nindent 8 }} + {{- include "posit-chronicle.pod.labels" . | trim | nindent 8 }} + {{- include "posit-chronicle.pod.selectorLabels" . | trim | nindent 8 }} annotations: - {{- include "posit-chronicle.service.annotations" . | trim | nindent 8 }} + {{- include "posit-chronicle.pod.annotations" . | trim | nindent 8 }} spec: {{- with .Values.pod.affinity }} affinity: @@ -30,7 +30,7 @@ spec: tolerations: {{- toYaml . | nindent 8 }} {{- end }} - {{- if .Values.serviceaccount.enabled }} + {{- if .Values.serviceaccount.create }} serviceAccountName: chronicle-sa {{- end }} containers: @@ -44,8 +44,13 @@ spec: {{- toYaml .Values.pod.args | nindent 8 }} {{- end }} ports: - - containerPort: {{ .Values.pod.rest.port }} - name: tcp + {{- if .Values.config.https.enabled }} + - containerPort: 443 + name: https + {{- else}} + - containerPort: 5252 + name: http + {{- end }} volumeMounts: - name: data mountPath: {{ .Values.config.localStorage.location }} diff --git a/charts/posit-chronicle/templates/svc.yaml b/charts/posit-chronicle/templates/svc.yaml index cada2581..464ab6b6 100644 --- a/charts/posit-chronicle/templates/svc.yaml +++ b/charts/posit-chronicle/templates/svc.yaml @@ -12,7 +12,13 @@ spec: selector: {{- include "posit-chronicle.service.selectorLabels" . | trim | nindent 4 }} ports: - - port: {{ .Values.service.rest.port }} - targetPort: {{ .Values.service.rest.targetPort }} - name: tcp + {{- if .Values.config.https.enabled }} + - port: {{ .Values.service.port }} + targetPort: 443 + name: https + {{- else}} + - port: {{ .Values.service.port }} + targetPort: 5252 + name: http + {{- end }} --- diff --git a/charts/posit-chronicle/values.yaml b/charts/posit-chronicle/values.yaml index ca2813c0..71f0471b 100644 --- a/charts/posit-chronicle/values.yaml +++ b/charts/posit-chronicle/values.yaml @@ -4,7 +4,7 @@ image: imagePullPolicy: "Always" serviceaccount: - enabled: false + create: false # -- Additional annotations to add to the chronicle-server serviceaccount annotations: { # EKS role arn example @@ -14,30 +14,30 @@ serviceaccount: labels: {} service: - rest: - # -- The port to use for the REST service - port: 80 - # -- The port to forward REST requests to on the pod. Also see pod.port - targetPort: 5252 - # -- Additional annotations to add to the chronicle-server service - annotations: {} - # -- Additional labels to add to the chronicle-server service - labels: {} + # -- The port to use for the REST service + port: 80 + # -- Additional annotations to add to the chronicle-server service + annotations: {} + # -- Additional labels to add to the chronicle-server service + labels: {} + # -- Additional selector labels to add to the chronicle-server service + selectorLabels: {} # -- The number of replica pods to maintain for this service replicas: 1 pod: + # -- The command and args to run in the chronicle-server container command: "/chronicle" args: ["start", "-c", "/opt/chronicle/config.gcfg"] - rest: - port: 5252 # -- Optional environment variables env: [] # -- Additional annotations to add to the chronicle-server pods annotations: {} # -- Additional labels to add to the chronicle-server pods labels: {} + # -- Additional selector labels to add to the chronicle-server pods + selectorLabels: {} # -- A map used verbatim as the pod's "affinity" definition affinity: {} # -- A map used verbatim as the pod's "nodeSelector" definition @@ -51,13 +51,10 @@ storage: persistentVolumeSize: 1Gi config: - http: - listen: ":5252" https: # If https.enabled=true, we will ignore any http # values and enable https in our config instead enabled: false - listen: ":443" key: "" certificate: "" localStorage: @@ -69,16 +66,12 @@ config: bucket: "posit-chronicle" prefix: "" profile: "" - region: "us-east-2" + region: "" compactionEnabled: false metrics: enabled: true profiling: enabled: false - listen: :3030 - tracing: - enabled: false - address: "" logging: serviceLog: "STDOUT" serviceLogLevel: "INFO"