diff --git a/pod.yaml b/pod.yaml index c5eb91f9..5b7b1efd 100644 --- a/pod.yaml +++ b/pod.yaml @@ -1,16 +1,12 @@ -apiVersion: v1beta3 +apiVersion: v1 kind: Pod metadata: + name: nginx labels: name: nginx - name: nginx - namespace: default spec: containers: - - image: nginx - imagePullPolicy: IfNotPresent - name: nginx + - name: nginx + image: nginx ports: - containerPort: 80 - protocol: TCP - restartPolicy: Always \ No newline at end of file diff --git a/replication.yaml b/replication.yaml index 6692777a..6eff0b9b 100644 --- a/replication.yaml +++ b/replication.yaml @@ -1,8 +1,7 @@ -apiVersion: v1beta3 +apiVersion: v1 kind: ReplicationController metadata: name: nginx - namespace: default spec: replicas: 3 selector: @@ -14,10 +13,7 @@ spec: app: nginx spec: containers: - - image: nginx - imagePullPolicy: IfNotPresent - name: nginx + - name: nginx + image: nginx ports: - containerPort: 80 - protocol: TCP - restartPolicy: Always diff --git a/simple-yaml.md b/simple-yaml.md index 7bae2b78..602007ea 100644 --- a/simple-yaml.md +++ b/simple-yaml.md @@ -15,22 +15,18 @@ kubectl create -f pod.yaml Where pod.yaml contains something like: ```yaml -apiVersion: v1beta3 +apiVersion: v1 kind: Pod metadata: + name: nginx labels: app: nginx - name: nginx - namespace: default spec: containers: - - image: nginx - imagePullPolicy: IfNotPresent - name: nginx + - name: nginx + image: nginx ports: - containerPort: 80 - protocol: TCP - restartPolicy: Always ``` You can see your cluster's pods: @@ -58,11 +54,10 @@ kubectl create -f replication.yaml Where ```replication.yaml``` contains: ```yaml -apiVersion: v1beta3 +apiVersion: v1 kind: ReplicationController metadata: name: nginx - namespace: default spec: replicas: 3 selector: @@ -74,13 +69,10 @@ spec: app: nginx spec: containers: - - image: nginx - imagePullPolicy: IfNotPresent - name: nginx + - name: nginx + image: nginx ports: - containerPort: 80 - protocol: TCP - restartPolicy: Always ``` To delete the replication controller (and the pods it created):