...
 
Commits (1)
......@@ -18,7 +18,7 @@ function generate_secret_if_needed(){
else
echo "secret \"$secret_name\" already exists"
fi;
{{- if not .Values.global.application.create }}
{{- if not (include "gitlab.application.enabled" . ) }}
# Remove application labels if they exist
kubectl --namespace=$namespace label \
secret $secret_name $(echo '{{ include "gitlab.application.labels" . | replace ": " "=" | replace "\n" " " }}' | sed -E 's/=[^ ]*/-/g')
......
......@@ -60,7 +60,7 @@ spec:
# create wildcard certificate secret
kubectl create secret tls $certname \
--cert=/output/wildcard.pem --key=/output/wildcard-key.pem || true
{{- if not .Values.global.application.create }}
{{- if not (include "gitlab.application.enabled" . ) }}
kubectl --namespace=$namespace label \
secret $certname $(echo '{{ include "gitlab.application.labels" . | replace ": " "=" | replace "\n" " " }}' | sed -E 's/=[^ ]*/-/g')
{{- end }}
......@@ -69,7 +69,7 @@ spec:
# create CA certificate secret
kubectl create secret generic ${certname}-ca \
--from-file=cfssl_ca=/output/ca.pem || true
{{- if not .Values.global.application.create }}
{{- if not (include "gitlab.application.enabled" . ) }}
kubectl --namespace=$namespace label \
secret ${certname}-ca $(echo '{{ include "gitlab.application.labels" . | replace ": " "=" | replace "\n" " " }}' | sed -E 's/=[^ ]*/-/g')
{{- end }}
......
......@@ -752,11 +752,13 @@ which can be created to identify the GitLab application within the cluster. Requ
[Application CRD](https://github.com/kubernetes-sigs/application#installing-the-crd),
version `v1beta1`, to already be deployed to the cluster.
To enable, set `global.application.create` to `true`:
To enable support for the application within the chart, set `global.application.enabled` to `true`, and `global.application.create`
to `true` to tell the chart to create the application itself.
```yaml
global:
application:
enabled: true
create: true
```
......
......@@ -17,6 +17,7 @@ Tables below contain all the possible charts configurations that can be supplied
| global.time_zone | Global time zone | UTC |
| global.service.annotations | Annotations to add to every `Service` | {} |
| global.registry.bucket | registry bucket name | registry |
| global.application.enabled | Enable support for an [Application resource](https://github.com/kubernetes-sigs/application) | false |
| global.application.create | Create an [Application resource](https://github.com/kubernetes-sigs/application) for GitLab | false
## TLS configuration
......
......@@ -2,12 +2,18 @@
app.kubernetes.io/name: {{ .Release.Name }}
{{- end -}}
{{- define "gitlab.application.enabled" -}}
{{- if or .Values.global.application.create .Values.global.application.enabled -}}
true
{{- end -}}
{{- end -}}
{{- define "gitlab.standardLabels" -}}
app: {{ template "name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ if .Values.global.application.create -}}
{{ if (include "gitlab.application.enabled" . ) -}}
{{ include "gitlab.application.labels" . }}
{{- end -}}
{{- end -}}
......@@ -17,7 +23,7 @@ app: {{ template "name" . }}
chart: {{ .Chart.Name }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{ if .Values.global.application.create -}}
{{ if (include "gitlab.application.enabled" . ) -}}
{{ include "gitlab.application.labels" . }}
{{- end -}}
{{- end -}}
......@@ -12,7 +12,7 @@
# - external Redis
# - external NGINX
# - PersistentVolume configuration
# - external Object Storage providers
# - external Object Storage providers
## The global properties are used to configure multiple charts at once.
## Extended documenation at doc/charts/globals.md
......@@ -29,6 +29,7 @@ global:
## doc/charts/globals.md#application-resource
application:
enabled: false
create: false
links: []
allowClusterRoles: true
......@@ -226,7 +227,7 @@ global:
hostKeys: {}
# secret:
## Rails application secrets
## Rails application secrets
## Secret created according to doc/installation/secrets.md#gitlab-rails-secret
## If allowing shared-secrets generation, this is OPTIONAL.
railsSecrets: {}
......@@ -442,13 +443,13 @@ gitlab-runner:
## doc/charts/gitlab/migrations
# migrations:
# enabled: false
## doc/charts/gitlab/unicorn
## doc/charts/gitlab/unicorn
# unicorn:
# enabled: false
## doc/charts/gitlab/sidekiq
## doc/charts/gitlab/sidekiq
# sidekiq:
# enabled: false
## doc/charts/gitlab/gitaly
## doc/charts/gitlab/gitaly
# gitaly:
# enabled: false
## doc/charts/gitlab/gitlab-shell
......