Skip to content

Commit

Permalink
kubernetes-resume-challenge
Browse files Browse the repository at this point in the history
  • Loading branch information
TomiwaAribisala-git committed Mar 21, 2024
1 parent b3ce8c3 commit 1896dd6
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 11 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ jobs:

- name: Deploy To EKS
run: |
kubectl delete -f mariadb.yml
kubectl apply -f mariadb-secret.yml
kubectl apply -f mariadb-configmap.yml
kubectl apply -f mariadb.yml
kubectl apply -f mariadb-svc.yml
kubectl apply -f ecom-web-configmap.yml
kubectl apply -f ecom-web.yml
kubectl apply -f ecom-web-svc.yml
53 changes: 53 additions & 0 deletions kubernetes/mariadb-.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: mariadb-deployment
labels:
app: mariadb
spec:
replicas: 1
selector:
matchLabels:
app: mariadb
template:
metadata:
labels:
app: mariadb
spec:
containers:
- name: mariadb
image: mariadb:latest
ports:
- containerPort: 3306
volumeMounts:
- name: mariadb-configmap-volume
mountPath: /docker-entrypoint-initdb.d
- name: mysql-data
mountPath: "/var/lib/mysql"
subPath: "mysql"
env:
- name: MARIADB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mariadb-secret
key: mariadb_root_password
- name: DB_USER
valueFrom:
secretKeyRef:
name: mariadb-secret
key: db_user
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: mariadb-secret
key: db_password
volumes:
- name: mariadb-configmap-volume
configMap:
name: mariadb-configmap
items:
- key: db-load-script.sql
path: db-load-script.sql
- name: mysql-data
persistentVolumeClaim:
claimName: mariadb-data-disk
2 changes: 1 addition & 1 deletion kubernetes/mariadb-pv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
persistentVolumeReclaimPolicy: Retain
storageClassName: local-storage
local:
path: /mnt/data
path: /mnt/data ## I am having an issue using a path in the target node
nodeAffinity:
required:
nodeSelectorTerms:
Expand Down
6 changes: 0 additions & 6 deletions kubernetes/mariadb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ spec:
volumeMounts:
- name: mariadb-configmap-volume
mountPath: /docker-entrypoint-initdb.d
- name: mysql-data
mountPath: "/var/lib/mysql"
subPath: "mysql"
env:
- name: MARIADB_ROOT_PASSWORD
valueFrom:
Expand All @@ -48,6 +45,3 @@ spec:
items:
- key: db-load-script.sql
path: db-load-script.sql
- name: mysql-data
persistentVolumeClaim:
claimName: mariadb-data-disk

0 comments on commit 1896dd6

Please sign in to comment.