...
 
Commits (1)
......@@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: nextcloud
version: 0.3.0
version: 0.1.0
.git/
# Common backup files
*.swp
*.bak
*.tmp
*~
values-production.yaml
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: mysql
version: 0.3.15
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mysql.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
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 "mysql.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 -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "mysql.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name for the database secret.
*/}}
{{- define "mysql.secretName" -}}
{{- if .Values.secret.deploy -}}
{{- include "mysql.fullname" . -}}
{{- else -}}
{{- .Release.Name -}}
{{- end -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mysql.stash.name" -}}
{{- default "stash" .Values.stash.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
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 "mysql.stash.fullname" -}}
{{- if .Values.stash.fullnameOverride -}}
{{- .Values.stash.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "stash" .Values.stash.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name .Chart.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{/*
Create secret name for stash
*/}}
{{- define "mysql.stash.secret.name" -}}
{{- if .Values.stash.secret.deploy -}}
{{ include "mysql.stash.fullname" . }}
{{- else }}
{{- .Values.global.stash.secret.name -}}
{{- end -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mysql.dump.name" -}}
{{- default "dump" .Values.stash.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mysql.dump.schedule" -}}
{{- $backupTime := splitList " " (coalesce .Values.stash.schedule .Values.global.stash.schedule) -}}
{{- $backupTimeMinute := atoi (first $backupTime) -}}
{{- $backupTimeHour := first (rest $backupTime) -}}
{{- $dumpTimeMinute := sub $backupTimeMinute 5 | toString | trim -}}
{{- $cronSchedule := list $dumpTimeMinute $backupTimeHour "*" "*" "*" -}}
{{- $cronSchedule | join " " -}}
{{- end -}}
{{- if .Values.configurationFiles }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "mysql.fullname" . }}-configuration
data:
{{- range $key, $val := .Values.configurationFiles }}
{{ $key }}: |-
{{ $val | indent 4}}
{{- end }}
{{- end -}}
\ No newline at end of file
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "mysql.fullname" . }}
labels:
app: {{ template "mysql.name" . }}
chart: {{ template "mysql.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount | default "1" }}
selector:
matchLabels:
app: {{ template "mysql.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "mysql.name" . }}
release: {{ .Release.Name }}
spec:
initContainers:
- name: "remove-lost-found"
image: "busybox:1.25.0"
imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
command: ["rm", "-fr", "/var/lib/mysql/lost+found"]
volumeMounts:
- name: data
mountPath: /var/lib/mysql
{{- if .Values.persistence.subPath }}
subPath: {{ .Values.persistence.subPath }}
{{- end }}
{{- if .Values.extraInitContainers }}
{{ tpl .Values.extraInitContainers . | indent 6 }}
{{- end }}
containers:
- name: {{ template "mysql.name" . }}
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.imagePullPolicy | quote }}
resources:
{{ toYaml .Values.resources | indent 10 }}
env:
{{- if .Values.mysqlAllowEmptyPassword }}
- name: MYSQL_ALLOW_EMPTY_PASSWORD
value: "true"
{{- else }}
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mysql.secretName" . }}
key: mysql-root-password
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mysql.secretName" . }}
key: mysql-password
{{- end }}
- name: MYSQL_USER
value: {{ coalesce .Values.mysqlUser .Values.global.mysql.mysqlUser | quote }}
- name: MYSQL_DATABASE
value: {{ coalesce .Values.mysqlDatabase .Values.global.mysql.mysqlDatabase | quote }}
{{- if .Values.timezone }}
- name: TZ
value: {{ .Values.timezone }}
{{- end }}
ports:
- name: mysql
containerPort: 3306
volumeMounts:
- name: data
mountPath: /var/lib/mysql
subpath: data
{{- if .Values.configurationFiles }}
- name: configurations
mountPath: /etc/mysql/conf.d
{{- end }}
{{- if .Values.initializationFiles }}
- name: migrations
mountPath: /docker-entrypoint-initdb.d
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{ tpl .Values.extraVolumeMounts . | indent 8 }}
{{- end }}
livenessProbe:
exec:
command:
{{- if .Values.mysqlAllowEmptyPassword }}
- mysqladmin
- ping
{{- else }}
- sh
- -c
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
{{- end }}
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
readinessProbe:
exec:
command:
{{- if .Values.mysqlAllowEmptyPassword }}
- mysqladmin
- ping
{{- else }}
- sh
- -c
- "mysqladmin ping -u root -p${MYSQL_ROOT_PASSWORD}"
{{- end }}
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
- name: {{ template "mysql.dump.name" . }}
image: "{{ .Values.dump.image.repository }}:{{ .Values.dump.image.tag }}"
imagePullPolicy: {{ .Values.dump.image.pullPolicy }}
env:
- name: DB_HOST
value: {{ template "mysql.fullname" . }}
- name: DB_PORT
value: {{ .Values.service.port | quote }}
- name: DB_DATABASE
value: {{ coalesce .Values.global.mysql.mysqlDatabase .Values.mysqlDatabase | quote }}
- name: DB_USER
value: {{ coalesce .Values.global.mysql.mysqlUser .Values.mysqlUser | quote }}
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "mysql.secretName" . }}
key: mysql-password
- name: CRON_TIME
value: {{ include "mysql.dump.schedule" . | quote }}
- name: MAX_BACKUPS
value: {{ .Values.dump.maxBackups | quote }}
volumeMounts:
- name: data
mountPath: /backup
subPath: backup
volumes:
{{- if .Values.configurationFiles }}
- name: configurations
configMap:
name: {{ template "mysql.fullname" . }}-configuration
{{- end }}
{{- if .Values.initializationFiles }}
- name: migrations
configMap:
name: {{ template "mysql.fullname" . }}-initialization
{{- end }}
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "mysql.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- if .Values.extraVolumes }}
{{ tpl .Values.extraVolumes . | indent 8 }}
{{- end }}
{{- if .Values.initializationFiles }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "mysql.fullname" . }}-initialization
data:
{{- range $key, $val := .Values.initializationFiles }}
{{ $key }}: |-
{{ $val | indent 4}}
{{- end }}
{{- end -}}
\ No newline at end of file
{{- if and .Values.persistence.enabled (not .Values.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "mysql.fullname" . }}
labels:
app: {{ template "mysql.name" . }}
chart: {{ template "mysql.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessModes | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
apiVersion: stash.appscode.com/v1alpha1
kind: Restic
metadata:
name: {{ template "mysql.stash.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "mysql.stash.name" . }}
chart: {{ template "mysql.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: mysql
release: {{ .Release.Name }}
fileGroups:
- path: /backup
retentionPolicyName: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
backend:
s3:
endpoint: {{ coalesce .Values.stash.endpoint .Values.global.stash.endpoint | quote }}
bucket: {{ coalesce .Values.stash.bucket .Values.global.stash.bucket | default .Release.Name | quote }}
prefix: db
storageSecretName: {{ template "mysql.stash.secret.name" . }}
schedule: {{ coalesce .Values.stash.schedule .Values.global.stash.schedule | quote }}
volumeMounts:
- mountPath: /backup
name: data
subpath: /backup
retentionPolicies:
- name: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
keepLast: {{ coalesce .Values.stash.retention.keepLast .Values.global.stash.retention.keepLast }}
prune: {{ coalesce .Values.stash.retention.prune .Values.global.stash.retention.prune }}
{{- if .Values.secret.deploy }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "mysql.fullname" . }}
labels:
app: {{ template "mysql.name" . }}
chart: {{ template "mysql.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
{{- if or .Values.mysqlRootPassword .Values.global.mysql.mysqlRootPassword }}
mysql-root-password: {{ coalesce .Values.mysqlRootPassword .Values.global.mysql.mysqlRootPassword | b64enc | quote }}
{{- else }}
mysql-root-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- if or .Values.mysqlPassword .Values.global.mysql.mysqlPassword }}
mysql-password: {{ coalesce .Values.mysqlPassword .Values.global.mysql.mysqlPassword | b64enc | quote }}
{{- else }}
mysql-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- end }}
\ No newline at end of file
{{- if .Values.stash.secret.deploy }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "mysql.stash.fullname" . }}
labels:
app: {{ template "mysql.stash.name" . }}
chart: {{ template "mysql.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
awsAcessKeyID: {{ .Values.stash.awsAccessKeyID | b64enc | quote }}
awsSecretAcessKey: {{ .Values.stash.awsSecretAccessKey | b64enc | quote }}
{{- if .Values.stash.resticPassword }}
resticPassword: {{ .Values.stash.resticPassword | b64enc | quote }}
{{- else }}
resticPassword: {{ randAlphaNum 16 | b64enc | quote }}
{{- end }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "mysql.fullname" . }}
labels:
app: {{ template "mysql.name" . }}
chart: {{ template "mysql.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- name: mysql
port: {{ .Values.service.port }}
targetPort: mysql
{{- if .Values.service.nodePort }}
nodePort: {{ .Values.service.nodePort }}
{{- end }}
selector:
app: {{ template "mysql.name" . }}
release: {{ .Release.Name }}
replicaCount: 1
image: "mysql"
imageTag: "5.7.14"
imagePullPolicy: IfNotPresent
# imagePullSecrets:
# - name: myRegistryKeySecretName
livenessProbe:
initialDelaySeconds: 120
periodSeconds: 20
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 6
readinessProbe:
initialDelaySeconds: 30
periodSeconds: 15
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 3
extraVolumes: |
extraVolumeMounts: |
extraInitContainers: |
nodeSelector: {}
global:
mysql:
## Default: random 10 character string
# mysqlRootPassword: testing
mysqlUser: mysql_user
## Default: random 10 character string
# mysqlPassword:
# mysqlAllowEmptyPassword: true
mysqlDatabase: mysql_database
stash:
## s3/minio bucket name, default to release name
# bucket:
endpoint:
schedule: "30 1 * * *"
retention:
name: keep-last-5
keepLast: 5
prune: true
secret:
deploy: false
name: stash-secret
secret:
deploy: true
# name:
persistence:
# existinClaim:
enabled: true
storageClass: rbd
accessModes: ReadWriteOnce
size: 8Gi
annotations: {}
resources: {}
configurationFiles: {}
initializationFiles: {}
service:
type: ClusterIP
port: 3306
# nodePort: 32000
podAnnotations: {}
dump:
image:
repository: unteem/mysql-companion
tag: 0.1.2
pullPolicy: IfNotPresent
maxBackups: 1
cronTime: "20 1 * * *"
stash:
# s3/minio bucket name, default to release name
# bucket:
endpoint:
schedule: "30 1 * * *"
retention:
name: keep-last-5
keepLast: 5
prune: true
secret:
deploy: false
existingSecret: stash-secret
# awsSecretAccessKey: secret
# awsAccessKeyID: secret
# resticPassword: secret
# 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
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: redis
version: 0.1.2
......@@ -4,16 +4,16 @@
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "nextcloud.fullname" . }})
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "redis.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "nextcloud.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "nextcloud.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
You can watch the status of by running 'kubectl get svc -w {{ template "redis.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "redis.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "nextcloud.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "redis.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "redis.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
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 "redis.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 -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "redis.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "redis.fullname" . }}
labels:
app: {{ template "redis.name" . }}
chart: {{ template "redis.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "redis.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "redis.name" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["--appendonly", "yes"]
volumeMounts:
- name: data
mountPath: /data
subPath: assets
ports:
- name: http
containerPort: 6379
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "redis.fullname" .) }}
{{- else }}
emptyDir: {}
{{- end -}}
\ No newline at end of file
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "redis.fullname" . }}
labels:
app: {{ template "redis.name" . }}
chart: {{ template "redis.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{- if .Values.persistence.storageClass }}
{{- if (eq "-" .Values.persistence.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.persistence.storageClass }}"
{{- end }}
{{- end }}
{{- end }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "redis.fullname" . }}
labels:
app: {{ template "redis.name" . }}
chart: {{ template "redis.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
app: {{ template "redis.name" . }}
release: {{ .Release.Name }}
# Default values for redis.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: redis
tag: 3-alpine
pullPolicy: IfNotPresent
service:
type: ClusterIP
port: 6379
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
path: /
hosts:
- chart-example.local
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
persistence:
enabled: true
accessMode: ReadWriteOnce
size: 8Gi
# storageClass:
# existingClaim: existing-pvc
\ No newline at end of file
dependencies:
- name: mysql
repository: https://chartmuseum.indie.host
version: 0.3.15
- name: redis
repository: https://chartmuseum.indie.host
version: 0.1.2
digest: sha256:7cfe8a911b5505082c4835b89ec9e8bdf33baa1700ce2be5e402d88c42f0e150
generated: 2018-10-05T03:09:35.342417806+02:00
dependencies:
- name: mysql
version: 0.1.0
repository: https://chartmuseum.indie.host
condition: mysql.deploy
- name: redis
version: 0.1.0
repository: https://chartmuseum.indie.host
condition: redis.deploy
\ No newline at end of file
......@@ -30,3 +30,66 @@ Create chart name and version as used by the chart label.
{{- define "nextcloud.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name for the password secret key.
*/}}
{{- define "nextcloud.ingress.tls" -}}
{{- if .Values.ingress.tls -}}
{{- .Values.ingress.tls -}}
{{- else -}}
{{ .Release.Name }}-tls
{{- end -}}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "stash.name" -}}
{{- default "stash" .Values.stash.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
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 "stash.fullname" -}}
{{- if .Values.stash.fullnameOverride -}}
{{- .Values.stash.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "stash" .Values.stash.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name .Chart.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{/*
Create secret name for stash
*/}}
{{- define "stash.secret.name" -}}
{{- if .Values.stash.secret.deploy -}}
{{ include "stash.fullname" . }}
{{- else }}
{{- .Values.global.stash.secret.name -}}
{{- end -}}
{{- end -}}
{{/*
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 "mysql.fullname" -}}
{{- printf "%s-%s" .Release.Name "mysql" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
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 "redis.fullname" -}}
{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- if .Values.redis.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nextcloud.fullname" . }}-redis
labels:
app: {{ template "nextcloud.name" . }}
chart: {{ template "nextcloud.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
redis.config.php: |
<?php
$CONFIG = array (
'memcache.locking' => '\OC\Memcache\Redis',
'redis' => array(
'host' => {{ template "nextcloud.fullname" . }}-redis,
'port' => 6379,
),
);
{{- end }}
\ No newline at end of file
......@@ -9,8 +9,6 @@ metadata:
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
app: {{ template "nextcloud.name" . }}
......@@ -21,47 +19,54 @@ spec:
app: {{ template "nextcloud.name" . }}
release: {{ .Release.Name }}
spec:
containers:
initContainers:
- name: wait-for-mysql
image: "{{ .Values.init.image.repository }}:{{ .Values.init.image.tag }}"
imagePullPolicy: {{ .Values.init.image.pullPolicy }}
command:
- sh
- -c
- |
until printf "." && nc -z -w 2 {{ .Release.Name }}-mysql {{ .Values.mysql.service.port }}; do
sleep 2;
done;
echo 'mysql OK ✓'
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
{{- if .Values.adminUsername }}
{{- if .Release.IsInstall }}
- name: NEXTCLOUD_ADMIN_USER
value: {{ .Values.adminUsername }}
- name: NEXTCLOUD_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: adminPassword
name: {{ .Release.Name }}
key: admin-password
{{- end }}
{{- with .Values.tablePrefix }}
- name: NEXTCLOUD_TABLE_PREFIX
value: {{ . }}
{{- end }}
{{- with .Values.dataDir }}
- name: NEXTCLOUD_DATA_DIR
value: {{ . }}
{{- end }}
{{- if (eq "SQLITE" .Values.externalDatabase.type) }}
- name: SQLITE_DATABASE
value: {{ .Values.externalDatabase.database }}
{{- else if (eq "MYSQL" .Values.externalDatabase.type) }}
- name: MYSQL_DATABASE
value: {{ .Values.externalDatabase.database }}
value: {{ .Values.global.mysql.mysqlDatabase }}
- name: MYSQL_USER
value: {{ .Values.externalDatabase.username }}
value: {{ .Values.global.mysql.mysqlUser }}
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: externalDatabasePassword
name: {{ .Release.Name }}
key: mysql-password
- name: MYSQL_HOST
value: {{ .Values.externalDatabase.host }}
{{- else if (eq "POSTGRES" .Values.externalDatabase.type) }}
- name: POSTGRES_DB
value: {{ .Values.externalDatabase.database }}
- name: POSTGRES_USER
value: {{ .Values.externalDatabase.username }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "nextcloud.fullname" . }}
key: externalDatabasePassword
- name: POSTGRES_HOST
value: {{ .Values.externalDatabase.host }}
value: {{ template "mysql.fullname" . }}
{{- if .Values.redis.enabled }}
- name: REDIS_HOST
value: {{ template "redis.fullname" . }}
{{- end }}
volumeMounts:
- name: data
......@@ -73,30 +78,16 @@ spec:
- name: data
mountPath: /var/www/html/data
subPath: data
{{- range .Values.persistence.extraExistingClaimMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /status.php
port: http
httpHeaders:
- name: Host
value: localhost
initialDelaySeconds: 120
timeoutSeconds: 5
failureThreshold: 6
readinessProbe:
httpGet:
path: /status.php
port: http
httpHeaders:
- name: Host
value: localhost
initialDelaySeconds: 30
timeoutSeconds: 3
periodSeconds: 5
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
......@@ -113,9 +104,14 @@ spec:
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "nextcloud.fullname" .) }}
{{- else }}
{{- else }}
emptyDir: {}
{{- end -}}
{{- end -}}
{{- range .Values.persistence.extraExistingClaimMounts }}
- name: {{ .name }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- end }}
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "nextcloud.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
name: {{ template "nextcloud.fullname" . }}
labels:
app: {{ template "nextcloud.name" . }}
chart: {{ template "nextcloud.chart" . }}
......@@ -15,24 +12,15 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
- hosts:
- {{ .Values.ingress.host }}
secretName: {{ template "nextcloud.ingress.tls" . }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
- host: {{ .Values.ingress.host }}
http:
paths:
- path: {{ $ingressPath }}
- path: {{ .Values.ingress.path }}
backend:
serviceName: {{ $fullName }}
serviceName: {{ template "nextcloud.fullname" . }}
servicePort: http
{{- end }}
{{- end }}
......@@ -8,9 +8,13 @@ metadata:
chart: {{ template "nextcloud.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.persistence.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
- {{ .Values.persistence.accessModes | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
......
apiVersion: stash.appscode.com/v1alpha1
kind: Restic
metadata:
name: {{ template "nextcloud.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "stash.name" . }}
chart: {{ template "nextcloud.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: nextcloud
release: {{ .Release.Name }}
fileGroups:
- path: /var/www/html/data
retentionPolicyName: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
tags:
- data
- path: /var/www/html/custom_apps
retentionPolicyName: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
tags:
- custom-apps
- path: /var/www/html/apps
retentionPolicyName: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
tags:
- apps
- path: /var/www/html/config
retentionPolicyName: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
tags:
- config
backend:
s3:
endpoint: {{ coalesce .Values.stash.endpoint .Values.global.stash.endpoint | quote }}
bucket: {{ coalesce .Values.stash.bucket .Values.global.stash.bucket | default .Release.Name | quote }}
prefix: app
storageSecretName: {{ include "stash.secret.name" . }}
schedule: {{ coalesce .Values.stash.schedule .Values.global.stash.schedule | quote }}
volumeMounts:
- mountPath: /var/www/html/data
name: data
subpath: data
- mountPath: /var/www/html/apps
name: data
subpath: apps
- mountPath: /var/www/html/custom_apps
name: data
subpath: custom-apps
- mountPath: /var/www/html/config
name: data
subpath: config
retentionPolicies:
- name: {{ coalesce .Values.stash.retention.name .Values.global.stash.retention.name | quote }}
keepLast: {{ coalesce .Values.stash.retention.keepLast .Values.global.stash.retention.keepLast }}
prune: {{ coalesce .Values.stash.retention.prune .Values.global.stash.retention.prune }}
{{- if .Values.stash.secret.deploy }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "stash.fullname" . }}
labels:
app: {{ template "stash.name" . }}
chart: {{ template "stash.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
type: Opaque
data:
awsAcessKeyID: {{ .Values.stash.awsAccessKeyID | b64enc | quote }}
awsSecretAcessKey: {{ .Values.stash.awsSecretAccessKey | b64enc | quote }}
{{- if .Values.stash.resticPassword }}
resticPassword: {{ .Values.stash.resticPassword | b64enc | quote }}
{{- else }}
resticPassword: {{ randAlphaNum 16 | b64enc | quote }}
{{- end }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "nextcloud.fullname" . }}
name: {{ .Release.Name }}
labels:
app: {{ template "nextcloud.name" . }}
chart: {{ template "nextcloud.chart" . }}
......@@ -10,10 +10,18 @@ metadata:
type: Opaque
data:
{{- if .Values.adminPassword }}
adminPassword: {{ .Values.adminPassword | b64enc | quote }}
admin-password: {{ .Values.adminPassword | b64enc | quote }}
{{- else }}
adminPassword: {{ randAlphaNum 16 | b64enc | quote }}
admin-password: {{ randAlphaNum 16 | b64enc | quote }}
{{- end }}
{{- if .Values.externalDatabase.password }}
externalDatabasePassword: {{ .Values.externalDatabase.password | b64enc | quote }}
{{- if .Values.global.mysql.mysqlPassword }}
mysql-password: {{ .Values.global.mysql.mysqlPassword | b64enc | quote }}
{{- else }}
mysql-password: {{ randAlphaNum 16 | b64enc | quote }}
{{- end }}
{{- if .Values.global.mysql.mysqlRootPassword }}
mysql-root-password: {{ .Values.global.mysql.mysqlRootPassword | b64enc | quote }}
{{- else }}
mysql-root-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
smtp-password: {{ .Values.smtpPassword | b64enc | quote }}
File mode changed from 100644 to 100755
# Default values for nextcloud.
replicaCount: 1
adminUsername: admin
# Default to random password
adminPassword: ""
externalDatabase:
# SQLITE, MYSQL or POSTGRES
type: SQLITE
host: ""
database: nextcloud
username: nextcloud
password: nextcloud
image:
repository: nextcloud
tag: "13.0.4"
tag: "14.0.1-apache"
pullPolicy: IfNotPresent
init:
image:
repository: alpine
tag: 3.8
pullPolicy: IfNotPresent
global:
mysql:
mysqlRootPassword: password
mysqlUser: nextcloud
mysqlPassword: password
mysqlDatabase: nextcloud
stash:
endpoint:
schedule: "30 1 * * *"
retention:
name: keep-last-5
keepLast: 5
prune: true
secret:
deploy: false
name: stash-secret
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
annotations:
kubernetes.io/tls-acme: "true"
path: /
hosts:
- nextcloud.example.com
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
host: nextcloud.example.com
## default to releaseName-tls
# tls: nextcloud-example-com-tls
persistence:
annotations: {}
enabled: true
accessMode: ReadWriteOnce
accessModes: ReadWriteOnce
size: 8Gi
storageClass: rbd
# existingClaim: existing-pvc
# tablePrefix:
# dataDir:
adminUsername: admin
## Default to random password
adminPassword: ""
mysql:
deploy: true
secret:
deploy: false
dump:
maxBackups: 1
cronTime: "20 1 * * *"
stash:
# s3/minio bucket name, default to release name
# bucket:
endpoint:
schedule: "30 1 * * *"
retention:
name:
keepLast:
prune:
secret:
deploy: false
# awsSecretAccessKey: secret
# awsAccessKeyID: secret
# resticPassword: secret
redis:
enabled: false
deploy: false
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
......