Commit a3191350 authored by daidekun's avatar daidekun

init

parent 76195719
apiVersion: v1
kind: Service
metadata:
name: redpacket-mysql
labels:
app: redpacket
spec:
ports:
- port: 3306
selector:
app: redpacket
tier: mysql
clusterIP: None
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mysql-pv-claim
# annotations:
# volume.beta.kubernetes.io/storage-class: qingcloud-storageclass
labels:
app: redpacket
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redpacket-mysql
labels:
app: redpacket
spec:
strategy:
type: Recreate
template:
metadata:
labels:
app: redpacket
tier: mysql
spec:
containers:
- image: dockerhub.qingcloud.com/mysql:5.6
name: mysql
env:
# $ kubectl create secret generic mysql-pass --from-file=password.txt
# make sure password.txt does not have a trailing newline
- name: MYSQL_ROOT_PASSWORD
value: Quantgroup2017
ports:
- containerPort: 3306
name: mysql
volumeMounts:
- name: mysql-persistent-storage
mountPath: /var/lib/mysql
volumes:
- name: mysql-persistent-storage
persistentVolumeClaim:
claimName: mysql-pv-claim
\ No newline at end of file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: redpacket-server-deployment
spec:
replicas: 1 # tells deployment to run 2 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: redpacket
spec:
containers:
- name: redpacket-server
image: 192.168.4.36:5000/redpacket/redpacket
ports:
- containerPort: 8080
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment