checkpoint 2 part 1 finished, needs to be properly tested
This commit is contained in:
parent
ce3ea05831
commit
c3f67d4582
14 changed files with 306 additions and 26 deletions
42
roles/mysql_deploy/templates/mysql-deployment.yml
Normal file
42
roles/mysql_deploy/templates/mysql-deployment.yml
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
# Deployment for MySQL
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mysql-deployment
|
||||
labels:
|
||||
app: mysql
|
||||
tier: database
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mysql
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mysql
|
||||
tier: database
|
||||
spec:
|
||||
containers:
|
||||
- name: mysql
|
||||
image: mysql:latest
|
||||
env: # The variables below could be set on a ConfigMap object
|
||||
- name: MYSQL_ALLOW_EMPTY_PASSWORD
|
||||
value: "true"
|
||||
- name: MYSQL_DATABASE
|
||||
value: laravelio
|
||||
- name: MYSQL_USER
|
||||
value: laraveliouser
|
||||
- name: MYSQL_PASSWORD
|
||||
value: "123456" # Use Secret object in real usage
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
volumeMounts:
|
||||
- name: mysql-persistent-storage
|
||||
mountPath: /var/lib/mysql
|
||||
volumes:
|
||||
- name: mysql-persistent-storage
|
||||
persistentVolumeClaim:
|
||||
claimName: mysql-pv-claim
|
13
roles/mysql_deploy/templates/mysql-pvc.yml
Normal file
13
roles/mysql_deploy/templates/mysql-pvc.yml
Normal file
|
@ -0,0 +1,13 @@
|
|||
---
|
||||
# Persistent Volume Claim for MySQL pod
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mysql-pv-claim
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: local-storage
|
||||
resources:
|
||||
requests:
|
||||
storage: 20Gi
|
16
roles/mysql_deploy/templates/mysql-service.yml
Normal file
16
roles/mysql_deploy/templates/mysql-service.yml
Normal file
|
@ -0,0 +1,16 @@
|
|||
---
|
||||
# Service for exposing MySQL
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mysql-service # logical name of the service, which will also become the DNS name of the service when it is created.
|
||||
labels:
|
||||
app: mysql
|
||||
tier: database
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: mysql
|
||||
ports:
|
||||
- targetPort: 3306 # port that containers are listening on
|
||||
port: 3306 # port number exposed internally in the cluster
|
Loading…
Add table
Add a link
Reference in a new issue