Previous posts:
Install Pivotal Container Service (PKS) on GCP and getting started
http://theblasfrompas.blogspot.com.au/2018/04/install-pivotal-container-service-pks.html
Wiring kubectl / Setup external LB on GCP into Pivotal Container Service (PKS) clusters to get started
http://theblasfrompas.blogspot.com.au/2018/04/wiring-kubectl-setup-external-lb-on-gcp.html
So lets now create our first workload as shown below
1. Download YML demo from here
https://github.com/cloudfoundry-incubator/kubo-ci/blob/master/specs/nginx-lb.yml
2. Deploy as shown below
pasapicella@pas-macbook:~/pivotal/GCP/install/21/PKS/demo-workload$ kubectl create -f nginx-lb.yml
service "nginx" created
deployment "nginx" created
3. Check current status
pasapicella@pas-macbook:~/pivotal/GCP/install/21/PKS/demo-workload$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-679dc9c764-8cwzq 1/1 Running 0 22s
nginx-679dc9c764-p8tf2 1/1 Running 0 22s
nginx-679dc9c764-s79mp 1/1 Running 0 22s
4. Wait for External IP address of the nginx service to be assigned
pasapicella@pas-macbook:~/pivotal/GCP/install/21/PKS/demo-workload$ kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.100.200.1
nginx LoadBalancer 10.100.200.143 35.189.23.119 80:30481/TCP 1m
5. In a browser access the K8's workload as follows, using the external IP
http://35.189.23.119
More Info
https://docs.pivotal.io/runtimes/pks/1-0/index.html
No comments:
Post a Comment