...
 
Commits (18)
......@@ -77,7 +77,6 @@ lint_package:
- install_tiller
- create_secret
- install_external_dns "${DNS_PROVIDER}" "${KUBE_INGRESS_BASE_DOMAIN}"
- if ! crdExists || previousDeployFailed ; then OPERATOR_BOOTSTRAP=true deploy ; fi
- deploy
- add_license
- echo "export QA_ENVIRONMENT_URL=gitlab-$CI_ENVIRONMENT_SLUG.$KUBE_INGRESS_BASE_DOMAIN" >> "${VARIABLES_FILE}"
......@@ -217,7 +216,6 @@ stop_review_eks:
- ensure_namespace
- install_tiller
- create_secret
- if ! crdExists || previousDeployFailed ; then OPERATOR_BOOTSTRAP=true deploy ; fi
- deploy
- delete canary
- echo "export QA_ENVIRONMENT_URL=gitlab.$KUBE_INGRESS_BASE_DOMAIN" >> "${VARIABLES_FILE}"
......@@ -428,14 +426,8 @@ check_docs_internal_links:
helm repo add gitlab https://charts.gitlab.io/
helm dep update .
# If OPERATOR_BOOTSTRAP is set, we _do not_ want to use --wait / --timeout
WAIT="--wait --timeout 600"
if [ -n "${OPERATOR_BOOTSTRAP}" ]; then
WAIT=""
fi
helm upgrade --install \
$WAIT \
--wait --timeout 600 \
--set releaseOverride="$CI_ENVIRONMENT_SLUG" \
--set global.hosts.hostSuffix="$HOST_SUFFIX" \
--set global.hosts.domain="$KUBE_INGRESS_BASE_DOMAIN" \
......@@ -450,7 +442,6 @@ check_docs_internal_links:
--set redis.resources.requests.cpu=100m \
--set minio.resources.requests.cpu=100m \
--set global.operator.enabled=true \
--set global.operator.bootstrap=${OPERATOR_BOOTSTRAP-false} \
--namespace="$KUBE_NAMESPACE" \
--version="$CI_PIPELINE_ID-$CI_JOB_ID" \
"$name" \
......
---
title: Hook GitLab Custom Resource to post-install and post-ugprade
merge_request: 754
author:
type: changed
......@@ -5,6 +5,9 @@ metadata:
labels:
controller-tools.k8s.io: "1.0"
name: {{ template "gitlab.operator.crdName" . }}
annotations:
"helm.sh/hook": "pre-install,pre-upgrade"
"helm.sh/hook-delete-policy": "before-hook-creation"
spec:
group: {{ template "gitlab.operator.groupName" . }}
names:
......
{{- if and .Values.global.operator.enabled (not .Values.global.operator.bootstrap) }}
{{- if and .Values.global.operator.enabled }}
apiVersion: {{ printf "%s/v1beta1" (include "gitlab.operator.groupName" .) }}
kind: GitLab
metadata:
......
{{- if and .Values.global.operator.enabled (not .Values.global.operator.bootstrap) }}
{{- if and .Values.global.operator.enabled }}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
......
......@@ -8,15 +8,6 @@ We provide an [operator chart](https://gitlab.com/charts/gitlab/tree/master/char
### Enabling the operator
We provide the flag `global.operator.enabled`, when set to true it enables the operator and allows it to manage resources.
NOTE: **Note**: This requires helm 2.12.3 or newer
## Installing using the operator
The operator makes use of Kubernetes CustomResourceDefinitions (CRD). Since Helm will be used for the installation, we need to ensure that this CRD is in place prior to attempting to use it. In order to do this, we have to run an additional command prior to use.
1. `helm upgrade --install <release-name> . --set global.operator.enabled=true --set global.operator.bootstrap=true ... ` where `...` shall be replaced by the rest of the values you would like to set.
2. `helm upgrade <release-name> . --set global.operator.enabled=true --set global.operator.bootstrap=false ...`.
The first command will install only the `CRD` but will not actually attempt to deploy the operator. The second command will deploy the operator itself, now that the CRD is in place.
**NOTE:** This needs done only the first time you install the operator, further upgrades will follow the normal [upgrade procedures](./upgrade.md)
We provide the flag `global.operator.enabled`, when set to true it enables the operator, installs the necessary CRDs and allows it to manage resources.