This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
Nginx Controller Ingress Setup
Olaf Szmidt edited this page Feb 16, 2018
·
7 revisions
Note: This should only be done once only. The only time when a new setup might be required is when you reset the cluster to a fresh state or delete the relevant pods, services & deployments.
In order to deploy our ingress correctly with a specific nginx controller used in google cloud platform, we need to create several services. All of these up to date instructions can be found here.
For the sake of correct version control, we have saved the yaml files at the time of setup in the repository ocadotechnology/codeforlife-deploy-appengine
at the path ./clusters_setup/ingress_nginx
.
To set up from scratch do the following:
- Install gcloud locally. This is usually done by the following command:
pip install google-cloud
. At the time of writing the version is0.32.0
and Google Cloud SDK of189.0.0
. - Authenticate accordingly. You can read up on this here. Usually the following should work:
gcloud auth login
. This will open a web browser and will ask you to authenticate and give permissions to the google account. You should then (or only) rungcloud auth application-default login
which will create the kubeconfig required forkubectl
to work. - Get credentials to the appropriate cluster you want to work on by doing the following command:
gcloud container clusters get-credentials [dev/staging/default]
-
kubectl apply -f
should now be used on the following files:-
namespace.yaml
,default-backend.yaml
,configmap.yaml
,tcp-services-configmap.yaml
,udp-services-configmap.yaml
.
-
- Now install no RBAC roles by doing the same on
without-rbac.yaml
. - And finally GCE specific settings and patches:
- Run
kubectl patch deployment -n ingress-nginx nginx-ingress-controller --type='json'
onpublish-service-patch.yaml
-
kubectl apply -f
onservice.yaml
andpatch-service-without-rbac.yaml
- Run