kind: StatefulSet
apiVersion: apps/v1
metadata:
name: his-mysql
namespace: his
labels:
app: his-mysql
annotations:
kubesphere.io/creator: dev-zhao
kubesphere.io/description: mysql应用
spec:
replicas: 1
selector:
matchLabels:
app: his-mysql
template:
metadata:
creationTimestamp: null
labels:
app: his-mysql
annotations:
cni.projectcalico.org/ipv4pools: '["default-ipv4-ippool"]'
logging.kubesphere.io/logsidecar-config: '{}'
spec:
volumes:
- name: host-time
hostPath:
path: /etc/localtime
type: ''
- name: volume-fynj86
persistentVolumeClaim:
claimName: mysql-pvc
- name: volume-7hkeyp
configMap:
name: mysql-conf
defaultMode: 420
containers:
- name: container-jyt8q2
image: 'mysql:5.7.35'
ports:
- name: tcp-3306
containerPort: 3306
protocol: TCP
- name: tcp-33060
containerPort: 33060
protocol: TCP
env:
- name: MYSQL_ROOT_PASSWORD
value: '123456'
resources:
limits:
cpu: 100m
memory: 40Mi
volumeMounts:
- name: host-time
readOnly: true
mountPath: /etc/localtime
- name: volume-fynj86
mountPath: /var/lib/mysql
- name: volume-7hkeyp
readOnly: true
mountPath: /etc/mysql/conf.d
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
serviceAccountName: default
serviceAccount: default
securityContext: {}
affinity: {}
schedulerName: default-scheduler
serviceName: his-mysql-qlu9
podManagementPolicy: OrderedReady
updateStrategy:
type: RollingUpdate
rollingUpdate:
partition: 0
revisionHistoryLimit: 10
标签:his,name,default,kubesphere,MySQL,volume,mysql,kubersphere,安装
From: https://www.cnblogs.com/netflix/p/16601074.html