148422597X Kubernetes Management Design Patterns [Vohra 2017-01-29] {E559F6BB}
Chapter 1 ■ Kubernetes on AWSSimilarly, for each of the kubernetes-minion nodes, add the default security group and click AssignSecurity Groups as shown in Figure 1-23.Figure 1-23. Assigning security groups for kubernetes-minionAlternatively, if the default security group was modified not to allow all traffic, the security groupassigned to the kubernetes-master and each of the kubernetes-minion security groups should include aninbound rule to all traffic, as shown in Figure 1-24.Figure 1-24. The security group with inbound rules to allow all traffic16
Testing the ClusterChapter 1 ■ Kubernetes on AWSNext, we will test the Kubernetes cluster. First, we need to add the directory path in which the Kubernetesbinaries are installed to the environment variable PATH.export PATH=/home/ec2-user/kubernetes/platforms/linux/amd64:$PATHSubsequently echo the PATH environment variable as shown in Figure 1-25.Figure 1-25. Setting the PATH environment variableTo test the cluster, run a Docker image such as the nginx image to create three pod replicas:kubectl run nginx --image=nginx --replicas=3 --port=80List the pods:kubectl get podsList the deployments:kubectl get deploymentsCreate a service of type LoadBalancer for the deployment:kubectl expose deployment nginx --port=80 --type=LoadBalancerList the services:kubectl get servicesList the pods across the clusterkubectl get pods –o wideIf Kubernetes has installed correctly, all the previous commands should run correctly and generate theoutput to indicate that a pod cluster has been created, as shown in Figure 1-26.17
- Page 1 and 2: KubernetesManagementDesign Patterns
- Page 3 and 4: Kubernetes Management Design Patter
- Page 5 and 6: ■ CONTENTS AT A GLANCE■Part
- Page 7 and 8: ■ CONTENTSSetting Up Cluster Para
- Page 9 and 10: ■ CONTENTS■Chapter ■ 6: Us
- Page 11 and 12: ■ CONTENTSOvercommitting Resou
- Page 13 and 14: ■ CONTENTSInstalling OpenShift
- Page 15 and 16: About the Technical ReviewerMassimo
- Page 17 and 18: ■ INTRODUCTIONpatterns are lan
- Page 19 and 20: ■ INTRODUCTIONIn Chapter 3 we
- Page 21 and 22: CHAPTER 1Kubernetes on AWSKubernete
- Page 23 and 24: Chapter 1 ■ Kubernetes on AWSIn t
- Page 25 and 26: Chapter 1 ■ Kubernetes on AWSUsin
- Page 27 and 28: Chapter 1 ■ Kubernetes on AWSClic
- Page 29 and 30: Chapter 1 ■ Kubernetes on AWSFigu
- Page 31 and 32: Chapter 1 ■ Kubernetes on AWSFigu
- Page 33: Chapter 1 ■ Kubernetes on AWSFigu
- 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
Testing the Cluster
Chapter 1 ■ Kubernetes on AWS
Next, we will test the Kubernetes cluster. First, we need to add the directory path in which the Kubernetes
binaries are installed to the environment variable PATH.
export PATH=/home/ec2-user/kubernetes/platforms/linux/amd64:$PATH
Subsequently echo the PATH environment variable as shown in Figure 1-25.
Figure 1-25. Setting the PATH environment variable
To test the cluster, run a Docker image such as the nginx image to create three pod replicas:
kubectl run nginx --image=nginx --replicas=3 --port=80
List the pods:
kubectl get pods
List the deployments:
kubectl get deployments
Create a service of type LoadBalancer for the deployment:
kubectl expose deployment nginx --port=80 --type=LoadBalancer
List the services:
kubectl get services
List the pods across the cluster
kubectl get pods –o wide
If Kubernetes has installed correctly, all the previous commands should run correctly and generate the
output to indicate that a pod cluster has been created, as shown in Figure 1-26.
17