Skip to content

Commit 7b1e358

Browse files
committed
feature: working helm chart
1 parent e2dc8e1 commit 7b1e358

10 files changed

+134
-0
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Excluding all hidden terraform files
2+
*.terraform*
3+
# Excluding terraform state files
4+
*terraform.tfstate*
5+
6+
#Exclude MacOS garbage
7+
*.DS_Store
8+
9+
#Exclude SSH keys
10+
*.pem

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ This repository contains all necessary resources and configurations to deploy an
66
## File Structure
77
```
88
├── .github/workflows/
9+
├── helm-charts
910
├── PR_descriptions/
1011
├── screenshots/
1112
├── .gitignore
@@ -19,6 +20,8 @@ This repository contains all necessary resources and configurations to deploy an
1920

2021
- **```.github/workflows/```**:
2122
This directory is a special folder in a GitHub repository that contains YAML files defining GitHub Actions workflows.
23+
- **```helm-charts/```**:
24+
This directory contains Helm chart configurations for deploying and managing applications on Kubernetes.
2225
- **```PR_descriptions/```**:
2326
This directory contains the descriptions for Pull Request.
2427
- **```screenshots/```**:

helm-charts/wordpress/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# wordpress/Chart.yaml
2+
apiVersion: v2
3+
name: wordpress
4+
description: A basic Helm chart for WordPress with MariaDB
5+
version: 0.1.0
6+
appVersion: "latest"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# wordpress/templates/deployment-mariadb.yaml
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: mariadb
6+
namespace: wordpress
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: mariadb
12+
template:
13+
metadata:
14+
labels:
15+
app: mariadb
16+
spec:
17+
containers:
18+
- name: mariadb
19+
image: "{{ .Values.mariadb.image.repository }}:{{ .Values.mariadb.image.tag }}"
20+
imagePullPolicy: {{ .Values.mariadb.image.pullPolicy }}
21+
env:
22+
- name: MYSQL_DATABASE
23+
value: "{{ .Values.mariadb.db.name }}"
24+
- name: MYSQL_USER
25+
value: "{{ .Values.mariadb.db.user }}"
26+
- name: MYSQL_PASSWORD
27+
value: "{{ .Values.mariadb.db.password }}"
28+
- name: MYSQL_ROOT_PASSWORD
29+
value: "{{ .Values.mariadb.db.rootPassword }}"
30+
ports:
31+
- containerPort: 3306
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# wordpress/templates/deployment-wordpress.yaml
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: wordpress
6+
namespace: wordpress
7+
spec:
8+
replicas: {{ .Values.wordpress.replicaCount }}
9+
selector:
10+
matchLabels:
11+
app: wordpress
12+
template:
13+
metadata:
14+
labels:
15+
app: wordpress
16+
spec:
17+
containers:
18+
- name: wordpress
19+
image: "{{ .Values.wordpress.image.repository }}:{{ .Values.wordpress.image.tag }}"
20+
imagePullPolicy: {{ .Values.wordpress.image.pullPolicy }}
21+
ports:
22+
- containerPort: 80
23+
env:
24+
- name: WORDPRESS_DB_HOST
25+
value: "mariadb" # MariaDB service name
26+
- name: WORDPRESS_DB_NAME
27+
value: "{{ .Values.mariadb.db.name }}"
28+
- name: WORDPRESS_DB_USER
29+
value: "{{ .Values.mariadb.db.user }}"
30+
- name: WORDPRESS_DB_PASSWORD
31+
value: "{{ .Values.mariadb.db.password }}"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# wordpress/templates/service-mariadb.yaml
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: mariadb
6+
namespace: wordpress
7+
spec:
8+
ports:
9+
- port: 3306
10+
targetPort: 3306
11+
selector:
12+
app: mariadb
13+
type: ClusterIP
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# wordpress/templates/service-wordpress.yaml
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: wordpress
6+
namespace: wordpress
7+
spec:
8+
type: {{ .Values.wordpress.service.type }}
9+
ports:
10+
- port: {{ .Values.wordpress.service.port }}
11+
ports:
12+
- port: 80
13+
targetPort: 80
14+
nodePort: 32001
15+
selector:
16+
app: wordpress

helm-charts/wordpress/values.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# wordpress/values.yaml
2+
wordpress:
3+
replicaCount: 1
4+
image:
5+
repository: wordpress
6+
tag: latest
7+
pullPolicy: IfNotPresent
8+
service:
9+
type: NodePort
10+
port: 32001
11+
12+
mariadb:
13+
image:
14+
repository: mariadb
15+
tag: latest
16+
pullPolicy: IfNotPresent
17+
service:
18+
type: NodePort
19+
port: 8080
20+
db:
21+
name: wordpress
22+
user: wpuser
23+
password: wppassword
24+
rootPassword: rootpassword

helm-charts/wordpress/wordpress-deployment.yaml

Whitespace-only changes.

helm-charts/wordpress/wordpress-service.yaml

Whitespace-only changes.

0 commit comments

Comments
 (0)