Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 505 Bytes

19-POD-LABELS.md

File metadata and controls

25 lines (22 loc) · 505 Bytes

How to create kubectl alias (optional):

  • alias k=kubectl

Documentation:

Add two labels on a POD:

apiVersion: v1
kind: Pod
metadata:
  name: nginx-labels-pod
  labels:
    environment: production
    app: nginx
spec:
  containers:
  - name: nginx
    image: nginx:1.14.2
    ports:
    - containerPort: 80`

Get Pods by labels:

  • k get pods -l environment=production,tier=frontend