‘kubectl describe pod {podName}’ command is used to get the current Pod configuration. This command queries ‘etcd’ (etcd is a Kubernetes key-value database) and returns all the information about the given resource.
Let’s create a Pod from yml definition file and see the configuration using ‘describe’ command.
employeeServicePod.yml
apiVersion: v1
kind: Pod
metadata:
name: employee-service
labels:
app: employee-service
author: krishna
serviceType: webservice
spec:
containers:
- name: employee-service-container
image: jboss/wildfly
Now create a pod by executing below command.
kubectl create -f employeeServicePod.yml
$kubectl create -f employeeServicePod.yml pod/employee-service created
Let’s describe the pod ‘employee-service’ by executing the below command.
kubectl describe pod employee-service
$kubectl describe pod employee-service
Name: employee-service
Namespace: default
Priority: 0
Node: minikube/192.168.99.100
Start Time: Sun, 07 Jun 2020 00:07:52 +0530
Labels: app=employee-service
author=krishna
serviceType=webservice
Annotations: <none>
Status: Running
IP: 172.17.0.6
IPs:
IP: 172.17.0.6
Containers:
employee-service-container:
Container ID: docker://60f9841ce5a9d9827cda31ad277f168085368a9f874f325dbffdfbb64094b0ac
Image: jboss/wildfly
Image ID: docker-pullable://jboss/wildfly@sha256:67a4f90b213bc2600d08d90e82df58be83813d118d163fbcc8765b6eeaade7e6
Port: <none>
Host Port: <none>
State: Running
Started: Sun, 07 Jun 2020 00:07:56 +0530
Ready: True
Restart Count: 0
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-w7rp7 (ro)
Conditions:
Type Status
Initialized True
Ready True
ContainersReady True
PodScheduled True
Volumes:
default-token-w7rp7:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-w7rp7
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled <unknown> default-scheduler Successfully assigned default/employee-service to minikube
Normal Pulling 39s kubelet, minikube Pulling image "jboss/wildfly"
Normal Pulled 35s kubelet, minikube Successfully pulled image "jboss/wildfly"
Normal Created 35s kubelet, minikube Created container employee-service-container
Normal Started 35s kubelet, minikube Started container employee-service-container
No comments:
Post a Comment