Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optimize chart dependency #53

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions charts/camunda-bpm-platform/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ keywords:
- dmn
- process-engine
- workflow
dependencies:
# Camunda Platform charts.
- name: optimize
# repository: "https://helm.camunda.io"
version: 8.1.0
condition: "optimize.enabled"
# Dependency charts.
- name: elasticsearch
repository: "https://helm.elastic.co"
version: 7.17.1
condition: "elasticsearch.enabled"
- name: keycloak
repository: "https://charts.bitnami.com/bitnami"
version: 7.1.6
condition: "keycloak.enabled"
icon: https://docs.camunda.org/get-started/img/Camunda-Circle.svg
home: https://camunda.com
sources:
Expand Down
22 changes: 22 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
9 changes: 9 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
description: Optimize Helm Chart for Kubernetes
name: optimize
version: 8.1.0
icon: https://helm.camunda.io/imgs/camunda.svg
annotations:
artifacthub.io/changes: |
- create optimize sub chart
artifacthub.io/containsSecurityUpdates: "true"
4 changes: 4 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Optimize Helm Chart

Contains the Optimize subchart, which is part of the Camunda Platform Helm chart.
For more details please take a look at [Configuration#Optimize](../../README.md#optimize).
54 changes: 54 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "optimize.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Defines extra labels for optimize.
*/}}
{{- define "optimize.extraLabels" -}}
app.kubernetes.io/component: optimize
{{- end -}}

{{/*
Define common labels for Optimize, combining the match labels and transient labels, which might change on updating
(version depending). These labels shouldn't be used on matchLabels selector, since the selectors are immutable.
*/}}
{{- define "optimize.labels" -}}
{{- template "camunda-bpm-platform.labels" . }}
{{ template "optimize.extraLabels" . }}
{{- end -}}

{{/*
Defines match labels for tasklist, which are extended by sub-charts and should be used in matchLabels selectors.
*/}}
{{- define "optimize.matchLabels" -}}
{{- template "camunda-bpm-platform.matchLabels" . }}
{{ template "optimize.extraLabels" . }}
{{- end -}}

{{/*
[optimize] Create the name of the service account to use
*/}}
{{- define "optimize.serviceAccountName" -}}
{{- if .Values.serviceAccount.enabled }}
{{- default (include "optimize.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
129 changes: 129 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "optimize.fullname" . }}
labels: {{- include "optimize.labels" . | nindent 4 }}
annotations: {{- toYaml .Values.global.annotations | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "optimize.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "optimize.labels" . | nindent 8 }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels | nindent 8 }}
{{- end }}
{{- if .Values.podAnnotations }}
annotations:
{{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }}
spec:
imagePullSecrets:
{{- include "camunda-bpm-platform.imagePullSecrets" . | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
{{- if .Values.image.tag }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.global.image.tag }}"
{{- end }}
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
{{- if .Values.containerSecurityContext }}
securityContext: {{- toYaml .Values.containerSecurityContext | nindent 10 }}
{{- end }}
env:
{{- if .Values.contextPath }}
- name: CAMUNDA_OPTIMIZE_CONTEXT_PATH
value: {{ .Values.contextPath | quote }}
{{- end }}
- name: CAMUNDA_OPTIMIZE_ZEEBE_ENABLED
value: {{ .Values.zeebeEnabled | quote }}
- name: CAMUNDA_OPTIMIZE_ZEEBE_PARTITION_COUNT
value: {{ .Values.partitionCount | quote }}
- name: OPTIMIZE_CAMUNDABPM_REST_URL
value: {{ .Values.camundaRestURL | quote }}
- name: OPTIMIZE_ELASTICSEARCH_HOST
value: {{ .Values.global.elasticsearch.host | quote }}
- name: OPTIMIZE_ELASTICSEARCH_HTTP_PORT
value: {{ .Values.global.elasticsearch.port | quote }}
{{- if .Values.global.identity.auth.enabled }}
- name: SPRING_PROFILES_ACTIVE
value: "ccsm"
- name: CAMUNDA_OPTIMIZE_IDENTITY_ISSUER_URL
value: {{ .Values.global.identity.auth.publicIssuerUrl | quote }}
- name: CAMUNDA_OPTIMIZE_IDENTITY_ISSUER_BACKEND_URL
value: {{ include "camundaPlatform.issuerBackendUrl" . | quote }}
- name: CAMUNDA_OPTIMIZE_IDENTITY_CLIENTID
value: "optimize"
- name: CAMUNDA_OPTIMIZE_IDENTITY_CLIENTSECRET
{{- if and .Values.global.identity.auth.optimize.existingSecret (not (typeIs "string" .Values.global.identity.auth.optimize.existingSecret)) }}
valueFrom:
secretKeyRef:
{{- /*
Helper: https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_secrets.tpl
Usage in keycloak secrets https://github.com/bitnami/charts/blob/master/bitnami/keycloak/templates/secrets.yaml
and in statefulset https://github.com/bitnami/charts/blob/master/bitnami/keycloak/templates/statefulset.yaml
*/}}
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.global.identity.auth.optimize.existingSecret "context" $) }}
key: optimize-secret
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "identity.secretNameOptimizeIdentity" . }}
key: optimize-secret
{{- end }}
- name: CAMUNDA_OPTIMIZE_IDENTITY_AUDIENCE
value: "optimize-api"
- name: CAMUNDA_OPTIMIZE_API_AUDIENCE
value: "optimize-api"
- name: CAMUNDA_OPTIMIZE_API_JWTSETURI
value: {{ printf "%s%s" (include "camundaPlatform.issuerBackendUrl" .) "/protocol/openid-connect/certs" | quote }}
{{- end }}
- name: CAMUNDA_OPTIMIZE_SECURITY_AUTH_COOKIE_SAME_SITE_ENABLED
value: "false"
- name: CAMUNDA_OPTIMIZE_UI_LOGOUT_HIDDEN
value: "true"
{{- if .Values.env}}
{{ .Values.env | toYaml | nindent 10 }}
{{- end }}
{{- if .Values.command}}
command: {{ .Values.command }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 10 }}
ports:
- containerPort: 8090
name: http
protocol: TCP
- containerPort: 8092
name: management
protocol: TCP
volumeMounts:
{{- if .Values.extraVolumeMounts}}
{{- .Values.extraVolumeMounts | toYaml | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.extraVolumes}}
{{- .Values.extraVolumes | toYaml | nindent 6 }}
{{- end }}
{{- if .Values.serviceAccount.name}}
serviceAccountName: {{ .Values.serviceAccount.name }}
{{- end }}
{{- if .Values.podSecurityContext }}
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
31 changes: 31 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "optimize.fullname" . }}
labels: {{ include "optimize.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations: {{ toYaml . | nindent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: {{ .Values.ingress.path }}
pathType: Prefix
backend:
service:
name: {{ include "optimize.fullname" . }}
port:
number: 80
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.ingress.host }}
{{- if .Values.ingress.tls.secretName }}
secretName: {{ .Values.ingress.tls.secretName }}
{{- end }}
{{- end }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/camunda-bpm-platform/charts/optimize/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "optimize.fullname" . }}
labels: {{- include "optimize.labels" . | nindent 4 }}
annotations:
{{- if .Values.global.annotations}}
{{- toYaml .Values.global.annotations | nindent 4 }}
{{- end }}
{{- if .Values.service.annotations}}
{{- toYaml .Values.service.annotations | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
name: http
targetPort: 8090
protocol: TCP
- port: {{ .Values.service.managementPort }}
name: management
targetPort: 8092
protocol: TCP
selector:
{{- include "optimize.matchLabels" . | nindent 4 }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if .Values.serviceAccount.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "optimize.serviceAccountName" . }}
labels: {{- include "optimize.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "optimize.fullname" . }}-test-connection"
labels:
{{ include "optimize.labels" . | indent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "optimize.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
Loading