-
Notifications
You must be signed in to change notification settings - Fork 0
Cluster Configuration
Leonardo Espinosa Torres edited this page Apr 22, 2018
·
2 revisions
- List container clusters
gcloud container clusters list- Set Zone in GCloud
gcloud config set compute/zone us-east1-d- Get cluster credentials
gcloud container clusters get-credentials cl-cyg-tst- Install kubectl (Kubernetes cli)
gcloud components install kubectl- List docker image tags in GCloud
gcloud container images list-tags gcr.io/comeygana-201900/tstcyg- Run docker image in google container engine with kubernetes (the label is for deployment and service) Note: label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name', or '123-abc', regex used for validation is 'a-z0-9?')
kubectl run <label> --image=gcr.io/comeygana-201900/tstcyg:<v0.0.0> --port=8080
kubectl run tstcyg-node --image=gcr.io/comeygana-201900/tstcyg:v1.0.0 --port=8080- Get cluster pods (pod = cluster node)
kubectl get pods- Create load balancer in cluster and expose nodes
kubectl expose deployment <label> --type="LoadBalancer"
kubectl expose deployment tstcyg-node --type="LoadBalancer"- Get external IP to access the cluster:
kubectl get services- Create Ingress resource tstcyg-ingress.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: tstcyg-ingress
spec:
backend:
serviceName: tstcyg-node
servicePort: 8080- Deploy ingress resource
kubectl apply -f tstcyg-ingress.yaml- Find out the external IP address
kubectl get ingress tstcyg-ingress