Skip to content

Commit 276808a

Browse files
committed
feat(helm): New oada chart version
1 parent 072af43 commit 276808a

13 files changed

Lines changed: 262 additions & 222 deletions

File tree

.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ root = true
66
[*]
77
indent_style = space
88
indent_size = 2
9+
tab_width = 2
910
end_of_line = lf
1011
charset = utf-8
1112
trim_trailing_whitespace = true
12-
insert_final_newline = false
13+
insert_final_newline = false
14+
max_line_length = 80
15+
spelling_language = en-US

.vscode/launch.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// vim: set ft=jsonc :
12
{
23
// Use IntelliSense to learn about possible attributes.
34
// Hover to view descriptions of existing attributes.
@@ -69,7 +70,7 @@
6970
"remoteRoot": "/oada/"
7071
},
7172
{
72-
"type": "node",
73+
"type": "pwa-node",
7374
"request": "attach",
7475
"name": "Attach to service",
7576
"smartStep": true,
@@ -103,4 +104,4 @@
103104
"default": "9229"
104105
}
105106
]
106-
}
107+
}

charts/oada/Chart.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# vim: set ft=helm :
12
apiVersion: v2
23
name: oada
34
description: A Helm chart for the OADA API server
@@ -13,11 +14,11 @@ keywords:
1314
- oauth 2.0
1415
- oidc
1516
- oada
16-
version: 4.0.0
17+
version: 5.0.0
1718
appVersion: 4.0.0
1819
annotations:
1920
artifacthub.io/recommendations: |
2021
- url: https://artifacthub.io/packages/helm/cert-manager/cert-manager
2122
- url: https://artifacthub.io/packages/helm/redpanda-data/operator
2223
- url: https://github.com/arangodb/kube-arangodb#installation-of-latest-release-using-helm
23-
- url: https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx
24+
- url: https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx

charts/oada/templates/_helpers.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{/* vim: set ft=helm : */}}
12
{{/*
23
* Copyright 2022 Open Ag Data Alliance
34
*

charts/oada/templates/auth.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{/* vim: set ft=helm : */}}
12
{{/*
23
* Copyright 2022 Open Ag Data Alliance
34
*
@@ -36,6 +37,7 @@ kind: Secret
3637
immutable: true
3738
metadata:
3839
annotations:
40+
helm.sh/hook: pre-install
3941
helm.sh/resource-policy: keep
4042
namespace: {{ .Release.Namespace }}
4143
name: auth-keys-{{ .Release.Name }}

charts/oada/templates/configmap.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{/* vim: set ft=helm : */}}
12
{{/*
23
* Copyright 2022 Open Ag Data Alliance
34
*

charts/oada/templates/deployment.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vim: set ft=helm :
1+
{{/* vim: set ft=helm : */}}
22
{{/*
33
* Copyright 2022 Open Ag Data Alliance
44
*
@@ -18,6 +18,7 @@
1818
{{- range $k, $v := .Values.oada.services -}}
1919
{{/* Deploy the OADA uservice `$k` */}}
2020
{{- $name := print $k "-" $.Release.Name -}}
21+
{{- if ne $v.enabled false }}
2122
apiVersion: apps/v1
2223
kind: Deployment
2324
metadata:
@@ -87,7 +88,7 @@ spec:
8788
name: {{ include "oada.arango.rootPassword" $ }}
8889
key: password
8990
optional: {{ $.Values.global.development }}
90-
image: {{ print "oada/" $k ":" $tag }}
91+
image: {{ print $.Values.oada.namespace $k ":" $tag }}
9192
imagePullPolicy: {{ $.Values.oada.imagePullPolicy }}
9293
command: ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "/bin/sh"]
9394
args: ["-c", "yarn workspace @oada/{{ $k }} run start"]
@@ -196,4 +197,5 @@ spec:
196197
any: false
197198
{{- end }}
198199
---
200+
{{ end -}}
199201
{{ end -}}

charts/oada/templates/init.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# vim: set ft=helm :
12
{{/*
23
* Copyright 2022 Open Ag Data Alliance
34
*
@@ -13,8 +14,6 @@
1314
* See the License for the specific language governing permissions and
1415
* limitations under the License.
1516
*/}}
16-
{{- $initName := print "init-" .Release.Name -}}
17-
{{- if empty (lookup "batch/v1" "Job" .Release.Namespace $initName) -}}
1817
{{- $tag := default .Chart.AppVersion .Values.oada.tag -}}
1918
apiVersion: batch/v1
2019
kind: Job
@@ -24,6 +23,12 @@ metadata:
2423
labels:
2524
app.kubernetes.io/component: init
2625
{{- include "oada.chart.labels" . | nindent 4 }}
26+
annotations:
27+
# This is what defines this resource as a hook. Without this line, the
28+
# job is considered part of the release.
29+
"helm.sh/hook": post-install
30+
#"helm.sh/hook": post-install,post-upgrade
31+
"helm.sh/hook-weight": "-5"
2732
spec:
2833
backoffLimit: 10
2934
template:
@@ -88,7 +93,7 @@ spec:
8893
- name: inspect
8994
containerPort: 9229
9095
{{- end }}
91-
image: oada/startup:{{ $tag }}
96+
image: {{ .Values.oada.namespace }}startup:{{ $tag }}
9297
imagePullPolicy: {{ .Values.oada.imagePullPolicy }}
9398
resources:
9499
limits: {{- toYaml $.Values.oada.resources.limits | nindent 14 }}
@@ -104,5 +109,4 @@ spec:
104109
- name: tmp
105110
emptyDir:
106111
sizeLimit: 1Gi
107-
#medium: Memory
108-
{{- end -}}
112+
#medium: Memory

charts/oada/templates/users.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# vim: set ft=helm :
12
{{/*
23
* Copyright 2022 Open Ag Data Alliance
34
*
@@ -34,7 +35,6 @@ stringData:
3435
{{- end }}
3536
---
3637
{{- $jobName := print "user-add-" .name "-" $.Release.Name -}}
37-
{{- if empty (lookup "batch/v1" "Job" $.Release.Namespace $jobName) }}
3838
apiVersion: batch/v1
3939
kind: Job
4040
metadata:
@@ -43,6 +43,12 @@ metadata:
4343
labels:
4444
app.kubernetes.io/component: init
4545
{{- include "oada.chart.labels" $ | nindent 4 }}
46+
annotations:
47+
# This is what defines this resource as a hook. Without this line, the
48+
# job is considered part of the release.
49+
"helm.sh/hook": post-install
50+
#"helm.sh/hook": post-install,post-upgrade
51+
"helm.sh/hook-weight": "5"
4652
spec:
4753
backoffLimit: 10
4854
template:
@@ -101,7 +107,7 @@ spec:
101107
- name: inspect
102108
containerPort: 9229
103109
{{- end }}
104-
image: oada/users:{{ $tag }}
110+
image: {{ $.Values.oada.namespace }}users:{{ $tag }}
105111
#imagePullPolicy: {{ $.Values.global.development | ternary "Always" "IfNotPresent" }}
106112
command:
107113
- /usr/bin/dumb-init
@@ -154,7 +160,7 @@ spec:
154160
- name: inspect
155161
containerPort: 9229
156162
{{- end }}
157-
image: oada/auth:{{ $tag }}
163+
image: {{ $.Values.oada.namespace }}auth:{{ $tag }}
158164
imagePullPolicy: {{ $.Values.oada.imagePullPolicy }}
159165
command: ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "/bin/sh"]
160166
args:
@@ -171,5 +177,4 @@ spec:
171177
allowPrivilegeEscalation: false
172178
readOnlyRootFilesystem: true
173179
---
174-
{{- end -}}
175180
{{- end }}

charts/oada/templates/uservice.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{/* vim: set ft=helm : */}}
12
{{/*
23
* Copyright 2023 Open Ag Data Alliance
34
*
@@ -16,6 +17,7 @@
1617
{{- range $k, $v := .Values.oada.externalServices -}}
1718
{{/* Deploy external OADA services `$k` */}}
1819
{{- $name := print $k "-" $.Release.Name -}}
20+
{{- if ne $v.enabled false }}
1921
apiVersion: apps/v1
2022
kind: Deployment
2123
metadata:
@@ -48,8 +50,14 @@ spec:
4850
- service
4951
- http-handler-{{ $.Release.Name }}
5052
resources:
51-
limits: {{- toYaml $.Values.k8sWaitFor.resources.limits | nindent 14 }}
52-
requests: {{- toYaml $.Values.k8sWaitFor.resources.limits | nindent 14 }}
53+
limits:
54+
{{- toYaml $.Values.k8sWaitFor.resources.limits | nindent 14 }}
55+
requests:
56+
{{- toYaml $.Values.k8sWaitFor.resources.limits | nindent 14 }}
57+
securityContext:
58+
#runAsUser: 1000 # run as user node (uid 1000)
59+
allowPrivilegeEscalation: false
60+
readOnlyRootFilesystem: true
5361
containers:
5462
- envFrom:
5563
- configMapRef:
@@ -73,7 +81,7 @@ spec:
7381
periodSeconds: 10
7482
securityContext:
7583
runAsNonRoot: true
76-
runAsUser: 1000 # run as user node (uid 1000)
84+
# runAsUser: 1000 # run as user node (uid 1000)
7785
allowPrivilegeEscalation: false
7886
readOnlyRootFilesystem: true
7987
name: {{ $name }}
@@ -147,4 +155,5 @@ spec:
147155
any: false
148156
{{- end }}
149157
---
158+
{{ end -}}
150159
{{ end -}}

0 commit comments

Comments
 (0)