官术网_书友最值得收藏!

Examining the deployment

The redis-master deployment should be complete by now. On Azure Cloud Shell, type the following:

kubectl get all

You should get an output that looks something like this:

 NAME READY STATUS RESTARTS AGE
pod/redis-master-6b464554c8-554p8 1/1 Running 0 3h

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/Kubernetes ClusterIP 10.0.0.1 <none> 443/TCP 4h

NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
deployment.apps/redis-master 1 1 1 1 3h

NAME DESIRED CURRENT READY AGE
replicaset.apps/redis-master-6b464554c8 1 1 1 3h

You can see that we have a deployment named redis-master. It controls a replica set of redis-master-<random id>. Digging deeper, you will also find that the Replica Set is controlling Pod (a group of Docker containers that should be run together): redis-master-<replica set random id&gt;->random id&gt;.

More details can be obtained by typing kubectl describe <instance -name>, as follows:

kubectl describe deployment/redis-master

This will give us the following output:

Name: redis-master
Namespace: default
CreationTimestamp: Wed, 26 Dec 2018 01:47:56 +0000
Labels: app=redis
Annotations: deployment.Kubernetes .io/revision=1
kubectl.Kubernetes .io/last-applied-configuration={"apiVersion":"apps/v1","kind":"Deployment","metadata":{"annotations":{},"labels":{"app":"redis"},"name":"redis-master","namespace":"default"},"spec":{...
Selector: app=redis,role=master,tier=backend
Replicas: 1 desired | 1 updated | 1 total | 1 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app=redis
role=master
tier=backend
Containers:
master:
Image: k8s.gcr.io/redis:e2e
Port: 6379/TCP
Host Port: 0/TCP
Requests:
cpu: 100m
memory: 100Mi
Environment: <none>
Mounts: <none>
Volumes: <none>
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: redis-master-6b464554c8 (1/1 replicas created)
Events: <none>

In true internet fashion, launching an application without any environment-specific configuration has already become obsolete. We will introduce a new concept called ConfigMaps and then resume the regularly-scheduled program. First, we need to clean up, and we can do so by running the following command:

kubectl delete deployment/redis-master

You will see the following output:

deployment.extensions "redis-master" deleted

主站蜘蛛池模板: 大兴区| 鹤峰县| 新龙县| 浦县| 泰州市| 沅江市| 恭城| 昌江| 肥乡县| 安义县| 德昌县| 防城港市| 开鲁县| 汾阳市| 沙雅县| 石狮市| 横山县| 临清市| 建平县| 城口县| 怀安县| 德格县| 观塘区| 准格尔旗| 嘉善县| 林西县| 体育| 武安市| 阜城县| 河池市| 启东市| 鄂托克旗| 乌苏市| 昌都县| 山阳县| 息烽县| 加查县| 玉山县| 历史| 灌阳县| 景洪市|