Skip to content

Instantly share code, notes, and snippets.

@fabiocruzcoelho
Last active June 15, 2018 14:31
Show Gist options
  • Save fabiocruzcoelho/7520889e72e5290c59ad4410c4d909ce to your computer and use it in GitHub Desktop.
Save fabiocruzcoelho/7520889e72e5290c59ad4410c4d909ce to your computer and use it in GitHub Desktop.
# Stack - Gitlab in kubernetes
## Add Repo
```
helm repo add gitlab https://charts.gitlab.io
```
## Install Gitlab
``helm upgrade -i gitlab -f values.yml gitlab/gitlab-omnibus --namespace agilitystack
``
> Workaround to RBAC Clusters
* helm
``kubectl create serviceaccount --namespace kube-system tiller
``
``kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
``
``kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
``
``helm init --service-account tiller --upgrade
``
* ingress
``kubectl create serviceaccount --namespace nginx-ingress default
``
``kubectl create clusterrolebinding nginx-cluster-rule --clusterrole=cluster-admin --serviceaccount=nginx-ingress:default
``
``kubectl patch deploy --namespace nginx-ingress default-http-backend -p '{"spec":{"template":{"spec":{"serviceAccount":"default"}}}}'
``
* kube-lego
``kubectl create serviceaccount --namespace kube-lego default
``
``kubectl create clusterrolebinding kube-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-lego:default
``
``kubectl patch deploy --namespace kube-lego kube-lego -p '{"spec":{"template":{"spec":{"serviceAccount":"default"}}}}'
``
* gitlab-runner
``kubectl create serviceaccount --namespace agilitystack default
``
``kubectl create clusterrolebinding gitlab-cluster-rule --clusterrole=cluster-admin --serviceaccount=agilitystack:default
``
``kubectl patch deploy --namespace gitlab devops-gitlab-runner -p '{"spec":{"template":{"spec":{"serviceAccount":"default"}}}}'
``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment