148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 3 ■ Kubernetes on Google Cloud PlatformThe VM Instances also lists the controller and minion instances started for the Kubernetes cluster, asshown in Figure 3-41.Figure 3-41. Listing the Kubernetes controller and minion instancesSelect the External IP Addresses tab to list all the external IP addresses, including those for thecontroller and minion instances, as shown in Figure 3-42.Figure 3-42. Listing the external IP addressesCreating a Kubernetes Application and ServiceIn this section we’ll create a sample Kubernetes application using the Docker image nginx. The followingcommand creates a deployment for the nginx Docker image.kubectl.sh --namespace=default run nginx --image=nginx –replicas=3 –port=80Deployment "nginx" is created as shown in Figure 3-43.Figure 3-43. Creating a deployment nginx71
Chapter 3 ■ Kubernetes on Google Cloud PlatformList the pods, including the nodes the pods run on:kubectl.sh get pods -o wideThe three pod replicas including the node are listed as shown in Figure 3-44.Figure 3-44. Listing the node replicasList the deployments:kubectl.sh get deploymentsCreate a service for type LoadBalancer:kubectl.sh expose deployment nginx --port=80 --type=LoadBalancerList the services:kubectl.sh get servicesThe output from the preceding commands is shown in Figure 3-45.Figure 3-45. Listing the deployments and servicesDescribe the nginx service:kubectl.sh describe svc nginxThe service description, including the service endpoints and any error messages, is listed as shown inFigure 3-46.72
- Page 37 and 38: Chapter 1 ■ Kubernetes on AWSFigu
- Page 39 and 40: Chapter 1 ■ Kubernetes on AWSFigu
- Page 41 and 42: CHAPTER 2Kubernetes on CoreOS on AW
- Page 43 and 44: Chapter 2 ■ Kubernetes on CoreOS
- Page 45 and 46: Chapter 2 ■ Kubernetes on CoreOS
- Page 47 and 48: Chapter 2 ■ Kubernetes on CoreOS
- Page 49 and 50: Customizing the ClusterChapter 2
- Page 51 and 52: Chapter 2 ■ Kubernetes on CoreOS
- Page 53 and 54: Chapter 2 ■ Kubernetes on CoreOS
- Page 55 and 56: Chapter 2 ■ Kubernetes on CoreOS
- Page 57 and 58: Chapter 2 ■ Kubernetes on CoreOS
- Page 59 and 60: Chapter 2 ■ Kubernetes on CoreOS
- Page 61 and 62: Chapter 2 ■ Kubernetes on CoreOS
- Page 63 and 64: Chapter 2 ■ Kubernetes on CoreOS
- Page 65 and 66: Chapter 2 ■ Kubernetes on CoreOS
- Page 67 and 68: Chapter 3 ■ Kubernetes on Google
- Page 69 and 70: Chapter 3 ■ Kubernetes on Google
- Page 71 and 72: Chapter 3 ■ Kubernetes on Google
- Page 73 and 74: Chapter 3 ■ Kubernetes on Google
- Page 75 and 76: Chapter 3 ■ Kubernetes on Google
- Page 77 and 78: Chapter 3 ■ Kubernetes on Google
- Page 79 and 80: Chapter 3 ■ Kubernetes on Google
- Page 81 and 82: Chapter 3 ■ Kubernetes on Google
- Page 83 and 84: Chapter 3 ■ Kubernetes on Google
- Page 85 and 86: Chapter 3 ■ Kubernetes on Google
- Page 87: Chapter 3 ■ Kubernetes on Google
- Page 91 and 92: Chapter 3 ■ Kubernetes on Google
- Page 93 and 94: Chapter 3 ■ Kubernetes on Google
- Page 95 and 96: Chapter 3 ■ Kubernetes on Google
- Page 97 and 98: Chapter 3 ■ Kubernetes on Google
- Page 99 and 100: Chapter 3 ■ Kubernetes on Google
- Page 101 and 102: Chapter 3 ■ Kubernetes on Google
- Page 103 and 104: Chapter 3 ■ Kubernetes on Google
- Page 105 and 106: PART IIAdministration andConfigurat
- Page 107 and 108: Chapter 4 ■ Using Multiple ZonesS
- Page 109 and 110: Chapter 4 ■ Using Multiple ZonesF
- Page 111 and 112: Chapter 4 ■ Using Multiple ZonesF
- Page 113 and 114: Chapter 4 ■ Using Multiple ZonesA
- Page 115 and 116: Chapter 4 ■ Using Multiple ZonesF
- Page 117 and 118: Chapter 4 ■ Using Multiple ZonesR
- Page 119 and 120: Chapter 4 ■ Using Multiple ZonesF
- Page 121 and 122: Chapter 4 ■ Using Multiple ZonesF
- Page 123 and 124: Chapter 4 ■ Using Multiple ZonesL
- Page 125 and 126: Chapter 4 ■ Using Multiple ZonesF
- Page 127 and 128: Chapter 4 ■ Using Multiple ZonesI
- Page 129 and 130: Chapter 4 ■ Using Multiple ZonesC
- Page 131 and 132: Chapter 4 ■ Using Multiple ZonesA
- Page 133 and 134: Chapter 5 ■ Using the Tectonic Co
- Page 135 and 136: Chapter 5 ■ Using the Tectonic Co
- Page 137 and 138: Chapter 5 ■ Using the Tectonic Co
Chapter 3 ■ Kubernetes on Google Cloud Platform
List the pods, including the nodes the pods run on:
kubectl.sh get pods -o wide
The three pod replicas including the node are listed as shown in Figure 3-44.
Figure 3-44. Listing the node replicas
List the deployments:
kubectl.sh get deployments
Create a service for type LoadBalancer:
kubectl.sh expose deployment nginx --port=80 --type=LoadBalancer
List the services:
kubectl.sh get services
The output from the preceding commands is shown in Figure 3-45.
Figure 3-45. Listing the deployments and services
Describe the nginx service:
kubectl.sh describe svc nginx
The service description, including the service endpoints and any error messages, is listed as shown in
Figure 3-46.
72