Skip to content

Commit

Permalink
fix: Adding missing secretName in ingress configuration. Helm improve…
Browse files Browse the repository at this point in the history
…ments proposal. (#1604)

* Adding missing secretName in ingress configuration.  Introducing Bitnami charts.

Signed-off-by: cccs-eric <eric.ladouceur@cyber.gc.ca>

* Split configmap into indivudual ones and added checksum for deployment reload on change.  Also added metadata and search config class support.

Signed-off-by: cccs-eric <eric.ladouceur@cyber.gc.ca>
  • Loading branch information
cccs-eric authored Dec 13, 2021
1 parent 73b2c10 commit 7d94e68
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 134 deletions.
12 changes: 11 additions & 1 deletion amundsen-kube-helm/templates/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,14 @@ sources:
- https://github.com/amundsen-io/amundsen
keywords:
- metadata
- data
- data
dependencies:
- name: common
repository: https://charts.bitnami.com/bitnami
tags:
- bitnami-common
version: 1.x.x
- name: elasticsearch
version: 7.13.4
repository: https://helm.elastic.co
condition: elasticsearch.enabled
8 changes: 0 additions & 8 deletions amundsen-kube-helm/templates/helm/requirements.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "amundsen.fullname" . }}-{{ .Values.frontEnd.serviceName }}
labels:
app: {{ template "amundsen.name" . }}
component: {{ .Values.frontEnd.serviceName }}
chart: {{ template "amundsen.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
FRONTEND_BASE: {{ .Values.frontEnd.baseUrl }}
{{ if .Values.frontEnd.config.class }}
FRONTEND_SVC_CONFIG_MODULE_CLASS: {{ .Values.frontEnd.config.class }}
{{ end }}
SEARCHSERVICE_BASE: http://{{ .Chart.Name }}-{{ .Values.search.serviceName }}:5001
METADATASERVICE_BASE: http://{{ .Chart.Name }}-{{ .Values.metadata.serviceName }}:5002
LONG_RANDOM_STRING: {{ quote .Values.LONG_RANDOM_STRING }}
{{ if .Values.flaskApp.module }}
APP_WRAPPER: {{ .Values.flaskApp.module }}
{{ end }}
{{ if .Values.flaskApp.class }}
APP_WRAPPER_CLASS: {{ .Values.flaskApp.class }}
{{ end }}
{{ if .Values.frontEnd.ALL_UNEDITABLE_SCHEMAS }}
ALL_UNEDITABLE_SCHEMAS: {{ .Values.frontEnd.ALL_UNEDITABLE_SCHEMAS }}
{{ end }}
{{ if .Values.oidc.enabled }}
FLASK_APP_MODULE_NAME: flaskoidc
FLASK_APP_CLASS_NAME: FlaskOIDC
FLASK_OIDC_CLIENT_ID: {{ .Values.oidc.frontend.client_id }}
FLASK_OIDC_CLIENT_SECRET: {{ .Values.oidc.frontend.client_secret }}
{{ toYaml .Values.oidc.configs | indent 2 }}
{{ end }}
{{ if .Values.frontEnd.envVars }}
{{ toYaml .Values.frontEnd.envVars | indent 2 }}
{{ end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "amundsen.fullname" . }}-{{ .Values.metadata.serviceName }}
labels:
app: {{ include "amundsen.name" . }}
component: {{ include "amundsen.fullname" . }}
chart: {{ include "amundsen.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ if .Values.metadata.config.class }}
METADATA_SVC_CONFIG_MODULE_CLASS: {{ .Values.metadata.config.class }}
{{ end }}
PROXY_HOST: {{ if .Values.metadata.proxy.host }}{{ .Values.metadata.proxy.host }}{{ else }}bolt://{{ .Release.Name }}-neo4j.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}{{ end }}
{{ if .Values.metadata.proxy.port }}
PROXY_PORT: {{ .Values.metadata.proxy.port }}
{{ end }}
{{ if .Values.metadata.proxy.user }}
CREDENTIALS_PROXY_USER: {{ .Values.metadata.proxy.user }}
{{ end }}
{{ if .Values.metadata.proxy.password }}
CREDENTIALS_PROXY_PASSWORD: {{ .Values.metadata.proxy.password }}
{{ end }}
{{ if .Values.flaskApp.module }}
FLASK_APP_MODULE_NAME: {{ .Values.flaskApp.module }}
{{ end }}
{{ if .Values.flaskApp.class }}
FLASK_APP_CLASS_NAME: {{ .Values.flaskApp.class }}
{{ end }}
{{ if .Values.oidc.enabled }}
FLASK_APP_MODULE_NAME: flaskoidc
FLASK_APP_CLASS_NAME: FlaskOIDC
FLASK_OIDC_CLIENT_ID: {{ .Values.oidc.metadata.client_id }}
FLASK_OIDC_CLIENT_SECRET: {{ .Values.oidc.metadata.client_secret }}
{{ toYaml .Values.oidc.configs | indent 2 }}
{{ end }}
{{ if .Values.metadata.envVars }}
{{ toYaml .Values.metadata.envVars | indent 2 }}
{{ end }}
38 changes: 38 additions & 0 deletions amundsen-kube-helm/templates/helm/templates/configmap-search.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "amundsen.fullname" . }}-{{ .Values.search.serviceName }}
labels:
app: {{ include "amundsen.name" . }}
component: {{ include "amundsen.fullname" . }}
chart: {{ include "amundsen.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
{{ if .Values.search.config.class }}
SEARCH_SVC_CONFIG_MODULE_CLASS: {{ .Values.search.config.class }}
{{ end }}
PROXY_ENDPOINT: {{ if .Values.search.proxy.endpoint }}{{ .Values.search.proxy.endpoint }}{{ else }}{{ .Values.elasticsearch.fullnameOverride }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}{{ end }}
{{ if .Values.search.proxy.user }}
CREDENTIALS_PROXY_USER: {{ .Values.search.proxy.user }}
{{ end }}
{{ if .Values.search.proxy.password }}
CREDENTIALS_PROXY_PASSWORD: {{ .Values.search.proxy.password }}
{{ end }}

{{ if .Values.flaskApp.module }}
FLASK_APP_MODULE_NAME: {{ .Values.flaskApp.module }}
{{ end }}
{{ if .Values.flaskApp.class }}
FLASK_APP_CLASS_NAME: {{ .Values.flaskApp.class }}
{{ end }}
{{ if .Values.oidc.enabled }}
FLASK_APP_MODULE_NAME: flaskoidc
FLASK_APP_CLASS_NAME: FlaskOIDC
FLASK_OIDC_CLIENT_ID: {{ .Values.oidc.search.client_id }}
FLASK_OIDC_CLIENT_SECRET: {{ .Values.oidc.search.client_secret }}
{{ toYaml .Values.oidc.configs | indent 2 }}
{{ end }}
{{ if .Values.search.envVars }}
{{ toYaml .Values.search.envVars | indent 2 }}
{{ end }}
111 changes: 0 additions & 111 deletions amundsen-kube-helm/templates/helm/templates/configmaps.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ spec:
replicas: {{ default 1 .Values.frontEnd.replicas }}
template:
metadata:
{{- with default .Values.podAnnotations .Values.frontEnd.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-frontend.yaml") . | sha256sum }}
{{- with default .Values.podAnnotations .Values.frontEnd.podAnnotations }}
{{ toYaml . | indent 8 }}
{{- end }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ spec:
replicas: {{ default 1 .Values.metadata.replicas }}
template:
metadata:
{{- with default .Values.podAnnotations .Values.metadata.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-metadata.yaml") . | sha256sum }}
{{- with default .Values.podAnnotations .Values.metadata.podAnnotations }}
{{ toYaml . | indent 8 }}
{{- end }}
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ spec:
replicas: {{ default 1 .Values.search.replicas }}
template:
metadata:
{{- with default .Values.podAnnotations .Values.search.podAnnotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-search.yaml") . | sha256sum }}
{{- with default .Values.podAnnotations .Values.search.podAnnotations }}
{{ toYaml . | indent 8 }}
{{- end }}
labels:
Expand Down
22 changes: 11 additions & 11 deletions amundsen-kube-helm/templates/helm/templates/ingress-frontend.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{{- if .Values.ingress.enabled -}}
{{- $dot := . }}
# There is an issue when we want to use . in a range loop. for more details and solution. Please visite below url
# https://stackoverflow.com/questions/54180804/chart-name-cant-evaluate-field-chart-in-type-string
apiVersion: networking.k8s.io/v1
apiVersion: {{ include "common.capabilities.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ template "amundsen.name" $dot }}-{{ $.Values.frontEnd.serviceName }}
name: {{ include "common.names.name" . }}-{{ $.Values.frontEnd.serviceName }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
spec:
{{- if .Values.ingress.tls }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
Expand All @@ -26,10 +26,10 @@ spec:
pathType: Prefix
backend:
service:
name: {{ template "amundsen.name" $dot }}-{{ $.Values.frontEnd.serviceName }}
name: {{ template "amundsen.name" $ }}-{{ $.Values.frontEnd.serviceName }}
port:
# the port config in frontend service and deployement is fixed. so we have no choice here
number: 5000
{{- end }}
{{- end }}
{{- end }}
{{- end }}
8 changes: 8 additions & 0 deletions amundsen-kube-helm/templates/helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ search:
# search.replicas -- How many replicas of the search service to run.
replicas: 1

# search.config.class -- Optional Config class.
config:
class:

# search.resources -- See pod resourcing [ref](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
resources: {}
# limits:
Expand Down Expand Up @@ -186,6 +190,10 @@ metadata:
# metadata.replicas -- How many replicas of the metadata service to run.
replicas: 1

# metadata.config.class -- Optional Config class.
config:
class:

# metadata.resources -- See pod resourcing [ref](https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
resources: {}
# limits:
Expand Down

0 comments on commit 7d94e68

Please sign in to comment.