├── Deployments-ReplicaSets ├── README.md └── demo-deployment.yaml ├── Ingress ├── README.md ├── nginx-a-deployment.yaml ├── nginx-a-svc.yaml ├── nginx-b-deployment.yaml ├── nginx-b-svc.yaml └── nginx-ingress.yaml ├── NFS-External-Service ├── README.md ├── layer2-config.yaml ├── nfs-server-sc.yaml ├── nfs-server-sts-ext.yaml └── nfs-server-svc-ext-lb.yaml ├── PV-PVC-POD ├── README.md ├── demo-pod.yaml ├── demo-pv.yaml └── demo-pvc.yaml ├── README.md ├── ReadWriteMany ├── README.md ├── nfs-client │ ├── nfs-client-pod-1.yaml │ ├── nfs-client-pod-2.yaml │ ├── nfs-client-pv.yaml │ └── nfs-client-pvc.yaml └── nfs-server │ ├── nfs-server-sc.yaml │ ├── nfs-server-sts.yaml │ └── nfs-server-svc.yaml ├── Services ├── README.md ├── demo-nginx-pod.yaml ├── nginx-deployment.yaml ├── nginx-service-clusterip-blank.yaml ├── nginx-service-clusterip-node-headless.yaml ├── nginx-service-loadbalancer.yaml └── nginx-service-nodeport.yaml ├── StatefulSets ├── README.md ├── cassandra-statefulset-sc-annotations.yaml ├── cassandra-statefulset-sc-spec.yaml ├── cassandra-storageclass.yaml └── headless-cassandra-service.yaml └── StorageClass ├── README.md ├── demo-sc-pod.yaml ├── demo-sc-pvc.yaml └── demo-sc.yaml /Deployments-ReplicaSets/README.md: -------------------------------------------------------------------------------- 1 | # Deployment and ReplicaSet Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the Deployment and ReplicaSets demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /Deployments-ReplicaSets/demo-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: demo-deployment 5 | labels: 6 | app: demo 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | app: demo 12 | template: 13 | metadata: 14 | labels: 15 | app: demo 16 | spec: 17 | containers: 18 | - name: demo 19 | image: "k8s.gcr.io/busybox" 20 | command: [ "sleep", "1000000" ] -------------------------------------------------------------------------------- /Ingress/README.md: -------------------------------------------------------------------------------- 1 | # Ingress Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the Ingress demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /Ingress/nginx-a-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-a-deployment 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: nginx-a 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: nginx-a 14 | spec: 15 | containers: 16 | - name: nginx-a 17 | image: harbor.rainpole.com/library/nginx-a:latest 18 | ports: 19 | - containerPort: 80 20 | -------------------------------------------------------------------------------- /Ingress/nginx-a-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nginx-a 6 | name: nginx-a 7 | spec: 8 | ports: 9 | - port: 80 10 | protocol: TCP 11 | selector: 12 | app: nginx-a 13 | sessionAffinity: None 14 | type: ClusterIP 15 | -------------------------------------------------------------------------------- /Ingress/nginx-b-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-b-deployment 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: nginx-b 9 | replicas: 1 10 | template: 11 | metadata: 12 | labels: 13 | app: nginx-b 14 | spec: 15 | containers: 16 | - name: nginx-b 17 | image: harbor.rainpole.com/library/nginx-b:latest 18 | ports: 19 | - containerPort: 80 20 | -------------------------------------------------------------------------------- /Ingress/nginx-b-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nginx-b 6 | name: nginx-b 7 | spec: 8 | ports: 9 | - port: 80 10 | protocol: TCP 11 | selector: 12 | app: nginx-b 13 | sessionAffinity: None 14 | type: ClusterIP 15 | -------------------------------------------------------------------------------- /Ingress/nginx-ingress.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: extensions/v1beta1 2 | kind: Ingress 3 | metadata: 4 | name: nginx 5 | spec: 6 | rules: 7 | - host: nginx.rainpole.com 8 | http: 9 | paths: 10 | - path: /index-a.html # This page must exist on the A server 11 | backend: 12 | serviceName: nginx-a 13 | servicePort: 80 14 | - path: /index-b.html # This page must exist on the B server 15 | backend: 16 | serviceName: nginx-b 17 | servicePort: 80 18 | -------------------------------------------------------------------------------- /NFS-External-Service/README.md: -------------------------------------------------------------------------------- 1 | # NFS Revisited Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the NFS Revisited (external service) demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /NFS-External-Service/layer2-config.yaml: -------------------------------------------------------------------------------- 1 | # Address Pool definitions for MetalLB from https://raw.githubusercontent.com/google/metallb/v0.7.3/manifests/metallb.yaml 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | namespace: metallb-system 6 | name: config 7 | data: 8 | config: | 9 | address-pools: 10 | - name: my-ip-space 11 | protocol: layer2 12 | addresses: 13 | - 10.27.51.172-10.27.51.178 14 | # Adjust address range to match available pool of local IP addresses -------------------------------------------------------------------------------- /NFS-External-Service/nfs-server-sc.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: nfs-sc 5 | provisioner: kubernetes.io/vsphere-volume 6 | parameters: 7 | diskformat: thin 8 | storagePolicyName: raid-1 9 | datastore: vsanDatastore -------------------------------------------------------------------------------- /NFS-External-Service/nfs-server-sts-ext.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: nfs-server-ext 5 | namespace: nfs 6 | labels: 7 | app: nfs-server-ext 8 | spec: 9 | serviceName: nfs-service-svc-ext 10 | replicas: 1 11 | selector: 12 | matchLabels: 13 | app: nfs-server-ext 14 | template: 15 | metadata: 16 | labels: 17 | app: nfs-server-ext 18 | spec: 19 | containers: 20 | - name: nfs-server-ext 21 | image: gcr.io/google_samples/volume-nfs:0.8 22 | ports: 23 | - name: nfs 24 | containerPort: 2049 25 | - name: mountd 26 | containerPort: 20048 27 | - name: rpcbind 28 | containerPort: 111 29 | securityContext: 30 | privileged: true 31 | volumeMounts: 32 | - name: nfs-export 33 | mountPath: /exports 34 | volumeClaimTemplates: 35 | - metadata: 36 | name: nfs-export 37 | annotations: 38 | volume.beta.kubernetes.io/storage-class: nfs-sc 39 | spec: 40 | accessModes: [ "ReadWriteOnce" ] 41 | resources: 42 | requests: 43 | storage: 5Gi 44 | -------------------------------------------------------------------------------- /NFS-External-Service/nfs-server-svc-ext-lb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nfs-server-svc-ext 6 | name: nfs-server-svc-ext 7 | namespace: nfs 8 | spec: 9 | ports: 10 | - name: nfs 11 | port: 2049 12 | - name: mountd 13 | port: 20048 14 | - name: rpcbind 15 | port: 111 16 | selector: 17 | app: nfs-server-ext 18 | type: LoadBalancer -------------------------------------------------------------------------------- /PV-PVC-POD/README.md: -------------------------------------------------------------------------------- 1 | # PV, PVC and Pod ReplicaSet Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the PV, PVC and Pod demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /PV-PVC-POD/demo-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: demo-pod 5 | spec: 6 | containers: 7 | - name: busybox 8 | image: "k8s.gcr.io/busybox" 9 | volumeMounts: 10 | - name: demo-vol 11 | mountPath: "/demo" 12 | command: [ "sleep", "1000000" ] 13 | volumes: 14 | - name: demo-vol 15 | persistentVolumeClaim: 16 | claimName: demo-pvc -------------------------------------------------------------------------------- /PV-PVC-POD/demo-pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: demo-pv 5 | spec: 6 | storageClassName: demo 7 | capacity: 8 | storage: 2Gi 9 | accessModes: 10 | - ReadWriteOnce 11 | persistentVolumeReclaimPolicy: Retain 12 | # Assumption is that this volume has been created using vSphere CLI tool (e.g. vmkfstools) 13 | vsphereVolume: 14 | volumePath: "[vsanDatastore] demo/demo.vmdk" 15 | fsType: ext4 -------------------------------------------------------------------------------- /PV-PVC-POD/demo-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: demo-pvc 5 | spec: 6 | storageClassName: demo 7 | accessModes: 8 | - ReadWriteOnce 9 | resources: 10 | requests: 11 | storage: 2Gi -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vsphere-storage-101 2 | 3 | Manifests from Kubernetes on vSphere Storage 101 blogs series published on 4 | 5 | I wrote a series of blog posts which attempted to cover many basic aspects of running Kubernetes on top of vSphere, with particular emphasis on the underlying vSphere storage. Here are the posts, along with the links to the manifest files should you wish to try these out in your own lab: 6 | 7 | 1. The basics - PVs, PVCs and Pods. Link to manifest files here. 8 | 9 | 2. StorageClass. Link to manifest files here. 10 | 11 | 3. Deployments and ReplicaSets. Link to manifest files here. 12 | 13 | 4. StatefulSets. Link to manifest files here. 14 | 15 | 5. Failure Scenarios No manifest files. 16 | 17 | 6. ReadWriteMany Volumes (e.g. NFS). Link to manifest files here. 18 | 19 | 7. NFS Revisited. Link to manifest files here. 20 | 21 | 8. Services. Link to manifest files here. 22 | 23 | 9. Ingress. Link to manifest files here. 24 | -------------------------------------------------------------------------------- /ReadWriteMany/README.md: -------------------------------------------------------------------------------- 1 | # ReadWriteMany (NFS) Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the ReadWriteMany (NFS) demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /ReadWriteMany/nfs-client/nfs-client-pod-1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nfs-client-pod-1 5 | spec: 6 | containers: 7 | - name: busybox 8 | image: "k8s.gr.io/busybox" 9 | volumeMounts: 10 | - name: nfs-vol 11 | mountPath: "/nfs" 12 | command: [ "sleep", "1000000" ] 13 | volumes: 14 | - name: nfs-vol 15 | persistentVolumeClaim: 16 | claimName: nfs-client-pvc -------------------------------------------------------------------------------- /ReadWriteMany/nfs-client/nfs-client-pod-2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: nfs-client-pod-2 5 | spec: 6 | containers: 7 | - name: busybox 8 | image: "k8s.gcr.io/busybox" 9 | volumeMounts: 10 | - name: nfs-vol 11 | mountPath: "/nfs" 12 | command: [ "sleep", "1000000" ] 13 | volumes: 14 | - name: nfs-vol 15 | persistentVolumeClaim: 16 | claimName: nfs-client-pvc -------------------------------------------------------------------------------- /ReadWriteMany/nfs-client/nfs-client-pv.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolume 3 | metadata: 4 | name: nfs-client-pv 5 | spec: 6 | storageClassName: nfs-client-sc 7 | capacity: 8 | storage: 1Gi 9 | accessModes: 10 | - ReadWriteMany 11 | nfs: 12 | # server IP address needs to be adjusted to match the clusterIP address of the service 13 | server: "10.100.200.243" 14 | path: "/exports" 15 | -------------------------------------------------------------------------------- /ReadWriteMany/nfs-client/nfs-client-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: nfs-client-pvc 5 | spec: 6 | storageClassName: nfs-client-sc 7 | accessModes: 8 | - ReadWriteMany 9 | resources: 10 | requests: 11 | storage: 1Gi -------------------------------------------------------------------------------- /ReadWriteMany/nfs-server/nfs-server-sc.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: nfs-sc 5 | provisioner: kubernetes.io/vsphere-volume 6 | # Assumption is that volume is provisioned on vSAN datastore and that storage policy called raid-1 already exists 7 | parameters: 8 | diskformat: thin 9 | storagePolicyName: raid-1 10 | datastore: vsanDatastore -------------------------------------------------------------------------------- /ReadWriteMany/nfs-server/nfs-server-sts.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: nfs-server 5 | labels: 6 | app: nfs-server 7 | spec: 8 | serviceName: nfs-service 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: nfs-server 13 | template: 14 | metadata: 15 | labels: 16 | app: nfs-server 17 | spec: 18 | containers: 19 | - name: nfs-server 20 | image: gcr.io/google_containers/volume-nfs:0.8 21 | ports: 22 | - name: nfs 23 | containerPort: 2049 24 | - name: mountd 25 | containerPort: 20048 26 | - name: rpcbind 27 | containerPort: 111 28 | securityContext: 29 | privileged: true 30 | volumeMounts: 31 | - name: nfs-export 32 | mountPath: /exports 33 | volumeClaimTemplates: 34 | - metadata: 35 | name: nfs-export 36 | annotations: 37 | volume.beta.kubernetes.io/storage-class: nfs-sc 38 | spec: 39 | accessModes: [ "ReadWriteOnce" ] 40 | resources: 41 | requests: 42 | storage: 5Gi -------------------------------------------------------------------------------- /ReadWriteMany/nfs-server/nfs-server-svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nfs-server 6 | name: nfs-server 7 | spec: 8 | selector: 9 | app: nfs-server 10 | ports: 11 | - name: nfs 12 | port: 2049 13 | - name: mountd 14 | port: 20048 15 | - name: rpcbind 16 | port: 111 17 | clusterIP: "" -------------------------------------------------------------------------------- /Services/README.md: -------------------------------------------------------------------------------- 1 | # Service Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the Service demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /Services/demo-nginx-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: demo-nginx-pod 5 | spec: 6 | containers: 7 | - name: busybox 8 | image: "k8s.gcr.io/busybox" 9 | command: [ "sleep", "1000000" ] -------------------------------------------------------------------------------- /Services/nginx-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: nginx-deployment 5 | spec: 6 | selector: 7 | matchLabels: 8 | app: nginx 9 | replicas: 2 10 | template: 11 | metadata: 12 | labels: 13 | app: nginx 14 | spec: 15 | containers: 16 | - name: nginx 17 | image: nginx:latest 18 | ports: 19 | - containerPort: 80 -------------------------------------------------------------------------------- /Services/nginx-service-clusterip-blank.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nginx 6 | name: nginx-svc 7 | spec: 8 | clusterIP: "" 9 | ports: 10 | - name: http 11 | port: 80 12 | selector: 13 | app: nginx -------------------------------------------------------------------------------- /Services/nginx-service-clusterip-node-headless.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nginx 6 | name: nginx-svc 7 | spec: 8 | clusterIP: "None" 9 | ports: 10 | - name: http 11 | port: 80 12 | selector: 13 | app: nginx -------------------------------------------------------------------------------- /Services/nginx-service-loadbalancer.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nginx 6 | name: nginx-svc 7 | spec: 8 | ports: 9 | - name: http 10 | port: 80 11 | selector: 12 | app: nginx 13 | type: LoadBalancer -------------------------------------------------------------------------------- /Services/nginx-service-nodeport.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: nginx 6 | name: nginx-svc 7 | spec: 8 | ports: 9 | - name: http 10 | port: 80 11 | selector: 12 | app: nginx 13 | type: NodePort -------------------------------------------------------------------------------- /StatefulSets/README.md: -------------------------------------------------------------------------------- 1 | # StatefulSet Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the StatefulSet demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /StatefulSets/cassandra-statefulset-sc-annotations.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: cassandra 5 | labels: 6 | app: cassandra 7 | spec: 8 | serviceName: cassandra 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: cassandra 13 | template: 14 | metadata: 15 | labels: 16 | app: cassandra 17 | spec: 18 | terminationGracePeriodSeconds: 180 19 | containers: 20 | - name: cassandra 21 | image: gcr.io/google-samples/cassandra:v11 22 | ports: 23 | - containerPort: 7000 24 | name: intra-node 25 | - containerPort: 7001 26 | name: tls-intra-node 27 | - containerPort: 7199 28 | name: jmx 29 | - containerPort: 9042 30 | name: cql 31 | resources: 32 | limits: 33 | cpu: "500m" 34 | memory: 1Gi 35 | requests: 36 | cpu: "500m" 37 | memory: 1Gi 38 | securityContext: 39 | capabilities: 40 | add: 41 | - IPC_LOCK 42 | lifecycle: 43 | preStop: 44 | exec: 45 | command: 46 | - /bin/sh 47 | - -c 48 | - nodetool drain 49 | env: 50 | - name: MAX_HEAP_SIZE 51 | value: 512M 52 | - name: HEAP_NEWSIZE 53 | value: 100M 54 | # Make sure the DNS name matches the namespace 55 | - name: CASSANDRA_SEEDS 56 | value: "cassandra-0.cassandra.default.svc.cluster.local" 57 | - name: CASSANDRA_CLUSTER_NAME 58 | value: "Demo-Cluster" 59 | - name: CASSANDRA_DC 60 | value: "Demo-DataCenter" 61 | - name: CASSANDRA_RACK 62 | value: "Demo-Rack" 63 | - name: POD_IP 64 | valueFrom: 65 | fieldRef: 66 | fieldPath: status.podIP 67 | readinessProbe: 68 | exec: 69 | command: 70 | - /bin/bash 71 | - -c 72 | - /ready-probe.sh 73 | initialDelaySeconds: 15 74 | timeoutSeconds: 5 75 | volumeMounts: 76 | - name: cassandra-data 77 | mountPath: /cassandra_data 78 | volumeClaimTemplates: 79 | - metadata: 80 | name: cassandra-data 81 | annotations: 82 | volume.beta.kubernetes.io/storage-class: demo-sts-sc 83 | spec: 84 | accessModes: [ "ReadWriteOnce" ] 85 | resources: 86 | requests: 87 | storage: 1Gi -------------------------------------------------------------------------------- /StatefulSets/cassandra-statefulset-sc-spec.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: cassandra 5 | labels: 6 | app: cassandra 7 | spec: 8 | serviceName: cassandra 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: cassandra 13 | template: 14 | metadata: 15 | labels: 16 | app: cassandra 17 | spec: 18 | terminationGracePeriodSeconds: 180 19 | containers: 20 | - name: cassandra 21 | image: gcr.io/google-samples/cassandra:v11 22 | ports: 23 | - containerPort: 7000 24 | name: intra-node 25 | - containerPort: 7001 26 | name: tls-intra-node 27 | - containerPort: 7199 28 | name: jmx 29 | - containerPort: 9042 30 | name: cql 31 | resources: 32 | limits: 33 | cpu: "500m" 34 | memory: 1Gi 35 | requests: 36 | cpu: "500m" 37 | memory: 1Gi 38 | securityContext: 39 | capabilities: 40 | add: 41 | - IPC_LOCK 42 | lifecycle: 43 | preStop: 44 | exec: 45 | command: 46 | - /bin/sh 47 | - -c 48 | - nodetool drain 49 | env: 50 | - name: MAX_HEAP_SIZE 51 | value: 512M 52 | - name: HEAP_NEWSIZE 53 | value: 100M 54 | # Make sure the DNS name matches the namespace 55 | - name: CASSANDRA_SEEDS 56 | value: "cassandra-0.cassandra.default.svc.cluster.local" 57 | - name: CASSANDRA_CLUSTER_NAME 58 | value: "Demo-Cluster" 59 | - name: CASSANDRA_DC 60 | value: "Demo-DataCenter" 61 | - name: CASSANDRA_RACK 62 | value: "Demo-Rack" 63 | - name: POD_IP 64 | valueFrom: 65 | fieldRef: 66 | fieldPath: status.podIP 67 | readinessProbe: 68 | exec: 69 | command: 70 | - /bin/bash 71 | - -c 72 | - /ready-probe.sh 73 | initialDelaySeconds: 15 74 | timeoutSeconds: 5 75 | volumeMounts: 76 | - name: cassandra-data 77 | mountPath: /cassandra_data 78 | volumeClaimTemplates: 79 | - metadata: 80 | name: cassandra-data 81 | spec: 82 | accessModes: [ "ReadWriteOnce" ] 83 | storageClassName: demo-sts-sc 84 | resources: 85 | requests: 86 | storage: 1Gi 87 | -------------------------------------------------------------------------------- /StatefulSets/cassandra-storageclass.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: demo-sts-sc 5 | provisioner: kubernetes.io/vsphere-volume 6 | # Assumption is that vSAN is providing the storage and the storage policy called gold already exists 7 | parameters: 8 | storagePolicyName: raid-1 9 | datastore: vsanDatastore 10 | -------------------------------------------------------------------------------- /StatefulSets/headless-cassandra-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | labels: 5 | app: cassandra 6 | name: cassandra 7 | spec: 8 | clusterIP: None 9 | selector: 10 | app: cassandra -------------------------------------------------------------------------------- /StorageClass/README.md: -------------------------------------------------------------------------------- 1 | # StorageClass Manifests for vsphere-storage-101 blogs 2 | 3 | These are the manifests used for the StorageClass demo. 4 | 5 | Back to main vsphere-storage-101 page. 6 | -------------------------------------------------------------------------------- /StorageClass/demo-sc-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | metadata: 4 | name: demo-sc-pod 5 | spec: 6 | containers: 7 | - name: busybox 8 | image: "k8s.gcr.io/busybox" 9 | volumeMounts: 10 | - name: demo-vol 11 | mountPath: "/demo" 12 | command: [ "sleep", "1000000" ] 13 | volumes: 14 | - name: demo-vol 15 | persistentVolumeClaim: 16 | claimName: demo-sc-pvc -------------------------------------------------------------------------------- /StorageClass/demo-sc-pvc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: PersistentVolumeClaim 3 | metadata: 4 | name: demo-sc-pvc 5 | spec: 6 | storageClassName: demo-sc-vsan 7 | accessModes: 8 | - ReadWriteOnce 9 | resources: 10 | requests: 11 | storage: 2Gi -------------------------------------------------------------------------------- /StorageClass/demo-sc.yaml: -------------------------------------------------------------------------------- 1 | kind: StorageClass 2 | apiVersion: storage.k8s.io/v1 3 | metadata: 4 | name: demo-sc-vsan 5 | provisioner: kubernetes.io/vsphere-volume 6 | # Assumption is that vSAN is providing underling datastore and a storage policy called gold has already been created in vSphere 7 | parameters: 8 | storagePolicyName: gold 9 | datastore: vsanDatastore --------------------------------------------------------------------------------