diff --git a/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-deployment.yaml b/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-deployment.yaml new file mode 100644 index 0000000..ffe4c40 --- /dev/null +++ b/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-deployment.yaml @@ -0,0 +1,35 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: mysql + labels: + app: mysql +spec: + replicas: 1 + selector: + matchLabels: + app: mysql + template: + metadata: + labels: + app: mysql + spec: + containers: + - image: mysql:5.6 + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mysql + key: password + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: mysql-persistent-storage + mountPath: /var/lib/mysql + volumes: + - name: mysql-persistent-storage + persistentVolumeClaim: + claimName: mysql-volumeclaim diff --git a/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-service.yaml b/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-service.yaml new file mode 100644 index 0000000..c57bb10 --- /dev/null +++ b/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: mysql + labels: + app: mysql +spec: + type: ClusterIP + ports: + - port: 3306 + selector: + app: mysql diff --git a/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-volumeclaim.yaml b/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-volumeclaim.yaml new file mode 100644 index 0000000..c19256f --- /dev/null +++ b/Chapter_Three/Lecture_6_Lab/mysql-demo/mysql-volumeclaim.yaml @@ -0,0 +1,10 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: mysql-volumeclaim +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 200Gi diff --git a/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-deployment.yaml b/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-deployment.yaml new file mode 100644 index 0000000..5a6c82c --- /dev/null +++ b/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wordpress + labels: + app: wordpress +spec: + replicas: 1 + selector: + matchLabels: + app: wordpress + template: + metadata: + labels: + app: wordpress + spec: + containers: + - image: wordpress + name: wordpress + env: + - name: WORDPRESS_DB_HOST + value: mysql:3306 + - name: WORDPRESS_DB_PASSWORD + valueFrom: + secretKeyRef: + name: mysql + key: password + ports: + - containerPort: 80 + name: wordpress + volumeMounts: + - name: wordpress-persistent-storage + mountPath: /var/www/html + volumes: + - name: wordpress-persistent-storage + persistentVolumeClaim: + claimName: wordpress-volumeclaim diff --git a/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-service.yaml b/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-service.yaml new file mode 100644 index 0000000..a06ea62 --- /dev/null +++ b/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: wordpress + name: wordpress +spec: + type: LoadBalancer + ports: + - port: 80 + targetPort: 80 + protocol: TCP + selector: + app: wordpress diff --git a/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-volumeclaim.yaml b/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-volumeclaim.yaml new file mode 100644 index 0000000..72d8211 --- /dev/null +++ b/Chapter_Three/Lecture_6_Lab/mysql-demo/wordpress-volumeclaim.yaml @@ -0,0 +1,10 @@ +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: wordpress-volumeclaim +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 200Gi