diff --git a/helm/wekan/Chart.yaml b/helm/wekan/Chart.yaml index ffd164bfb..69963f17b 100644 --- a/helm/wekan/Chart.yaml +++ b/helm/wekan/Chart.yaml @@ -1,7 +1,6 @@ name: wekan -version: 1.0.0 -appVersion: 2.x.x -kubeVersion: "^1.8.0-0" +version: 1.0.1 +apiVersion: v1 description: Open Source kanban home: https://wekan.github.io/ icon: https://wekan.github.io/wekan-logo.svg @@ -10,4 +9,6 @@ sources: maintainers: - name: technotaff email: github@randall.cc + - name: jiangytcn + email: jiangyt.cn@gmail.com engine: gotpl diff --git a/helm/wekan/requirements.yaml b/helm/wekan/requirements.yaml index d19fc638f..d6b6b2e76 100644 --- a/helm/wekan/requirements.yaml +++ b/helm/wekan/requirements.yaml @@ -1,5 +1,5 @@ dependencies: -- name: mongodb-replicaset - version: 3.11.x - repository: "https://kubernetes-charts.storage.googleapis.com/" - condition: mongodb-replicaset.enabled +- name: mongodb + version: 10.0.x + repository: "https://charts.bitnami.com/bitnami" + condition: mongodb.enabled diff --git a/helm/wekan/templates/_helpers.tpl b/helm/wekan/templates/_helpers.tpl index 7f333301e..fab37c9d9 100644 --- a/helm/wekan/templates/_helpers.tpl +++ b/helm/wekan/templates/_helpers.tpl @@ -62,21 +62,27 @@ Create the name of the service account to use for the api component Create a default fully qualified mongodb-replicaset name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "wekan.mongodb-replicaset.fullname" -}} -{{- $name := default "mongodb-replicaset" (index .Values "mongodb-replicaset" "nameOverride") -}} +{{- define "wekan.mongodb.svcname" -}} +{{- $name := default "mongodb" (index .Values "mongodb" "nameOverride") -}} +{{- if eq .Values.mongodb.architecture "replicaset" }} +{{- printf "%s-%s-headless" .Release.Name $name | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} {{/* Create the MongoDB URL. If MongoDB is installed as part of this chart, use k8s service discovery, else use user-provided URL. */}} -{{- define "mongodb-replicaset.url" -}} -{{- if (index .Values "mongodb-replicaset" "enabled") -}} -{{- $count := (int (index .Values "mongodb-replicaset" "replicas")) -}} +{{- define "mongodb.url" -}} +{{- if (index .Values "mongodb" "enabled") -}} +{{- $count := (int (index .Values "mongodb" "replicaCount")) -}} {{- $release := .Release.Name -}} -mongodb://{{ $release }}-mongodb-replicaset:27017/admin?replicaSet={{ index .Values "mongodb-replicaset" "replicaSetName" }} +{{- $replicaSetName := (index .Values "mongodb" "replicaSetName") -}} +{{- $mongodbSvcName := include "wekan.mongodb.svcname" . -}} +mongodb://{{- range $v := until $count }}{{ $release }}-mongodb-{{ $v }}.{{ $mongodbSvcName }}:27017{{ if ne $v (sub $count 1) }},{{- end -}}{{- end -}}?replicaSet={{ $replicaSetName }} {{- else -}} -{{- index .Values "mongodb-replicaset" "url" -}} +{{- index .Values "mongodb" "url" -}} {{- end -}} {{- end -}} diff --git a/helm/wekan/templates/deployment.yaml b/helm/wekan/templates/deployment.yaml index 68dbf75c8..75c02a2db 100644 --- a/helm/wekan/templates/deployment.yaml +++ b/helm/wekan/templates/deployment.yaml @@ -36,7 +36,7 @@ spec: - name: ROOT_URL value: {{ .Values.root_url | default "https://wekan.local" | quote }} - name: MONGO_URL - value: "{{ template "mongodb-replicaset.url" . }}" + value: "{{ template "mongodb.url" . }}" {{- range $key := .Values.env }} {{- if .value }} - name: {{ .name }} diff --git a/helm/wekan/templates/ingress.yaml b/helm/wekan/templates/ingress.yaml index dd85ef550..6904cdfa7 100644 --- a/helm/wekan/templates/ingress.yaml +++ b/helm/wekan/templates/ingress.yaml @@ -2,7 +2,7 @@ {{- $fullName := include "wekan.fullname" . -}} {{- $servicePort := .Values.service.port -}} {{- $ingressPath := .Values.ingress.path -}} -apiVersion: extensions/v1beta1 +apiVersion: networking.k8s.io/v1beta1 kind: Ingress metadata: name: {{ $fullName }} @@ -27,6 +27,9 @@ spec: secretName: {{ .secretName }} {{- end }} {{- end }} + backend: + serviceName: {{ $fullName }} + servicePort: 8080 rules: {{- range .Values.ingress.hosts }} - host: {{ . }} @@ -35,6 +38,6 @@ spec: - path: {{ $ingressPath }} backend: serviceName: {{ $fullName }} - servicePort: 80 + servicePort: 8080 {{- end }} {{- end }} diff --git a/helm/wekan/templates/secrets.yaml b/helm/wekan/templates/secrets.yaml deleted file mode 100644 index 79ae3d489..000000000 --- a/helm/wekan/templates/secrets.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "wekan.fullname" . }} - labels: - app: {{ template "wekan.name" . }} - chart: {{ template "wekan.chart" . }} - component: wekan - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} -type: Opaque -data: - accessKey: {{ .Values.credentials.accessKey | b64enc }} - secretKey: {{ .Values.credentials.secretKey | b64enc }} diff --git a/helm/wekan/templates/tests/test-cloudserver.yaml b/helm/wekan/templates/tests/test-cloudserver.yaml deleted file mode 100644 index a1db72890..000000000 --- a/helm/wekan/templates/tests/test-cloudserver.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: {{ template "wekan.fullname" . }}-test - annotations: - "helm.sh/hook": test-success -spec: - containers: - - name: {{ template "wekan.fullname" . }}-test - imagePullPolicy: IfNotPresent - image: "docker.io/mesosphere/aws-cli:1.14.5" - command: - - sh - - -c - - aws s3 --endpoint-url=http://{{ include "wekan.fullname" . }} --region=us-east-1 ls - env: - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: {{ template "wekan.fullname" . }} - key: accessKey - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: {{ template "wekan.fullname" . }} - key: secretKey - restartPolicy: Never diff --git a/helm/wekan/values.yaml b/helm/wekan/values.yaml index 78136af3a..91a06b2ae 100644 --- a/helm/wekan/values.yaml +++ b/helm/wekan/values.yaml @@ -22,12 +22,6 @@ image: replicaCount: 1 -## Specify wekan credentials -## -credentials: - accessKey: access-key - secretKey: secret-key - ## Specify additional environmental variables for the Deployment ## env: @@ -36,7 +30,7 @@ env: service: type: NodePort - port: 80 + port: 8080 annotations: {} # prometheus.io/scrape: "true" # prometheus.io/port: "8000" @@ -104,13 +98,10 @@ autoscaling: # MongoDB: # ------------------------------------------------------------------------------ -mongodb-replicaset: +mongodb: enabled: true - replicas: 3 + architecture: replicaset + replicaCount: 3 replicaSetName: rs0 - securityContext: - runAsUser: 1000 - fsGroup: 1000 - runAsNonRoot: true - #image: - # tag: 3.2.21 + auth: + enabled: false