Move Commands
This commit is contained in:
@@ -99,4 +99,19 @@ kubectl api-resources
|
|||||||
### Apply Yaml File
|
### Apply Yaml File
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f <yaml-file> -n <namespace-name>
|
kubectl apply -f <yaml-file> -n <namespace-name>
|
||||||
```
|
```
|
||||||
|
### View Pod Details
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl get pod -n my-ns <pod-name> -o yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
This command retrieves and displays the YAML configuration of the pod `testpod1` in the namespace `my-ns`.
|
||||||
|
|
||||||
|
### Label a Node
|
||||||
|
|
||||||
|
```bash
|
||||||
|
kubectl label node <node-name> kubernetes.io/<var-name>=<var-value>
|
||||||
|
kubectl get nodes --show-labels
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -190,19 +190,4 @@ spec:
|
|||||||
|
|
||||||
This defines a pod named `my-pod` running an Nginx container exposing port 80.
|
This defines a pod named `my-pod` running an Nginx container exposing port 80.
|
||||||
|
|
||||||
## Useful Kubernetes Commands
|
|
||||||
|
|
||||||
### View Pod Details
|
|
||||||
|
|
||||||
```bash
|
|
||||||
kubectl get pod -n my-ns <pod-name> -o yaml
|
|
||||||
```
|
|
||||||
|
|
||||||
This command retrieves and displays the YAML configuration of the pod `testpod1` in the namespace `my-ns`.
|
|
||||||
|
|
||||||
### Label a Node
|
|
||||||
|
|
||||||
```bash
|
|
||||||
kubectl label node <node-name> kubernetes.io/<var-name>=<var-value>
|
|
||||||
kubectl get nodes --show-labels
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user