Merge pull request #3369 from jiangytcn/helm

fix: update helm mongodb dependency
This commit is contained in:
Lauri Ojansivu 2020-11-27 21:17:44 +02:00 committed by GitHub
commit d957768a39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 33 additions and 73 deletions

View file

@ -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

View file

@ -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

View file

@ -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 -}}

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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 }}

View file

@ -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

View file

@ -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