Skip to content

Commit

Permalink
feat(helm): update chart for OADA v4
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed Aug 2, 2024
1 parent 5347ea2 commit ace11ed
Show file tree
Hide file tree
Showing 6 changed files with 265 additions and 73 deletions.
14 changes: 9 additions & 5 deletions charts/oada/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ maintainers:
- name: awlayton
email: [email protected]
type: application
version: 3.4.0
appVersion: 3.10.0
keywords:
- api
- oauth 2.0
- oidc
- oada
version: 4.0.0
appVersion: 4.0.0
annotations:
artifacthub.io/recommendations: |
- url: https://artifacthub.io/packages/helm/cert-manager/cert-manager
- url: https://artifacthub.io/packages/helm/redpanda/redpanda-operator
- url: https://artifacthub.io/packages/helm/source-field/kube-arangodb
- url: https://artifacthub.io/packages/helm/source-field/kube-arangodb-crd
- url: https://artifacthub.io/packages/helm/redpanda-data/operator
- url: https://github.com/arangodb/kube-arangodb#installation-of-latest-release-using-helm
- url: https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx
2 changes: 2 additions & 0 deletions charts/oada/templates/init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
- configMapRef:
name: {{ .Chart.Name }}-configmap-{{ .Release.Name }}
env:
- name: CONFIG
value: /oada.config.mjs
- name: ARANGODB_USERNAME
valueFrom:
secretKeyRef:
Expand Down
106 changes: 47 additions & 59 deletions charts/oada/templates/redpanda.yaml
Original file line number Diff line number Diff line change
@@ -1,73 +1,61 @@
{{- if eq (include "oada.kafka.deploy" .) "true" }}
apiVersion: redpanda.vectorized.io/v1alpha1
kind: Cluster
apiVersion: cluster.redpanda.com/v1alpha1
kind: Redpanda
metadata:
namespace: {{ .Release.Namespace }}
name: redpanda-{{ .Release.Name }}
labels:
app.kubernetes.io/component: redpanda
{{- include "oada.chart.labels" . | nindent 4 }}
spec:
image: {{ .Values.kafka.image }}
version: {{ .Values.kafka.tag }}
replicas: 1
resources:
requests:
chartRef:
chartVersion: {{ .Values.kafka.chartVersion }}
clusterSpec:
image:
repository: {{ .Values.kafka.image }}
tag: {{ .Values.kafka.tag }}
statefulset:
replicas: 1
resources:
{{- if .Values.global.development }}
cpu: 100m
#cpu: 100m
{{- else }}
cpu: 1
{{- end }}
memory: 1.2Gi
#ephemeral-storage: 1Gi
limits:
cpu: 1
memory: 1.2Gi
cpu:
cores: 4
memory:
enable_memory_locking: true
container:
max: 10Gi
#ephemeral-storage: 1Gi
configuration:
autoCreateTopics: true
rpcServer:
port: 33145
kafkaApi:
- port: 9092
{{- if .Values.global.development }}
- external:
enabled: true
{{- end }}
pandaproxyApi:
- port: 8082
{{- if .Values.global.development }}
- external:
enabled: true
{{- end }}
adminApi:
- port: 9644
{{- if .Values.global.development }}
- external:
enabled: true
logging:
logLevel: info
usageStats:
enabled: false
{{- if eq (include "oada.prometheus" $) "true" }}
monitoring:
enabled: true
{{- end }}
external:
{{- if .Values.global.development }}
enabled: true
service:
enabled: true
{{- else }}
enabled: false
{{- end }}
developerMode: {{ .Values.global.development }}
{{- if eq (include "oada.prometheus" $) "true" }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
namespace: {{ .Release.Namespace }}
name: redpanda-{{ .Release.Name }}
labels:
app.kubernetes.io/component: redpanda
{{- include "oada.chart.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/component: redpanda
{{- include "oada.chart.selectorLabels" . | nindent 6 }}
endpoints:
- port: admin
path: /public_metrics
- port: admin
path: /metrics
namespaceSelector:
any: false
{{- end }}
listeners:
admin:
port: 9644
kafka:
port: 9092
tls:
enabled: false
http:
port: 8082
rpc:
port: 33145
config:
node:
developer_mode: {{ .Values.global.development }}
{{- end }}
31 changes: 27 additions & 4 deletions charts/oada/templates/users.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ stringData:
{{- end }}
---
{{- $jobName := print "user-add-" .name "-" $.Release.Name -}}
{{- if empty (lookup "batch/v1" "Job" $.Release.Namespace $jobName) -}}
{{- if empty (lookup "batch/v1" "Job" $.Release.Namespace $jobName) }}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down Expand Up @@ -71,6 +71,8 @@ spec:
- configMapRef:
name: {{ $.Chart.Name }}-configmap-{{ $.Release.Name }}
env:
- name: CONFIG
value: /oada.config.mjs
- name: ARANGODB_USERNAME
valueFrom:
secretKeyRef:
Expand All @@ -90,8 +92,21 @@ spec:
{{- end }}
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 }} "]
command:
- /usr/bin/dumb-init
- --rewrite
- 15:2
- --
- /bin/sh
args:
- -c
- >-
yarn workspace @oada/users run add
-u={{ .name }}
-a={{ .admin | default false }}
{{- range (.roles | default list) }}
-r={{ . }}
{{- end }}
resources:
limits: {{- toYaml $.Values.oada.resources.limits | nindent 14 }}
requests: {{- toYaml $.Values.oada.resources.limits | nindent 14 }}
Expand All @@ -101,6 +116,8 @@ spec:
- configMapRef:
name: {{ $.Chart.Name }}-configmap-{{ $.Release.Name }}
env:
- name: CONFIG
value: /oada.config.mjs
- name: TOKEN
valueFrom:
secretKeyRef:
Expand All @@ -126,7 +143,13 @@ spec:
image: oada/auth:{{ $tag }}
imagePullPolicy: {{ $.Values.oada.imagePullPolicy }}
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} "]
args:
- -c
- >-
yarn workspace @oada/auth run token create
-u={{ .name }}
-s=all:all
${TOKEN}
resources:
limits: {{- toYaml $.Values.oada.resources.limits | nindent 14 }}
requests: {{- toYaml $.Values.oada.resources.limits | nindent 14 }}
Expand Down
176 changes: 176 additions & 0 deletions charts/oada/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"$defs": {
"resources": {
"type": "object"
}
},
"properties": {
"replicaCount": {
"type": "integer",
"minimum": 1
},
"ingress": {
"type": "object",
"properties": {
"enabled": {
"default": true,
"type": "boolean"
},
"className": {
"type": ["string", "null"]
}
}
},
"oada": {
"type": "object",
"properties": {
"domains": {
"type": "array",
"items": {
"type": "string"
}
},
"tag": {
"type": ["string", "null"]
},
"imagePullPolicy": {
"type": "string",
"enum": ["Always", "IfNotPresent", "Never"]
},
"services": {
"type": "object",
"additionalProperties": {
"type": "object",
"properties": {
"http": {
"type": "boolean",
"default": false
},
"enabled": {
"type": "boolean",
"default": true
}
}
}
},
"users": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["name"],
"properties": {
"name": {
"type": "string"
},
"admin": {
"type": "boolean",
"default": false
},
"roles": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"oauth": {
"type": "object",
"properties": {
"issuer": {
"type": ["string", "null"]
}
}
},
"debug": {
"type": "array",
"items": {
"type": "string"
}
},
"pino": {
"type": "object",
"properties": {
"level": {
"type": "string",
"enum": ["trace", "debug", "info", "warn", "error", "fatal"]
}
}
},
"arangodb": {
"type": "object",
"properties": {
"database": {
"type": "string"
},
"connection": {
"type": ["string", "null"]
},
"image": {
"type": "string"
},
"tag": {
"type": "string"
},
"profileAql": {
"enum": [null, false, 0, true, 1, 2]
},
"resources": {
"$ref": "#/$defs/resources"
}
}
},
"kafka": {
"brokers": {
"type": "array",
"items": {
"type": "string"
}
},
"image": {
"type": "string"
},
"tag": {
"type": "string"
},
"chartVersion": {
"type": "string"
}
},
"k8sWaitFor": {
"image": {
"type": "string"
},
"tag": {
"type": "string"
},
"resources": {
"$ref": "#/$defs/resources"
}
},
"prometheus": {
"type": ["string", "null"]
},
"nameOverride": {
"type": ["string", "null"]
},
"fullnameOverride": {
"type": ["string", "null"]
},
"global": {
"type": "object",
"properties": {
"development": {
"type": "boolean",
"default": false
}
}
}
}
}
Loading

0 comments on commit ace11ed

Please sign in to comment.