Commit cbb4d667 authored by kawsark's avatar kawsark

Clarified helm instructions

parent ed7cc489
Pipeline #91735123 passed with stages
in 1 minute and 9 seconds
......@@ -2,12 +2,18 @@
Reference: [GitLab Runner Helm Chart](https://docs.gitlab.com/runner/install/kubernetes.html)
### Install helm charts
- [Install Helm for your system](https://helm.sh/docs/using_helm/#install-helm)
- Initialize Helm and Install Tiller in current kubectl context (`kubectl config current-context`)
Reference: [https://helm.sh/docs/using_helm/#initialize-helm-and-install-tiller](initialize-helm-and-install-tiller)
[Install Helm for your system](https://helm.sh/docs/using_helm/#install-helm)
### Installing the GitLab Runner helm chart - with Tiller
- Initialize Helm and Install Tiller in current kubectl context (`kubectl config current-context`. Assuming you are in the root directory of this repo, please run the commands below.
```
helm init --service-account tiller --history-max 200 --upgrade
kubectl apply -f helm/helm-service-account.yaml
helm init --service-account tiller --upgrade
# Verify that the tiller-deploy pod is running
kubectl -n kube-system get po | grep tiller
```
Reference: [https://helm.sh/docs/using_helm/#initialize-helm-and-install-tiller](initialize-helm-and-install-tiller)
- Alternatively, if you have already installed helm and want to upgrade it please run the command below.
```
helm init --service-account tiller --upgrade
......@@ -15,26 +21,33 @@ helm init --service-account tiller --upgrade
kubectl -n kube-system get po | grep tiller
```
### Download and install the helm chart
Please adjust [my-values.yaml](helm/my-values.yaml) file in this repo as needed.
- Adjust `runnerRegistrationToken` from GitLab CI / CD
- Adjust the `image` key if you built and publised your own Docker container
- Ensure the `tags` key has `curl` and any other `tags` in `.gitlab-ci.yml`.
- Please adjust [my-values.yaml](helm/my-values.yaml) file in this repo as needed.
- Adjust `runnerRegistrationToken` from GitLab CI / CD
- Adjust the `image` key if you built and publised your own Docker container. The default image is `kawsark/gitlab-ruby-curl:0.0.1`
- Ensure the `tags` key has `curl` and any other `tags` in `.gitlab-ci.yml`.
```
cd helm/
kubectl apply -f ns.yaml
kubectl apply -f rbac.yaml
git clone [email protected]:charts/gitlab-runner.git
# Edit the example my-values.yaml file as needed
cp my-values.yaml
helm install --namespace gitlab --name gitlab-runner -f my-values.yaml gitlab-runner
#git clone [email protected]:charts/gitlab-runner.git
helm repo add gitlab https://charts.gitlab.io
helm repo update
# Substitute <your-registration-token> below:
sed -e "s/my-runner-token/<your-registration-token>" < my-values-example.yaml > my-values.yaml
# Adjust my-values.yaml file further if needed
helm install --namespace gitlab --name gitlab-runner -f my-values.yaml gitlab/gitlab-runner
helm ls
```
Reference: [GitLab Runner Helm Chart](https://docs.gitlab.com/runner/install/kubernetes.html)
Note: if you are getting RBAC issues during helm deployment, please consult this excellent guide [Configure RBAC for Helm](https://docs.bitnami.com/kubernetes/how-to/configure-rbac-in-your-kubernetes-cluster/#use-case-2-enable-helm-in-your-cluster).
### Check pods deployed
```
export ns="gitlab"
kubectl get pods -n ${ns}
kubectl logs -f <podname> -n ${ns}
```
\ No newline at end of file
kubectl get pods -n gitlab
kubectl logs -f <podname> -n gitlab
```
### Installing the GitLab Runner helm chart - No Tiller
These steps will allow us to install GitLab Runner without the server side Tiller admin account.
_Pending_
gitlab-runner @ a9df026f
Subproject commit a9df026ffb8acd5f9685caa0a60b1405ebe43bf6
# Create a service account for Helm and grant the cluster admin role.
# It is assumed that helm should be installed with this service account
# (tiller).
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
\ No newline at end of file
This diff is collapsed.
......@@ -5,9 +5,9 @@ From GitLab CI / CD projects page, click "Set up a specific Runner manually":
- Use `gitlab-runner register` command to register the runner:
- `gitlab-ci coordinator URL` should be `https://gitlab.com/` or your GitLab enterprise server
- `gitlab-ci token` will be provided in GitLab UI (Settings > CI/CD > "Set up a specific Runner")
- `gitlab-ci tags` should say `terraform, tfc, 0.12, curl` (these are specified in `.gitlab-ci.yml` file)
- `gitlab-ci tags` should say `curl` as this is specified in `.gitlab-ci.yml` file.
- `executor`: docker
- `default Docker image`: Specify the Docker image you built, or use `kawsark/gitlab-terraform:0.12.10` which contains terraform 0.12.10.
- `default Docker image`: Specify the Docker image you built, or use `kawsark/gitlab-ruby-curl:0.0.1` which contains terraform 0.12.10.
- Run `gitlab-runner verify` to ensure the runner is registered properly
- Start the Runner using `gitlab-runner run`
......
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