From cb81469170d83405aab1729465ca7634e1989509 Mon Sep 17 00:00:00 2001 From: Jerome Petazzoni Date: Tue, 19 Nov 2019 06:58:49 -0600 Subject: [PATCH] Move storage class to portworx manifest --- k8s/portworx.yaml | 14 +++++++++++++- slides/k8s/portworx.md | 43 ++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/k8s/portworx.yaml b/k8s/portworx.yaml index 4a196441..c3e21d0a 100644 --- a/k8s/portworx.yaml +++ b/k8s/portworx.yaml @@ -1,5 +1,4 @@ # SOURCE: https://install.portworx.com/?kbver=1.15.2&b=true&s=/dev/loop4&c=px-workshop&stork=true&lh=true&st=k8s&mc=false -# SOURCE: https://install.portworx.com/?kbver=1.15.2&b=true&s=/dev/loop4&c=px-workshop&stork=true&lh=true&st=k8s&mc=false --- kind: Service apiVersion: v1 @@ -751,3 +750,16 @@ spec: volumes: - name: config emptyDir: {} +--- +# That one is an extra. +# Create a default Storage Class to simplify Portworx setup. +kind: StorageClass +apiVersion: storage.k8s.io/v1beta1 +metadata: + name: portworx-replicated + annotations: + storageclass.kubernetes.io/is-default-class: "true" +provisioner: kubernetes.io/portworx-volume +parameters: + repl: "2" + priority_io: "high" diff --git a/slides/k8s/portworx.md b/slides/k8s/portworx.md index a78a5d24..ac0b7abd 100644 --- a/slides/k8s/portworx.md +++ b/slides/k8s/portworx.md @@ -240,6 +240,25 @@ If you want to use an external key/value store, add one of the following: --- +## Check our default Storage Class + +- The YAML manifest applied earlier should define a default storage class + +.exercise[ + +- Check that we have a default storage class: + ```bash + kubectl get storageclass + ``` + +] + +There should be a storage class showing as `portworx-replicated (default)`. + +--- + +class: extra-details + ## Our default Storage Class This is our Storage Class (in `k8s/storage-class.yaml`): @@ -265,28 +284,6 @@ parameters: --- -## Creating our Storage Class - -- Let's apply that YAML file! - -.exercise[ - -- Create the Storage Class: - ```bash - kubectl apply -f ~/container.training/k8s/storage-class.yaml - ``` - -- Check that it is now available: - ```bash - kubectl get sc - ``` - -] - -It should show as `portworx-replicated (default)`. - ---- - ## Our Postgres Stateful set - The next slide shows `k8s/postgres.yaml` @@ -326,7 +323,7 @@ spec: schedulerName: stork containers: - name: postgres - image: postgres:10.5 + image: postgres:11 volumeMounts: - mountPath: /var/lib/postgresql/data name: postgres