Skip to content
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.

Commit

Permalink
fix(helm): use merge+dict to prevent memoize fix #59
Browse files Browse the repository at this point in the history
fix(helm): use merge+dict to prevent memoize fix #59
  • Loading branch information
devthejo authored Feb 20, 2023
2 parents 812500a + b4cd404 commit 6f1d5ed
Show file tree
Hide file tree
Showing 16 changed files with 612 additions and 40 deletions.
2 changes: 1 addition & 1 deletion packages/workflow/charts/app/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{ range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/charts/app/templates/redirect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
{{- include "annotations.letsencrypt-cert" . | nindent 4 }}
{{- end }}
nginx.ingress.kubernetes.io/permanent-redirect: https://{{- include "defaults.ingress-host" . -}}$request_uri
{{- range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{- range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/charts/hasura/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{ range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/charts/maildev/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{ range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/charts/metabase/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{ range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{ end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{ range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion packages/workflow/charts/pgweb/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
{{ range $key, $val := (merge .Values.global.ingress.annotations .Values.ingress.annotations) }}
{{ range $key, $val := (merge dict .Values.global.ingress.annotations .Values.ingress.annotations) }}
"{{ $key }}": |
{{- $val | nindent 6 }}
{{ end }}
Expand Down
297 changes: 297 additions & 0 deletions packages/workflow/tests/__snapshots__/multiple-apps.dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,297 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`multiple-apps.dev 1`] = `
"apiVersion: v1
kind: Namespace
metadata:
annotations:
janitor/ttl: 7d
field.cattle.io/projectId: '1234'
kubeworkflow/gitBranch: feature-branch-1
kubeworkflow/mainNamespace: 'true'
kapp.k14s.io/exists: ''
labels:
application: test-multiple-apps
cert: wildcard
name: test-multiple-apps-feature-branch-1
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: netpol-ingress
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/disable-original: ''
spec:
ingress:
- from:
- podSelector: {}
- from:
- namespaceSelector:
matchLabels:
network-policy/source: ingress-controller
- from:
- namespaceSelector:
matchLabels:
network-policy/source: monitoring
podSelector: {}
policyTypes:
- Ingress
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: default
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/disable-original: ''
automountServiceAccountToken: false
---
apiVersion: v1
kind: Service
metadata:
labels:
component: app-api
application: test-multiple-apps
name: app-api
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
kapp.k14s.io/disable-original: ''
spec:
ports:
- name: http
port: 80
targetPort: 3000
selector:
component: app-api
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
component: app-www
application: test-multiple-apps
name: app-www
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/disable-default-ownership-label-rules: ''
kapp.k14s.io/disable-default-label-scoping-rules: ''
kapp.k14s.io/disable-original: ''
spec:
ports:
- name: http
port: 80
targetPort: 3000
selector:
component: app-www
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
component: app-api
application: test-multiple-apps
name: app-api
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/change-group: kube-workflow/test-multiple-apps-feature-branch-1
kapp.k14s.io/change-group.app-api: kube-workflow/app-api.test-multiple-apps-feature-branch-1
kapp.k14s.io/disable-original: ''
kapp.k14s.io/create-strategy: fallback-on-update
kapp.k14s.io/update-strategy: fallback-on-replace
kapp.k14s.io/nonce: ''
spec:
replicas: 1
selector:
matchLabels:
component: app-api
template:
metadata:
labels:
component: app-api
application: test-multiple-apps
spec:
containers:
- image: >-
ghcr.io/socialgouv/test-multiple-apps/app:sha-ffac537e6cbbf934b08745a378932722df287a53
livenessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: app
ports:
- containerPort: 3000
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 50m
memory: 128Mi
startupProbe:
failureThreshold: 30
httpGet:
path: /index.html
port: http
periodSeconds: 5
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
component: app-www
application: test-multiple-apps
name: app-www
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/change-group: kube-workflow/test-multiple-apps-feature-branch-1
kapp.k14s.io/change-group.app-www: kube-workflow/app-www.test-multiple-apps-feature-branch-1
kapp.k14s.io/disable-original: ''
kapp.k14s.io/create-strategy: fallback-on-update
kapp.k14s.io/update-strategy: fallback-on-replace
kapp.k14s.io/nonce: ''
spec:
replicas: 1
selector:
matchLabels:
component: app-www
template:
metadata:
labels:
component: app-www
application: test-multiple-apps
spec:
containers:
- image: >-
ghcr.io/socialgouv/test-multiple-apps/app:sha-ffac537e6cbbf934b08745a378932722df287a53
livenessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 30
periodSeconds: 5
timeoutSeconds: 5
name: app
ports:
- containerPort: 3000
name: http
readinessProbe:
failureThreshold: 15
httpGet:
path: /index.html
port: http
initialDelaySeconds: 0
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 50m
memory: 128Mi
startupProbe:
failureThreshold: 30
httpGet:
path: /index.html
port: http
periodSeconds: 5
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kapp.k14s.io/disable-original: ''
labels:
component: app-api
application: test-multiple-apps
name: app-api
namespace: test-multiple-apps-feature-branch-1
spec:
rules:
- host: app-api-test-multiple-apps-feature-branch-1.dev.fabrique.social.gouv.fr
http:
paths:
- backend:
service:
name: app-api
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- >-
app-api-test-multiple-apps-feature-branch-1.dev.fabrique.social.gouv.fr
secretName: wildcard-crt
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
kapp.k14s.io/disable-original: ''
labels:
component: app-www
application: test-multiple-apps
name: app-www
namespace: test-multiple-apps-feature-branch-1
spec:
rules:
- host: app-www-test-multiple-apps-feature-branch-1.dev.fabrique.social.gouv.fr
http:
paths:
- backend:
service:
name: app-www
port:
name: http
path: /
pathType: Prefix
tls:
- hosts:
- >-
app-www-test-multiple-apps-feature-branch-1.dev.fabrique.social.gouv.fr
secretName: wildcard-crt
---
apiVersion: kapp.k14s.io/v1alpha1
kind: Config
rebaseRules:
- path:
- metadata
- annotations
- field.cattle.io/publicEndpoints
type: copy
sources:
- existing
resourceMatchers:
- apiVersionKindMatcher:
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: test-multiple-apps-feature-branch-1
annotations:
kapp.k14s.io/disable-original: ''
"
`;
Loading

0 comments on commit 6f1d5ed

Please sign in to comment.