Commit db46c470 authored by DJ Mountney's avatar DJ Mountney

Merge branch '453-applicationcrd' into 'master'

Resolve "Support optional use of Application CRD"

Closes #568 and #453

See merge request charts/gitlab!363
parents c6fb4529 dcc789fd
Pipeline #25292096 failed with stages
in 28 minutes and 51 seconds
---
title: Support optional Application CRD
merge_request: 363
author: Corey O'Brien
type: added
......@@ -4,9 +4,7 @@ kind: Issuer
metadata:
name: {{ .Release.Name }}-issuer
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
acme:
# The ACME server URL
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}-certmanager
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
create-issuer: |
{{ include (print $.Template.BasePath "/_create_issuer.sh") . | indent 4 }}
......
......@@ -4,10 +4,7 @@ kind: Job
metadata:
name: {{ template "certmanager-issuer.jobname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
activeDeadlineSeconds: 300
template:
......
......@@ -4,10 +4,7 @@ kind: ServiceAccount
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
namespace: {{ .Release.Namespace }}
---
......@@ -21,7 +18,7 @@ rules:
resources: ["issuers"]
verbs: ["get", "list", "update", "create", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "fullname" . }}
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
configure: |
set -e
......
......@@ -4,10 +4,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
maxUnavailable: {{ .Values.maxUnavailable }}
selector:
......
......@@ -4,10 +4,7 @@ kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
{{- if .Values.metrics.enabled }}
prometheus.io/scrape: "true"
......
......@@ -4,10 +4,7 @@ kind: StatefulSet
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.immutableLabels" . | indent 4 }}
spec:
selector:
matchLabels:
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
configure: |
set -e
......
{{- if .Values.enabled -}}
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
selector:
matchLabels:
app: {{ template "name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
......
......@@ -4,13 +4,10 @@ kind: HorizontalPodAutoscaler
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
name: {{ template "fullname" . }}
minReplicas: {{ .Values.minReplicas }}
......
......@@ -3,12 +3,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nginx-ingress.tcp-configmap" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
name: {{ template "nginx-ingress.tcp-configmap" . }}
labels:
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
22: "{{ .Release.Namespace }}/{{ template "fullname" . }}:{{ .Values.service.externalPort }}"
{{- end -}}
......
......@@ -4,10 +4,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
maxUnavailable: {{ .Values.maxUnavailable }}
selector:
......
......@@ -4,10 +4,7 @@ kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
{{ include "gitlab.serviceAnnotations" . | indent 4 }}
spec:
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
database.yml.erb: |
production:
......
......@@ -4,10 +4,7 @@ kind: Job
metadata:
name: {{ template "migrations.jobname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
template:
metadata:
......
......@@ -11,10 +11,7 @@ kind: ConfigMap
metadata:
name: {{ printf "%s-%s" $fullname .name | trunc 63 }}
labels:
app: {{ $name }}
chart: {{ $chart }}
release: {{ $releaseName }}
heritage: {{ $releaseService }}
{{ include "gitlab.standardLabels" $ | indent 4 }}
queue_pod_name: {{ .name }}
data:
sidekiq_queues.yml.erb: |
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
database.yml.erb: |
production:
......
......@@ -34,17 +34,18 @@
{{- range .Values.pods -}}
{{- $queueName := printf "%s-%s" $fullname .name | trunc 63}}
{{- $podNodeSelector := default $nodeSelector .nodeSelector -}}
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ $queueName }}
labels:
app: {{ $name }}
chart: {{ $chart }}
release: {{ $releaseName }}
heritage: {{ $releaseService }}
{{ include "gitlab.standardLabels" $ | indent 4 }}
queue-pod-name: {{ .name }}
spec:
selector:
matchLabels:
app: {{ $name }}
release: {{ $releaseName }}
template:
metadata:
labels:
......
......@@ -9,13 +9,10 @@ kind: HorizontalPodAutoscaler
metadata:
name: {{ $queueName }}
labels:
app: {{ template "name" $ }}
chart: {{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_" }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
{{ include "gitlab.standardLabels" $ | indent 4 }}
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
name: {{ $queueName }}
minReplicas: {{ default $.Values.minReplicas .minReplicas }}
......
......@@ -5,10 +5,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
maxUnavailable: {{ .Values.maxUnavailable }}
selector:
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
database.yml.erb: |
production:
......
{{- if .Values.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
installation_type: |
gitlab-helm-chart
......
{{- if .Values.enabled }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
......
......@@ -4,13 +4,10 @@ kind: HorizontalPodAutoscaler
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
scaleTargetRef:
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
name: {{ template "fullname" . }}
minReplicas: {{ .Values.minReplicas }}
......
......@@ -7,10 +7,7 @@ kind: Ingress
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
kubernetes.io/ingress.class: "{{ template "gitlab.ingressclass" . }}"
kubernetes.io/ingress.provider: nginx
......
......@@ -4,10 +4,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
maxUnavailable: {{ .Values.maxUnavailable }}
selector:
......
......@@ -4,10 +4,7 @@ kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
{{ include "gitlab.serviceAnnotations" . | indent 4 }}
spec:
......
......@@ -4,10 +4,7 @@ kind: Job
metadata:
name: {{ template "minio.createBucketsJobName" . }}
labels:
app: {{ template "minio.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
activeDeadlineSeconds: 600
template:
......
......@@ -7,10 +7,7 @@ kind: Ingress
metadata:
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
kubernetes.io/ingress.class: "{{ template "minio.ingressclass" . }}"
kubernetes.io/ingress.provider: nginx
......
{{- if .Values.global.minio.enabled -}}
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
selector:
matchLabels:
......
......@@ -4,10 +4,7 @@ apiVersion: {{ template "minio.networkPolicy.apiVersion" . }}
metadata:
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
podSelector:
matchLabels:
......
......@@ -4,10 +4,7 @@ apiVersion: v1
metadata:
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
......
......@@ -4,10 +4,7 @@ apiVersion: v1
metadata:
name: {{ template "minio.fullname" . }}-svc
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
annotations:
{{ include "gitlab.serviceAnnotations" . | indent 4 }}
spec:
......
......@@ -4,10 +4,7 @@ kind: ConfigMap
metadata:
name: {{ template "minio.fullname" . }}-config-cm
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
data:
initialize: |-
{{ include (print $.Template.BasePath "/_helper_create_buckets.sh") . | indent 4 }}
......
......@@ -4,10 +4,7 @@ kind: PodDisruptionBudget
metadata:
name: {{ template "minio.fullname" . }}-v1
labels:
app: {{ template "minio.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ include "gitlab.standardLabels" . | indent 4 }}
spec:
maxUnavailable: {{ .Values.maxUnavailable }}
selector:
......
......@@ -23,14 +23,14 @@ It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status by running 'kubectl --namespace {{ .Release.Namespace }} get services -o wide -w {{ template "nginx-ingress.controller.fullname" . }}'
{{- else if contains "ClusterIP" .Values.controller.service.type }}
Get the application URL by running these commands:
export POD_NAME=$(kubectl --namespace {{ .Release.Namespace }} get pods -o jsonpath="{.items[0].metadata.name}" -l "app={{ template "nginx-ingress.name" . }},component={{ .Values.controller.name }},release={{ .Release.Name }}")
export POD_NAME=$(kubectl --namespace {{ .Release.Namespace }} get pods -o jsonpath="{.items[0].metadata.name}" -l "app={{ template "name" . }},component={{ .Values.controller.name }},release={{ .Release.Name }}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
echo "Visit http://127.0.0.1:8080 to access your application."
{{- end }}
An example Ingress that makes use of the controller:
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: Ingress
metadata:
annotations:
......
......@@ -2,7 +2,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "nginx-ingress.name" -}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
......
{{- if .Values.enabled -}}
{{- if or .Values.rbac.create .Values.rbac.createClusterRole -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app: {{ template "nginx-ingress.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{ include "gitlab.standardLabels" . | indent 4 }}
name: {{ template "nginx-ingress.fullname" . }}
rules:
- apiGroups:
......
{{- if .Values.enabled -}}
{{- if or .Values.rbac.create .Values.rbac.createClusterRole -}}
apiVersion: rbac.authorization.k8s.io/v1beta1
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app: {{ template "nginx-ingress.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{ include "gitlab.standardLabels" . | indent 4 }}
name: {{ template "nginx-ingress.fullname" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
......
......@@ -3,11 +3,8 @@ apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: {{ template "nginx-ingress.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{ include "gitlab.standardLabels" . | indent 4 }}
component: "{{ .Values.controller.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "nginx-ingress.controller.fullname" . }}
data:
enable-vts-status: "{{ .Values.controller.stats.enabled }}"
......
{{- if .Values.enabled -}}
{{- if eq .Values.controller.kind "DaemonSet" }}
apiVersion: extensions/v1beta1
apiVersion: apps/v1beta2
kind: DaemonSet
metadata:
labels:
app: {{ template "nginx-ingress.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
{{ include "gitlab.standardLabels" . | indent 4 }}
component: "{{ .Values.controller.name }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: {{ template "nginx-ingress.controller.fullname" . }}
spec:
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
......@@ -23,7 +20,7 @@ spec:
{{ toYaml .Values.controller.podAnnotations | indent 8}}
{{- end }}
labels:
app: {{ template "nginx-ingress.name" . }}
app: {{ template "name" . }}
component: "{{ .Values.controller.name }}"
release: {{ .Release.Name }}
{{- if .Values.controller.podLabels }}
......@@ -36,7 +33,7 @@ spec:
{{ toYaml .Values.imagePullSecrets | indent 8 }}
{{- end }}
containers:
- name: {{ template "nginx-ingress.name" . }}-{{ .Values.controller.name }}
- name: {{ template "name" . }}-{{ .Values.controller.name }}
image: "{{ .Values.controller.image.repository }}:{{ .Values.controller.image.tag }}"
imagePullPolicy: "{{ .Values.controller.image.pullPolicy }}"
{{- if .Values.controller.lifecycle }}
......
{{- if .Values.enabled -}}
{{- if eq .Values.controller.kind "Deployment" }}