diff --git a/cassandra/cassandra-statefulset.yaml b/cassandra/cassandra-statefulset.yaml index 060c15798..9b40a7971 100644 --- a/cassandra/cassandra-statefulset.yaml +++ b/cassandra/cassandra-statefulset.yaml @@ -1,4 +1,4 @@ -apiVersion: "apps/v1" # for versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use apps/v1beta1 +apiVersion: "apps/v1" # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: StatefulSet metadata: name: cassandra diff --git a/guestbook/all-in-one/frontend.yaml b/guestbook/all-in-one/frontend.yaml index edcaa5c5d..38a79267c 100644 --- a/guestbook/all-in-one/frontend.yaml +++ b/guestbook/all-in-one/frontend.yaml @@ -15,11 +15,15 @@ spec: app: guestbook tier: frontend --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: frontend spec: + selector: + matchLabels: + app: guestbook + tier: frontend replicas: 3 template: metadata: diff --git a/guestbook/all-in-one/guestbook-all-in-one.yaml b/guestbook/all-in-one/guestbook-all-in-one.yaml index a3415d6a9..b08136701 100644 --- a/guestbook/all-in-one/guestbook-all-in-one.yaml +++ b/guestbook/all-in-one/guestbook-all-in-one.yaml @@ -15,11 +15,16 @@ spec: tier: backend role: master --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: redis-master spec: + selector: + matchLabels: + app: redis + role: master + tier: backend replicas: 1 template: metadata: @@ -54,11 +59,16 @@ spec: tier: backend role: slave --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: redis-slave spec: + selector: + matchLabels: + app: redis + role: slave + tier: backend replicas: 2 template: metadata: @@ -102,11 +112,15 @@ spec: app: guestbook tier: frontend --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: frontend spec: + selector: + matchLabels: + app: guestbook + tier: frontend replicas: 3 template: metadata: diff --git a/guestbook/all-in-one/redis-slave.yaml b/guestbook/all-in-one/redis-slave.yaml index c076b084c..43381e2c6 100644 --- a/guestbook/all-in-one/redis-slave.yaml +++ b/guestbook/all-in-one/redis-slave.yaml @@ -14,11 +14,16 @@ spec: role: slave tier: backend --- -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: redis-slave spec: + selector: + matchLabels: + app: redis + role: slave + tier: backend replicas: 2 template: metadata: diff --git a/guestbook/frontend-deployment.yaml b/guestbook/frontend-deployment.yaml index 97f8791f2..2b08cc9de 100644 --- a/guestbook/frontend-deployment.yaml +++ b/guestbook/frontend-deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: frontend diff --git a/guestbook/redis-master-deployment.yaml b/guestbook/redis-master-deployment.yaml index 831f8af2b..8d4701c04 100644 --- a/guestbook/redis-master-deployment.yaml +++ b/guestbook/redis-master-deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: redis-master diff --git a/guestbook/redis-slave-deployment.yaml b/guestbook/redis-slave-deployment.yaml index 6def77697..e674f1d44 100644 --- a/guestbook/redis-slave-deployment.yaml +++ b/guestbook/redis-slave-deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: redis-slave diff --git a/mysql-wordpress-pd/mysql-deployment.yaml b/mysql-wordpress-pd/mysql-deployment.yaml index 8b92b76f5..4344cea54 100644 --- a/mysql-wordpress-pd/mysql-deployment.yaml +++ b/mysql-wordpress-pd/mysql-deployment.yaml @@ -25,7 +25,7 @@ spec: requests: storage: 20Gi --- -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: wordpress-mysql diff --git a/mysql-wordpress-pd/wordpress-deployment.yaml b/mysql-wordpress-pd/wordpress-deployment.yaml index d89847421..8b0f39746 100644 --- a/mysql-wordpress-pd/wordpress-deployment.yaml +++ b/mysql-wordpress-pd/wordpress-deployment.yaml @@ -25,7 +25,7 @@ spec: requests: storage: 20Gi --- -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: wordpress diff --git a/staging/cockroachdb/cockroachdb-statefulset.yaml b/staging/cockroachdb/cockroachdb-statefulset.yaml index 3dfdcf6da..0aa8328d8 100644 --- a/staging/cockroachdb/cockroachdb-statefulset.yaml +++ b/staging/cockroachdb/cockroachdb-statefulset.yaml @@ -66,7 +66,7 @@ spec: app: cockroachdb minAvailable: 67% --- -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use apps/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: StatefulSet metadata: name: cockroachdb diff --git a/staging/newrelic/README.md b/staging/newrelic/README.md index ed7d22824..eaa94015c 100644 --- a/staging/newrelic/README.md +++ b/staging/newrelic/README.md @@ -70,7 +70,7 @@ The DaemonSet definition instructs Kubernetes to place a newrelic sysmond agent ```yaml -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: DaemonSet metadata: name: newrelic-agent @@ -79,6 +79,9 @@ metadata: app: newrelic-agent version: v1 spec: + selector: + matchLabels: + name: newrelic template: metadata: labels: diff --git a/staging/newrelic/newrelic-daemonset.yaml b/staging/newrelic/newrelic-daemonset.yaml index 2679fe61e..854fb6ace 100644 --- a/staging/newrelic/newrelic-daemonset.yaml +++ b/staging/newrelic/newrelic-daemonset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: DaemonSet metadata: name: newrelic-agent diff --git a/staging/openshift-origin/etcd-controller.yaml b/staging/openshift-origin/etcd-controller.yaml index 1a056afcd..e4674fb91 100644 --- a/staging/openshift-origin/etcd-controller.yaml +++ b/staging/openshift-origin/etcd-controller.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: etcd diff --git a/staging/openshift-origin/etcd-discovery-controller.yaml b/staging/openshift-origin/etcd-discovery-controller.yaml index e70f088b4..2238c3bb6 100644 --- a/staging/openshift-origin/etcd-discovery-controller.yaml +++ b/staging/openshift-origin/etcd-discovery-controller.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: etcd-discovery diff --git a/staging/openshift-origin/openshift-controller.yaml b/staging/openshift-origin/openshift-controller.yaml index 25723372b..6446c779c 100644 --- a/staging/openshift-origin/openshift-controller.yaml +++ b/staging/openshift-origin/openshift-controller.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: labels: diff --git a/staging/storage/hazelcast/README.md b/staging/storage/hazelcast/README.md index e62b7a765..5340fd895 100644 --- a/staging/storage/hazelcast/README.md +++ b/staging/storage/hazelcast/README.md @@ -72,13 +72,16 @@ Deployments will "adopt" existing pods that match their selector query, so let's ```yaml -apiVersion: extensions/v1beta1 +apiVersion: "apps/v1" # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: hazelcast labels: name: hazelcast -spec: +spec: + selector: + matchLabels: + name: hazelcast template: metadata: labels: diff --git a/staging/storage/hazelcast/hazelcast-deployment.yaml b/staging/storage/hazelcast/hazelcast-deployment.yaml index 4b6c610ec..89740e1b7 100644 --- a/staging/storage/hazelcast/hazelcast-deployment.yaml +++ b/staging/storage/hazelcast/hazelcast-deployment.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: hazelcast diff --git a/staging/storage/minio/README.md b/staging/storage/minio/README.md index 79055ca63..12117bbf6 100644 --- a/staging/storage/minio/README.md +++ b/staging/storage/minio/README.md @@ -88,12 +88,15 @@ A deployment encapsulates replica sets and pods — so, if a pod goes down, This is the deployment description. ```sh -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: # This name uniquely identifies the Deployment name: minio-deployment spec: + selector: + matchLabels: + app: minio strategy: type: Recreate template: @@ -237,7 +240,7 @@ A StatefulSet provides a deterministic name and a unique identity to each pod, m This is the Statefulset description. ```sh -# for versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use apps/v1beta1 +# for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 apiVersion: apps/v1 kind: StatefulSet metadata: diff --git a/staging/storage/minio/minio-distributed-statefulset.yaml b/staging/storage/minio/minio-distributed-statefulset.yaml index e8289303f..33ef25d56 100644 --- a/staging/storage/minio/minio-distributed-statefulset.yaml +++ b/staging/storage/minio/minio-distributed-statefulset.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use apps/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: StatefulSet metadata: name: minio diff --git a/staging/storage/minio/minio-standalone-deployment.yaml b/staging/storage/minio/minio-standalone-deployment.yaml index c6cd6d5ae..f868d1233 100644 --- a/staging/storage/minio/minio-standalone-deployment.yaml +++ b/staging/storage/minio/minio-standalone-deployment.yaml @@ -1,9 +1,12 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: # This name uniquely identifies the Deployment name: minio-deployment spec: + selector: + matchLabels: + app: minio strategy: type: Recreate template: diff --git a/staging/sysdig-cloud/sysdig-daemonset.yaml b/staging/sysdig-cloud/sysdig-daemonset.yaml index ebee9d4b2..5f2ce1d49 100644 --- a/staging/sysdig-cloud/sysdig-daemonset.yaml +++ b/staging/sysdig-cloud/sysdig-daemonset.yaml @@ -1,6 +1,6 @@ #Use this sysdig.yaml when Daemon Sets are enabled on Kubernetes (minimum version 1.1.1). Otherwise use the RC method. -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 +apiVersion: apps/v1 #for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: DaemonSet metadata: name: sysdig-agent diff --git a/staging/volumes/vsphere/README.md b/staging/volumes/vsphere/README.md index 5cb2b6156..f6429fceb 100644 --- a/staging/volumes/vsphere/README.md +++ b/staging/volumes/vsphere/README.md @@ -633,7 +633,7 @@ vSphere volumes can be consumed by Stateful Sets. selector: app: nginx --- - # for versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use apps/v1beta1 + # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 apiVersion:apps/v1 kind: StatefulSet metadata: diff --git a/staging/volumes/vsphere/deployment.yaml b/staging/volumes/vsphere/deployment.yaml index 1ea779b8a..5609e3bbc 100644 --- a/staging/volumes/vsphere/deployment.yaml +++ b/staging/volumes/vsphere/deployment.yaml @@ -1,8 +1,11 @@ -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: Deployment metadata: name: deployment spec: + selector: + matchLabels: + app: redis replicas: 1 template: metadata: diff --git a/staging/volumes/vsphere/simple-statefulset.yaml b/staging/volumes/vsphere/simple-statefulset.yaml index d9441849d..05a207fdc 100644 --- a/staging/volumes/vsphere/simple-statefulset.yaml +++ b/staging/volumes/vsphere/simple-statefulset.yaml @@ -13,7 +13,7 @@ spec: selector: app: nginx --- -apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use apps/v1beta1 +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 kind: StatefulSet metadata: name: web