Skip to content

Commit

Permalink
🔧(helm) add option to configure deployment annotations
Browse files Browse the repository at this point in the history
We need to be abble to add specific annotations on Deployment in order
to use a reloader when external-secret sync new secrets
  • Loading branch information
rouja authored and AntoLC committed Jan 9, 2025
1 parent bbb176e commit f12c06e
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 126 deletions.
2 changes: 1 addition & 1 deletion src/helm/helmfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ releases:
installed: {{ eq .Environment.Name "dev" | toYaml }}
namespace: {{ .Namespace }}
chart: bitnami/redis
version: 18.19.2
version: 20.6.2
values:
- auth:
password: pass
Expand Down
2 changes: 1 addition & 1 deletion src/helm/impress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
type: application
name: docs
version: 0.0.1
version: 0.0.2
appVersion: latest
331 changes: 215 additions & 116 deletions src/helm/impress/README.md

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/helm/impress/generate-readme.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

docker image ls | grep readme-generator-for-helm
if [ "$?" -ne "0" ]; then
git clone https://github.com/bitnami/readme-generator-for-helm.git /tmp/readme-generator-for-helm
cd /tmp/readme-generator-for-helm
docker build -t readme-generator-for-helm:latest .
cd $(dirname -- "${BASH_SOURCE[0]}")
git clone https://github.com/bitnami/readme-generator-for-helm.git /tmp/readme-generator-for-helm
cd /tmp/readme-generator-for-helm
docker build -t readme-generator-for-helm:latest .
cd $(dirname -- "${BASH_SOURCE[0]}")
fi
docker run --rm -it -v ./values.yaml:/app/values.yaml -v ./README.md:/app/README.md readme-generator-for-helm:latest readme-generator -v values.yaml -r README.md
docker run --rm -it -v .:/source -w /source readme-generator-for-helm:latest readme-generator -v values.yaml -r README.md
4 changes: 4 additions & 0 deletions src/helm/impress/templates/backend_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ kind: Deployment
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- with .Values.backend.dpAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "impress.common.labels" (list . $component) | nindent 4 }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions src/helm/impress/templates/frontend_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ kind: Deployment
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- with .Values.backend.dpAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "impress.common.labels" (list . $component) | nindent 4 }}
spec:
Expand Down
4 changes: 4 additions & 0 deletions src/helm/impress/templates/yprovider_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ kind: Deployment
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- with .Values.backend.dpAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "impress.common.labels" (list . $component) | nindent 4 }}
spec:
Expand Down
29 changes: 26 additions & 3 deletions src/helm/impress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ ingressCollaborationWS:
className: null
host: impress.example.com
path: /collaboration/ws/
## @param ingress.hosts Additional host to configure for the Ingress
## @param ingressCollaborationWS.hosts Additional host to configure for the Ingress
hosts: []
# - chart-example.local
## @param ingressCollaborationWS.tls.enabled Weather to enable TLS for the Ingress
Expand All @@ -75,6 +75,12 @@ ingressCollaborationWS:
## @param ingressCollaborationWS.customBackends Add custom backends to ingress
customBackends: []

## @param ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/auth-response-headers
## @param ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/auth-url
## @param ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/enable-websocket
## @param ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/proxy-read-timeout
## @param ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/proxy-send-timeout
## @param ingressCollaborationWS.annotations.nginx.ingress.kubernetes.io/upstream-hash-by
annotations:
nginx.ingress.kubernetes.io/auth-response-headers: "Authorization, X-Can-Edit, X-User-Id"
nginx.ingress.kubernetes.io/auth-url: https://impress.example.com/api/v1.0/documents/collaboration-auth/
Expand All @@ -92,7 +98,7 @@ ingressCollaborationApi:
className: null
host: impress.example.com
path: /collaboration/api/
## @param ingress.hosts Additional host to configure for the Ingress
## @param ingressCollaborationApi.hosts Additional host to configure for the Ingress
hosts: []
# - chart-example.local
## @param ingressCollaborationApi.tls.enabled Weather to enable TLS for the Ingress
Expand All @@ -108,6 +114,7 @@ ingressCollaborationApi:
## @param ingressCollaborationApi.customBackends Add custom backends to ingress
customBackends: []

## @param ingressCollaborationApi.annotations.nginx.ingress.kubernetes.io/upstream-hash-by
annotations:
nginx.ingress.kubernetes.io/upstream-hash-by: $arg_room

Expand Down Expand Up @@ -156,11 +163,17 @@ ingressMedia:
secretName: null
additional: []

## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-url
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/auth-response-headers
## @param ingressMedia.annotations.nginx.ingress.kubernetes.io/upstream-vhost
annotations:
nginx.ingress.kubernetes.io/auth-url: https://impress.example.com/api/v1.0/documents/media-auth/
nginx.ingress.kubernetes.io/auth-response-headers: "Authorization, X-Amz-Date, X-Amz-Content-SHA256"
nginx.ingress.kubernetes.io/upstream-vhost: minio.impress.svc.cluster.local:9000

## @param serviceMedia.host
## @param serviceMedia.port
## @param serviceMedia.annotations
serviceMedia:
host: minio.impress.svc.cluster.local
port: 9000
Expand Down Expand Up @@ -205,6 +218,9 @@ backend:
## @param backend.podAnnotations Annotations to add to the backend Pod
podAnnotations: {}

## @param backend.dpAnnotations Annotations to add to the backend Deployment
dpAnnotations: {}

## @param backend.service.type backend Service type
## @param backend.service.port backend Service listening port
## @param backend.service.targetPort backend container listening port
Expand Down Expand Up @@ -322,6 +338,9 @@ frontend:
## @param frontend.podAnnotations Annotations to add to the frontend Pod
podAnnotations: {}

## @param frontend.dpAnnotations Annotations to add to the frontend Deployment
dpAnnotations: {}

## @param frontend.service.type frontend Service type
## @param frontend.service.port frontend Service listening port
## @param frontend.service.targetPort frontend container listening port
Expand Down Expand Up @@ -413,6 +432,9 @@ yProvider:
## @param yProvider.podAnnotations Annotations to add to the yProvider Pod
podAnnotations: {}

## @param yProvider.dpAnnotations Annotations to add to the yProvider Deployment
dpAnnotations: {}

## @param yProvider.service.type yProvider Service type
## @param yProvider.service.port yProvider Service listening port
## @param yProvider.service.targetPort yProvider container listening port
Expand All @@ -423,7 +445,6 @@ yProvider:
targetPort: 4444
annotations: {}

## @param yProvider.probes Configure probe for yProvider
## @extra yProvider.probes.liveness.path Configure path for yProvider HTTP liveness probe
## @extra yProvider.probes.liveness.targetPort Configure port for yProvider HTTP liveness probe
## @extra yProvider.probes.liveness.initialDelaySeconds Configure initial delay for yProvider liveness probe
Expand All @@ -438,6 +459,8 @@ yProvider:
## @extra yProvider.probes.readiness.initialDelaySeconds Configure timeout for yProvider readiness probe
probes:
liveness:
## @param yProvider.probes.liveness.path
## @param yProvider.probes.liveness.initialDelaySeconds
path: /ping
initialDelaySeconds: 10

Expand Down

0 comments on commit f12c06e

Please sign in to comment.