-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update and rename 19-METRICS.md to 19-POD-LABELS.md
- Loading branch information
1 parent
13cd5fb
commit 0d0cde1
Showing
2 changed files
with
25 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
How to create kubectl alias (optional): | ||
- `alias k=kubectl` | ||
|
||
Doc: | ||
- `https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/` | ||
|
||
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` |