Skip to content

Commit

Permalink
feat(helm): polish chart for 1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Jun 1, 2022
1 parent a21039d commit b864264
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 19 deletions.
12 changes: 9 additions & 3 deletions charts/oada/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
apiVersion: v2
name: oada
description: A Helm chart for the OADA server
description: A Helm chart for the OADA API server
sources:
- https://github.com/OADA/server
icon: https://avatars.githubusercontent.com/u/6750653
maintainers:
- name: awlayton
email: alex@layton.in

# A chart can be either an 'application' or a 'library' chart.
#
Expand All @@ -15,10 +21,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 1.0.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: '3.2.0'
appVersion: '3.3.0'
10 changes: 8 additions & 2 deletions charts/oada/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,17 @@ Attempt to apply all prerequisites:
`kubectl apply -k ../../k8s/support`

The above command might error on the first run.
After 2-3 times, it should run without error.
After 2-3 times, it _should_ run without error.

**If the above does not work for you,
google how to set up the listed prerequisites for your specific k8s cluster.**

## Installation

Add the helm chart repo
`helm repo add oada https://charts.openag.io/`

Install the Helm chart:
`helm install oada .`
`helm install oada oada`

See the [values.yaml](values.yaml) for various configuration options.
2 changes: 0 additions & 2 deletions charts/oada/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ data:
NODE_ENV: development
NODE_TLS_REJECT_UNAUTHORIZED: '0'
arangodb__ensureDefaults: 'true'
{{ if .Values.oada.inspect -}}
INSPECT: '--inspect=0.0.0.0:9229'
{{ end -}}
{{ else -}}
NODE_ENV: production
{{- end }}
9 changes: 5 additions & 4 deletions charts/oada/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/}}
{{- $tag := default .Chart.AppVersion .Values.oada.tag -}}
{{- range $k, $v := .Values.oada.services -}}
{{/* Deploy the OADA uservice `$k` */}}
{{- $name := print $k "-" $.Release.Name -}}
Expand Down Expand Up @@ -52,7 +53,7 @@ spec:
- envFrom:
- configMapRef:
name: {{ $.Chart.Name }}-configmap-{{ $.Release.Name }}
image: {{ print "oada/" $k ":" $.Values.oada.tag }}
image: {{ print "oada/" $k ":" $tag }}
#imagePullPolicy: {{ $.Values.global.development | ternary "Always" "IfNotPresent" }}
command: ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "/bin/sh"]
args: ["-c", "yarn workspace @oada/{{ $k }} run start"]
Expand All @@ -64,13 +65,13 @@ spec:
name: {{ $name }}
resources:
{{- toYaml $.Values.oada.resources | nindent 12 }}
{{ if or $v.http $.Values.oada.inspect -}}
{{ if or $v.http $.Values.global.development -}}
ports:
{{ if $v.http -}}
- name: http
containerPort: 8080
{{- end }}
{{ if $.Values.oada.inspect -}}
{{ if $.Values.global.development -}}
- name: inspect
containerPort: 9229
{{- end }}
Expand Down Expand Up @@ -123,4 +124,4 @@ spec:
{{- end }}
{{- end }}
---
{{- end -}}
{{ end -}}
3 changes: 2 additions & 1 deletion charts/oada/templates/init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/}}
{{- $tag := default .Chart.AppVersion .Values.oada.tag -}}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down Expand Up @@ -51,5 +52,5 @@ spec:
env:
- name: EXIT
value: 'true'
image: oada/startup:{{ .Values.oada.tag }}
image: oada/startup:{{ $tag }}
#imagePullPolicy: {{ .Values.global.development | ternary "Always" "IfNotPresent" }}
1 change: 1 addition & 0 deletions charts/oada/templates/tests/bookmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/}}
{{- $user := first .Values.oada.users -}}
---
apiVersion: v1
kind: Pod
metadata:
Expand Down
2 changes: 1 addition & 1 deletion charts/oada/templates/tests/well-known.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/}}
{{- range tuple "oada-configuration" "openid-configuration" -}}
---
apiVersion: v1
kind: Pod
metadata:
Expand All @@ -34,5 +35,4 @@ spec:
{{- end }}
- http://well-known-{{ $.Release.Name }}/.well-known/{{ . }}
restartPolicy: Never
---
{{- end -}}
11 changes: 9 additions & 2 deletions charts/oada/templates/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/}}
{{- $tag := default .Chart.AppVersion .Values.oada.tag -}}
{{- range .Values.oada.users -}}
{{- $secretName := print "user-" .name "-" $.Release.Name -}}
apiVersion: v1
Expand Down Expand Up @@ -52,11 +53,16 @@ spec:
args:
- job
- init-{{ $.Release.Name }}
- name: wait-for-users
image: {{ $.Values.k8sWaitFor.image }}:{{ $.Values.k8sWaitFor.tag }}
args:
- pod
- '-l app.kubernetes.io/name=users,app.kubernetes.io/instance={{ $.Release.Name }}'
- name: user-add
envFrom:
- configMapRef:
name: {{ $.Chart.Name }}-configmap-{{ $.Release.Name }}
image: oada/users:{{ $.Values.oada.tag }}
image: oada/users:{{ $tag }}
#imagePullPolicy: {{ $.Values.global.development | ternary "Always" "IfNotPresent" }}
command: ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "/bin/sh"]
args: ["-c", "yarn workspace @oada/users run add -u {{ .name }} -a {{ .admin | default false }} "]
Expand All @@ -71,8 +77,9 @@ spec:
secretKeyRef:
name: {{ $secretName }}
key: token
image: oada/users:{{ $.Values.oada.tag }}
image: oada/users:{{ $tag }}
#imagePullPolicy: {{ $.Values.global.development | ternary "Always" "IfNotPresent" }}
command: ["/usr/bin/dumb-init", "--rewrite", "15:2", "--", "/bin/sh"]
args: ["-c", "yarn workspace @oada/auth run token create -u {{ .name }} -s {{ .scope | join "," }} ${TOKEN} "]
---
{{- end -}}
8 changes: 4 additions & 4 deletions charts/oada/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ oada:
# oada.ingress is whether to create ingresses into the OADA API
ingress: true
# oada.tag is the Docker tag for the OADA images
tag: edge
tag: ~
# oada.services is the list of oada services to deploy
services:
http-handler:
Expand All @@ -29,13 +29,13 @@ oada:
- all:all
- oada.admin.user:all
resources: {}
# oada.inspect wether to enable the node inspector for OADA services
inspect: false

# debug is the list of debug.js namespaces to enable/disable
debug:
- '*'

pino:
# pino.level is the level of messages to send to the pino transport
level: info

autoscaling:
Expand All @@ -62,7 +62,7 @@ kafka:
# If this is not empty, the Redpanda service will not be deployed.
# If this is empty, the redpanda operator will be used to deploy a cluster.
brokers: []
# kafka.image is the Docker image to use for arangodb
# kafka.image is the Docker image to use for Kafka
image: vectorized/redpanda
# kafka.tag is the Docker tag for the Kafka/Redpanda images
tag: v22.1.3
Expand Down
1 change: 1 addition & 0 deletions oada-server.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@
"kafa",
"Kafkajs",
"ksuid",
"kube",
"kubernetes",
"Kustomization",
"kustomize",
Expand Down

0 comments on commit b864264

Please sign in to comment.