From 9b3bcfa5ebe6b2244c11cc92e68fb04cbef6ef59 Mon Sep 17 00:00:00 2001 From: AlexMapley Date: Wed, 15 Nov 2023 13:43:11 -0500 Subject: [PATCH] fix linter complaints, add ci tests, add makefile --- charts/posit-chronicle/Chart.yaml | 1 - charts/posit-chronicle/Makefile | 9 +++++++ charts/posit-chronicle/ci/empty-values.yaml | 0 charts/posit-chronicle/ci/simple-values.yaml | 26 +++++++++++++++++++ charts/posit-chronicle/templates/_helpers.tpl | 2 +- .../templates/serviceaccount.yaml | 3 +-- .../templates/stateful-set.yaml | 4 +-- charts/posit-chronicle/templates/svc.yaml | 5 ++-- charts/posit-chronicle/values.yaml | 2 +- 9 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 charts/posit-chronicle/Makefile create mode 100644 charts/posit-chronicle/ci/empty-values.yaml create mode 100644 charts/posit-chronicle/ci/simple-values.yaml diff --git a/charts/posit-chronicle/Chart.yaml b/charts/posit-chronicle/Chart.yaml index f5c80c2b..7604481e 100644 --- a/charts/posit-chronicle/Chart.yaml +++ b/charts/posit-chronicle/Chart.yaml @@ -3,7 +3,6 @@ name: chronicle description: Helm chart for the Chronicle Server version: 0.1.0 appVersion: 2023.11.0 - icon: https://rstudio.com/wp-content/uploads/2018/10/RStudio-Logo-Flat.png home: https://www.posit.co sources: diff --git a/charts/posit-chronicle/Makefile b/charts/posit-chronicle/Makefile new file mode 100644 index 00000000..27be6352 --- /dev/null +++ b/charts/posit-chronicle/Makefile @@ -0,0 +1,9 @@ +lint: + helm lint --strict --set service.name=example --set service.version=0.0.1 -f ./ci/empty-values.yaml . + helm lint --strict --set service.name=example --set service.version=0.0.1 -f ./ci/simple-values.yaml . + +template: + helm template -f ci/simple-values.yaml . + +template-debug: + helm template -f ci/simple-values.yaml --debug . diff --git a/charts/posit-chronicle/ci/empty-values.yaml b/charts/posit-chronicle/ci/empty-values.yaml new file mode 100644 index 00000000..e69de29b diff --git a/charts/posit-chronicle/ci/simple-values.yaml b/charts/posit-chronicle/ci/simple-values.yaml new file mode 100644 index 00000000..82fcee36 --- /dev/null +++ b/charts/posit-chronicle/ci/simple-values.yaml @@ -0,0 +1,26 @@ +image: + tag: "latest" + +serviceaccount: + enabled: false + annotations: { + eks.amazonaws.com/role-arn: arn:aws:iam::123123123123123:role/chronicle-serviceaccount-role + } + +config: + localStorage: + enabled: true + retentionPeriod: "7d" + logging: + serviceLog: "STDOUT" + serviceLogLevel: "DEBUG" + serviceLogFormat: "JSON" + profiling: + enabled: true + s3Storage: + enabled: true + bucket: "posit-chronicle-dev" + compactionEnabled: true + +storage: + persistentVolumeSize: 10Gi diff --git a/charts/posit-chronicle/templates/_helpers.tpl b/charts/posit-chronicle/templates/_helpers.tpl index e50ef318..4616a9f9 100644 --- a/charts/posit-chronicle/templates/_helpers.tpl +++ b/charts/posit-chronicle/templates/_helpers.tpl @@ -61,7 +61,7 @@ Generate selector labels for various resources app: chronicle-server {{- end -}} -{{- define "posit-chronicle.serviceaccount.selectorLabels" -}} +{{- define "posit-chronicle.service.selectorLabels" -}} {{- range $key,$value := $.Values.serviceaccount.selectorLabels -}} {{ $key }}: {{ $value | quote }} {{ end }} diff --git a/charts/posit-chronicle/templates/serviceaccount.yaml b/charts/posit-chronicle/templates/serviceaccount.yaml index b65409c2..1f766675 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.enabled -}} apiVersion: v1 kind: ServiceAccount metadata: @@ -9,4 +9,3 @@ metadata: annotations: {{ include "posit-chronicle.serviceaccount.annotations" . | indent 4 }} {{- end -}} ---- diff --git a/charts/posit-chronicle/templates/stateful-set.yaml b/charts/posit-chronicle/templates/stateful-set.yaml index f9d6dbb1..48060b4f 100644 --- a/charts/posit-chronicle/templates/stateful-set.yaml +++ b/charts/posit-chronicle/templates/stateful-set.yaml @@ -9,12 +9,12 @@ spec: replicas: {{ .Values.replicas }} selector: matchLabels: - {{- include "posit-chronicle.selectorLabels" . | nindent 6 }} + {{- include "posit-chronicle.pod.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "posit-chronicle.pod.labels" . | nindent 8 }} - {{- include "posit-chronicle.selectorLabels" . | indent 8 }} + {{- include "posit-chronicle.pod.selectorLabels" . | indent 8 }} annotations: {{- include "posit-chronicle.pod.annotations" . | indent 8 }} spec: diff --git a/charts/posit-chronicle/templates/svc.yaml b/charts/posit-chronicle/templates/svc.yaml index 5910e362..2f1b0db0 100644 --- a/charts/posit-chronicle/templates/svc.yaml +++ b/charts/posit-chronicle/templates/svc.yaml @@ -4,12 +4,13 @@ kind: Service metadata: name: chronicle-server labels: - {{ include "posit-chronicle.service.labels" . | indent 4 }} + {{- include "posit-chronicle.service.labels" . | nindent 4 }} + {{- include "posit-chronicle.service.selectorLabels" . | indent 4 }} annotations: {{ include "posit-chronicle.service.annotations" . | indent 4 }} spec: selector: - {{- include "posit-chronicle.selectorLabels" . | nindent 5 }} + {{- include "posit-chronicle.service.selectorLabels" . | indent 4 }} ports: - port: {{ .Values.service.rest.port }} targetPort: {{ .Values.service.rest.targetPort }} diff --git a/charts/posit-chronicle/values.yaml b/charts/posit-chronicle/values.yaml index ed024c0c..a3c061ba 100644 --- a/charts/posit-chronicle/values.yaml +++ b/charts/posit-chronicle/values.yaml @@ -56,7 +56,7 @@ config: https: # If https.enabled=true, we will ignore any http # values and enable https in our config instead - enabled: false + enabled: false listen: ":443" key: "" certificate: ""