Skip to content

Instantly share code, notes, and snippets.

@zaggash
Last active May 24, 2024 15:19
Show Gist options
  • Save zaggash/b4c2de482202ce507a1ad4b0fb83a677 to your computer and use it in GitHub Desktop.
Save zaggash/b4c2de482202ce507a1ad4b0fb83a677 to your computer and use it in GitHub Desktop.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mysql
namespace: default
spec:
selector:
matchLabels:
app: mysql
serviceName: mysql
replicas: 1
template:
metadata:
labels:
app: mysql
spec:
terminationGracePeriodSeconds: 10
containers:
- name: mysql
image: mysql:8
ports:
- containerPort: 3306
name: mysql
env:
- name: MYSQL_ROOT_PASSWORD
value: "testing1234"
- name: MYSQL_DATABASE
value: "test"
volumeMounts:
- mountPath: /var/lib/mysql
name: mysql-vol
volumeClaimTemplates:
- metadata:
name: mysql-vol
namespace: default
spec:
storageClassName: longhorn
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment