Skip to content

Commit a9920f6

Browse files
author
Christopher Hein
authored
Merge pull request aws-samples#455 from den-is/master
use stable api versions for resource which have been promoted to GA
2 parents 427da0a + bbebee4 commit a9920f6

File tree

49 files changed

+308
-148
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+308
-148
lines changed

01-path-basics/103-kubernetes-concepts/readme.adoc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,15 @@ A "`desired state`", such as 4 replicas of a pod, can be described in a Deployme
542542
The folowing example will create a Deployment with 3 replicas of NGINX base image. Let's begin with the template:
543543

544544
$ cat deployment.yaml
545-
apiVersion: extensions/v1beta1
545+
apiVersion: apps/v1
546546
kind: Deployment # kubernetes object type
547547
metadata:
548548
name: nginx-deployment # deployment name
549549
spec:
550550
replicas: 3 # number of replicas
551+
selector:
552+
matchLabels:
553+
app: nginx
551554
template:
552555
metadata:
553556
labels:
@@ -723,12 +726,15 @@ Pods belong to a service by using a loosely-coupled model where labels are attac
723726
Let's create a Deployment first that will create 3 replicas of a pod:
724727

725728
$ cat echo-deployment.yaml
726-
apiVersion: extensions/v1beta1
729+
apiVersion: apps/v1
727730
kind: Deployment
728731
metadata:
729732
name: echo-deployment
730733
spec:
731734
replicas: 3
735+
selector:
736+
matchLabels:
737+
app: echo-pod
732738
template:
733739
metadata:
734740
labels:
@@ -940,6 +946,10 @@ The folowing is an example DaemonSet that runs a Prometheus container. Let's beg
940946
metadata:
941947
name: prometheus-daemonset
942948
spec:
949+
selector:
950+
matchLabels:
951+
tier: monitoring
952+
name: prometheus-exporter
943953
template:
944954
metadata:
945955
labels:
@@ -1407,6 +1417,9 @@ No resource limits.
14071417
namespace: dev
14081418
spec:
14091419
replicas: 3
1420+
selector:
1421+
matchLabels:
1422+
app: nginx
14101423
template:
14111424
metadata:
14121425
labels:

01-path-basics/103-kubernetes-concepts/templates/daemonset.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: DaemonSet
33
metadata:
44
name: prometheus-daemonset
55
spec:
6+
selector:
7+
matchLabels:
8+
tier: monitoring
9+
name: prometheus-exporter
610
template:
711
metadata:
812
labels:
@@ -13,4 +17,4 @@ spec:
1317
- name: prometheus
1418
image: prom/node-exporter
1519
ports:
16-
- containerPort: 80
20+
- containerPort: 80
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: nginx-deployment-ns
55
namespace: dev
66
spec:
7-
replicas: 3
7+
replicas: 3
8+
selector:
9+
matchLabels:
10+
app: nginx
811
template:
912
metadata:
1013
labels:
11-
app: nginx
14+
app: nginx
1215
spec:
1316
containers:
14-
- name: nginx
17+
- name: nginx
1518
image: nginx:1.12.1
16-
ports:
19+
ports:
1720
- containerPort: 80
1821
- containerPort: 443
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: nginx-deployment
55
spec:
6-
replicas: 3
6+
replicas: 3
7+
selector:
8+
matchLabels:
9+
app: nginx
710
template:
811
metadata:
912
labels:
10-
app: nginx
13+
app: nginx
1114
spec:
1215
containers:
13-
- name: nginx
16+
- name: nginx
1417
image: nginx:1.12.1
15-
ports:
18+
ports:
1619
- containerPort: 80
1720
- containerPort: 443

01-path-basics/103-kubernetes-concepts/templates/echo-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: echo-deployment
55
spec:
66
replicas: 3
7+
selector:
8+
matchLabels:
9+
app: echo-pod
710
template:
811
metadata:
912
labels:

01-path-basics/103-kubernetes-concepts/templates/echo.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: echo-deployment
55
spec:
66
replicas: 3
7+
selector:
8+
matchLabels:
9+
app: echo-pod
710
template:
811
metadata:
912
labels:

01-path-basics/103-kubernetes-concepts/templates/replicaset.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: ReplicaSet
33
metadata:
44
name: nginx-replicaset
55
spec:
6-
replicas: 3
6+
replicas: 3
7+
selector:
8+
matchLabels:
9+
name: nginx-replica
710
template:
811
metadata:
912
labels:
1013
name: nginx-replica
1114
spec:
1215
containers:
13-
- name: nginx-replica
14-
image: nginx:1.12.1
16+
- name: nginx-replica
17+
image: nginx:1.12.1
1518
imagePullPolicy: IfNotPresent
1619
ports:
1720
- containerPort: 80

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/grafana.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
apiVersion: extensions/v1beta1
1+
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: monitoring-grafana
55
namespace: kube-system
66
spec:
77
replicas: 1
8+
selector:
9+
matchLabels:
10+
task: monitoring
11+
k8s-app: grafana
812
template:
913
metadata:
1014
labels:

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/heapster-rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
kind: ClusterRoleBinding
2-
apiVersion: rbac.authorization.k8s.io/v1beta1
2+
apiVersion: rbac.authorization.k8s.io/v1
33
metadata:
44
name: heapster
55
roleRef:

02-path-working-with-clusters/201-cluster-monitoring/templates/heapster/heapster.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ metadata:
44
name: heapster
55
namespace: kube-system
66
---
7-
apiVersion: extensions/v1beta1
7+
apiVersion: apps/v1
88
kind: Deployment
99
metadata:
1010
name: heapster
1111
namespace: kube-system
1212
spec:
1313
replicas: 1
14+
selector:
15+
matchLabels:
16+
task: monitoring
17+
k8s-app: heapster
1418
template:
1519
metadata:
1620
labels:

0 commit comments

Comments
 (0)