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 25, 2024
1 parent 4a21683 commit 582f263
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
Empty file added helm-charts/README.md
Empty file.
23 changes: 23 additions & 0 deletions kubernetes/ecom-hpa.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ecom-hpa
labels:
app: ecom-web
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ecom-web
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
resources:
requests:
cpu: 200m
6 changes: 6 additions & 0 deletions kubernetes/feature-toggle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: ecom-web-config
data:
FEATURE_DARK_MODE: "true"
6 changes: 6 additions & 0 deletions kubernetes/local-storage-class.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer
53 changes: 53 additions & 0 deletions kubernetes/mariadb-depl-pvc.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

0 comments on commit 582f263

Please sign in to comment.