Deploy the StatefulSet
Learn how to deploy the StatefulSet
We'll cover the following...
Now that we have a StorageClass and a headless Service, we can deploy the StatefulSet.
Example
The following YAML is from the sts.yml
file and defines the StatefulSet.
Press + to interact
apiVersion: apps/v1kind: StatefulSetmetadata:name: tkb-stsspec:replicas: 3selector:matchLabels:app: webserviceName: "dullahan"template:metadata:labels:app: webspec:terminationGracePeriodSeconds: 10containers:- name: ctr-webimage: nginx:latestports:- containerPort: 80name: webvolumeMounts:- name: webrootmountPath: /usr/share/nginx/htmlvolumeClaimTemplates:- metadata:name: webrootspec:accessModes: [ "ReadWriteOnce" ]storageClassName: "flash"resources:requests:storage: 10Gi
There’s a lot to take in, so let’s step through the important parts.
The ...
Access this course and 1400+ top-rated courses and projects.