Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Commit

Permalink
Merge pull request #42 from direktiv/alan/small_charts_cleanup
Browse files Browse the repository at this point in the history
Alan/small charts cleanup
  • Loading branch information
jensg-st authored Dec 11, 2023
2 parents e8b6a08 + 32019c8 commit 3fd15b9
Show file tree
Hide file tree
Showing 21 changed files with 297 additions and 799 deletions.
8 changes: 4 additions & 4 deletions charts/direktiv/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 25.0.0
version: 25.8.1
- name: ingress-nginx
repository: https://kubernetes.github.io/ingress-nginx
version: 4.7.2
digest: sha256:6ffafd3f3e76795552294eca006af6918ddce9e52ef8b4e58b743e284d9035f9
generated: "2023-09-20T15:17:02.267293899+02:00"
version: 4.8.4
digest: sha256:1c54ff062d3ecdfa89d7826ca5205205ed7ac31b20c8fb5a262562456861e387
generated: "2023-12-11T09:58:43.022211048+01:00"
6 changes: 3 additions & 3 deletions charts/direktiv/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ appVersion: "v0.8.0"
dependencies:
- name: prometheus
repository: "https://prometheus-community.github.io/helm-charts"
version: "25.0.0"
version: "25.8.0"
condition: prometheus.install
- name: ingress-nginx
repository: "https://kubernetes.github.io/ingress-nginx"
version: "4.7.2"
condition: ingress-nginx.install
version: "4.8.4"
condition: ingress-nginx.install
123 changes: 0 additions & 123 deletions charts/direktiv/templates/api/api-deployment.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions charts/direktiv/templates/api/api-gw.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions charts/direktiv/templates/api/api-service.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions charts/direktiv/templates/flow/flow-cm-config.yaml

This file was deleted.

99 changes: 56 additions & 43 deletions charts/direktiv/templates/flow/flow-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "direktiv.serviceAccountName" . }}
initContainers:
- name: updatedb
image: "{{ .Values.registry }}/{{ .Values.flow.dbimage }}:{{ .Values.flow.tag | default .Chart.AppVersion }}"
env:
- name: DIREKTIV_APP
value: "flow_dbinit"
- name: DIREKTIV_DB
valueFrom:
secretKeyRef:
name: {{ include "direktiv.fullname" . }}
key: db
serviceAccountName: {{ include "direktiv.serviceAccountName" . }}-functions
containers:
{{- if .Values.opentelemetry.enabled }}
{{ include "direktiv.opentelemetry" . | indent 8 }}
Expand All @@ -72,26 +61,23 @@ spec:
memory: "128Mi"
limits:
memory: "2048Mi"
image: "{{ .Values.registry }}/{{ .Values.flow.image }}:{{ .Values.flow.tag | default .Chart.AppVersion }}"
image: "{{ .Values.registry }}/{{ .Values.image }}:{{ .Values.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.pullPolicy }}
command: ["/bin/direktiv", "server", "/etc/direktiv/flow-config.yaml"]
command: ["/bin/direktiv", "server"]
volumeMounts:
{{- if .Values.flow.extraVolumeMounts -}}
{{ toYaml .Values.flow.extraVolumeMounts | nindent 10 }}
{{- end }}
- name: flow-config
mountPath: /etc/direktiv/flow-config.yaml
subPath: flow-config.yaml
ports:
- name: bus
containerPort: 4222
protocol: TCP
- name: cluster
containerPort: 6222
- name: flow-v1
containerPort: 6665
protocol: TCP
- name: flow
containerPort: 6666
protocol: TCP
- name: flow-v2
containerPort: 6667
protocol: TCP
- name: internal
containerPort: 7777
protocol: TCP
Expand All @@ -103,15 +89,55 @@ spec:
env:
- name: DIREKTIV_APP
value: "flow"
- name: DIREKTIV_LOG_JSON
value: {{ .Values.logging | quote }}
- name: DIREKTIV_DEBUG
value: {{ .Values.debug | quote }}
- name: DIREKTIV_SECRETS_KEY
value: {{ .Values.flow.debug | quote }}
- name: DIREKTIV_LOG_FORMAT
value: {{ .Values.flow.logging | quote }}
- name: DIREKTIV_API_V1_PORT
value: "6665"
- name: DIREKTIV_API_V2_PORT
value: "6667"
- name: DIREKTIV_GRPC_PORT
value: "6666"
{{- if ne .Values.apikey "none" }}
- name: DIREKTIV_API_KEY
value: {{ .Values.apikey }}
{{- end }}
- name: DIREKTIV_SECRET_KEY
valueFrom:
secretKeyRef:
name: {{ include "direktiv.fullname" . }}
key: key
- name: DIREKTIV_DB
valueFrom:
secretKeyRef:
name: {{ include "direktiv.fullname" . }}
key: db
- name: DIREKTIV_FUNCTIONS_TIMEOUT
value: {{ .Values.requestTimeout | quote }}
- name: DIREKTIV_PROMETHEUS_BACKEND
value: {{ .Values.prometheus.backendName | quote }}
{{- if .Values.prometheus.install }}
value: {{ include "direktiv.fullname" . }}-prometheus-server.{{ .Release.Namespace }}
{{- else }}
value: {{ .Values.prometheus.backendName }}
{{- end }}
- name: DIREKTIV_OPEN_TELEMETRY_BACKEND
value: {{ include "direktiv.opentelemetry-backend" . }}
- name: DIREKTIV_ENABLE_EVENTING
value: {{ .Values.eventing.enabled | quote }}
- name: DIREKTIV_KNATIVE_SERVICE_ACCOUNT
value: "direktiv-functions-pod"
- name: DIREKTIV_KNATIVE_NAMESPACE
value: "direktiv-services-direktiv"
- name: DIREKTIV_KNATIVE_INGRESS_CLASS
value: "contour.ingress.networking.knative.dev"
- name: DIREKTIV_KNATIVE_SIDECAR
value: "{{ .Values.registry }}/{{ .Values.image }}:{{ .Values.tag | default .Chart.AppVersion }}"
- name: DIREKTIV_KNATIVE_MAX_SCALE
value: "5"
- name: DIREKTIV_KNATIVE_NET_SHAPE
value: "10M"
- name: DIREKTIV_SERVICE_NAMESPACE
value: {{ .Values.functions.namespace }}
{{- if or (ne .Values.http_proxy "") (ne .Values.https_proxy "") }}
Expand All @@ -122,36 +148,23 @@ spec:
- name: "NO_PROXY"
value: "{{ .Values.no_proxy }}"
{{- end }}
- name: DIREKTIV_DB
valueFrom:
secretKeyRef:
name: {{ include "direktiv.fullname" . }}
key: db
- name: DIREKTIV_DEPLOYMENT_NAME
value: "{{ include "direktiv.fullname" . }}"
- name: DIREKTIV_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NATS_PWD
valueFrom:
secretKeyRef:
name: {{ include "direktiv.fullname" . }}
key: natsPwd
- name: ENABLE_EXPERIMENTAL_FEATURES
value: "{{ .Values.flow.experimental_features }}"
- name: ENABLE_DEVELOPER_MODE
value: "{{ .Values.flow.developer_mode }}"
{{- range .Values.flow.extraVariables }}
- name: {{ .name | quote }}
value: {{ .value | quote }}
{{- end }}
volumes:
{{- if .Values.opentelemetry.enabled }}
{{ include "direktiv.opentelemetry.volume" . | indent 8 }}
{{- end }}
{{- if .Values.flow.extraVolumes }}
{{ toYaml .Values.flow.extraVolumes | nindent 8 }}
{{- end }}
- name: flow-config
configMap:
name: {{ include "direktiv.fullname" . }}-config-flow
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
16 changes: 10 additions & 6 deletions charts/direktiv/templates/flow/flow-secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ metadata:
{{- include "direktiv.labels" . | nindent 4 }}
type: Opaque
data:
db: {{ printf "host=%s port=%d user=%s dbname=%s password=%s sslmode=%s %s" .Values.database.host ( .Values.database.port | int64 ) .Values.database.user .Values.database.name .Values.database.password .Values.database.sslmode .Values.database.additional | b64enc | quote }}
{{- if .Values.encryptionKey }}
key: {{ .Values.encryptionKey | b64enc | quote }}
{{- else }}
key: {{ randAlphaNum 32 | b64enc | quote }}
{{- end }}

{{- $secretName := "direktiv.fullname" -}}
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace $secretName) | default dict }}
{{- $secretData := (get $secretObj "data") | default dict }}

db: {{ printf "host=%s port=%d user=%s dbname=%s password=%s sslmode=%s %s" .Values.database.host ( .Values.database.port | int64 ) .Values.database.user .Values.database.name .Values.database.password .Values.database.sslmode .Values.database.additional | b64enc | quote }}

{{- if .Values.flow.encryptionKey }}
key: {{ .Values.flow.encryptionKey | b64enc | quote }}
{{- else }}
{{- $secret := (get $secretData "jwt-secret") | default (randAlphaNum 32 | b64enc) }}
key: {{ $secret | quote }}
{{- end }}

{{- $natsPwd := (get $secretData "natsPwd") | default (randAlphaNum 32 | b64enc) }}
natsPwd: {{ $natsPwd | quote }}
Loading

0 comments on commit 3fd15b9

Please sign in to comment.