Commit 62ec32e6 authored by Tim's avatar Tim

Initial commit

parents
Pipeline #106 failed with stages
# 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/
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: discourse
version: 0.2.12
dependencies:
- name: postgresql
repository: https://chartmuseum.indie.host
version: 0.6.2
- name: redis
repository: https://chartmuseum.indie.host
version: 1.0.2
digest: sha256:e25d47cb774340fcb0198720447ad6d2bf530a07c36e870a2d891617438fd990
generated: 2019-04-16T17:48:15.503864008+02:00
dependencies:
- name: postgresql
version: 0.6.2
repository: https://chartmuseum.indie.host
- name: redis
version: 1.0.2
repository: https://chartmuseum.indie.host
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range $.Values.ingress.paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "discourse.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 {{ include "discourse.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "discourse.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.kubernetes.io/name={{ include "discourse.name" . }},app.kubernetes.io/instance={{ .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: */}}
{{- define "discourse.standardLabels" -}}
app.kubernetes.io/name: {{ include "discourse.name" . }}
helm.sh/chart: {{ include "discourse.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Expand the name of the chart.
*/}}
{{- define "discourse.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 "discourse.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 "discourse.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name for the password secret key.
*/}}
{{- define "discourse.ingress.tls" -}}
{{ .Release.Name }}-tls
{{- end -}}
{{/*
Create the name for the database secret.
*/}}
{{- define "discourse.secretName" -}}
{{- if .Values.secret.deploy -}}
{{- default .Release.Name .Values.secret.name -}}
{{- else -}}
{{- .Values.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 "discourse.secrets.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "secrets" .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name .Chart.Name $name | trunc 63 | trimSuffix "-" -}}
{{- 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 "discourse.postgresql.fullname" -}}
{{- printf "%s-%s" .Release.Name "postgresql" | 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 "discourse.redis.fullname" -}}
{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
This diff is collapsed.
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "discourse.fullname" . -}}
{{- $tlsSecretName := include "discourse.ingress.tls" . -}}
{{- $ingressPaths := .Values.ingress.paths -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
app.kubernetes.io/name: {{ include "discourse.name" . }}
helm.sh/chart: {{ include "discourse.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ $tlsSecretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . | quote }}
http:
paths:
{{- range $ingressPaths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: http
{{- end }}
{{- end }}
{{- end }}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "discourse.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "discourse.name" . }}
helm.sh/chart: {{ include "discourse.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .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: v1
kind: Secret
metadata:
name: {{ .Release.Name }}
labels:
{{ include "discourse.standardLabels" . | indent 4 }}
type: Opaque
data:
smtp-password: {{ .Values.smtp.password | b64enc | quote }}
postgresql-password: {{ .Values.global.postgresql.postgresPassword | b64enc | quote }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "discourse.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "discourse.name" . }}
helm.sh/chart: {{ include "discourse.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 80
targetport: http
protocol: TCP
name: http
- port: {{ .Values.service.port }}
targetport: api
protocol: TCP
name: api
selector:
app.kubernetes.io/name: {{ include "discourse.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "discourse.fullname" . }}-test-connection"
labels:
app.kubernetes.io/name: {{ include "discourse.name" . }}
helm.sh/chart: {{ include "discourse.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "discourse.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never
# Default values for discourse.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
server:
host: myhost
port: 3000
init:
image:
repository: alpine
tag: 3.7
pullPolicy: IfNotPresent
image:
repository: indiehosters/discourse
tag: 2.2.4
pullPolicy: IfNotPresent
web:
image:
repository: indiehosters/discourse-web
tag: 2.2.4
pullPolicy: IfNotPresent
sidekiq:
image:
repository: indiehosters/discourse
tag: 2.2.4
pullPolicy: IfNotPresent
nameOverride: ""
fullnameOverride: ""
service:
type: ClusterIP
port: 80
hostname: chart-example.local
smtp:
port: 587
address: mail@mail.com
password: password
username: mail@mail.com
postgresql:
secret:
deploy: false
global:
postgresql:
postgresUser: discourse
postgresPassword: password
postgresDatabase: discourse
ingress:
enabled: true
annotations:
# kubernetes.io/ingress.class: nginx
kubernetes.io/tls-acme: "true"
paths:
- /
hosts:
- chart-example.local
tls:
# - secretName: chart-example-tls
- hosts:
- chart-example.local
persistence:
enabled: true
storageClass: "rbd"
accessModes: ReadWriteOnce
size: 8Gi
probes:
liveness:
enabled: false
initialDelay: 60
timeoutSeconds: 5
failureThreshold: 6
readiness:
enabled: false
initialDelay: 5
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: {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment