From c18468dde5e45ebfc84bf3ae785414f6349e4ec8 Mon Sep 17 00:00:00 2001 From: Zahid Date: Fri, 17 Jul 2026 21:26:51 -0700 Subject: [PATCH] inital commit --- mysql-chart/Chart.yaml | 4 +++ mysql-chart/templates/secret.yaml | 7 +++++ mysql-chart/templates/service.yaml | 8 ++++++ mysql-chart/templates/statefulset.yaml | 36 ++++++++++++++++++++++++++ mysql-chart/values.yaml | 12 +++++++++ nginx-chart/Chart.yaml | 6 +++++ nginx-chart/templates/deployment.yaml | 18 +++++++++++++ nginx-chart/templates/service.yaml | 8 ++++++ nginx-chart/values.yaml | 13 ++++++++++ 9 files changed, 112 insertions(+) create mode 100644 mysql-chart/Chart.yaml create mode 100644 mysql-chart/templates/secret.yaml create mode 100644 mysql-chart/templates/service.yaml create mode 100644 mysql-chart/templates/statefulset.yaml create mode 100644 mysql-chart/values.yaml create mode 100644 nginx-chart/Chart.yaml create mode 100644 nginx-chart/templates/deployment.yaml create mode 100644 nginx-chart/templates/service.yaml create mode 100644 nginx-chart/values.yaml diff --git a/mysql-chart/Chart.yaml b/mysql-chart/Chart.yaml new file mode 100644 index 0000000..42dd07a --- /dev/null +++ b/mysql-chart/Chart.yaml @@ -0,0 +1,4 @@ +apiVersion: v2 +name: mysql-chart +version: 1.0.0 +type: application diff --git a/mysql-chart/templates/secret.yaml b/mysql-chart/templates/secret.yaml new file mode 100644 index 0000000..0f5113b --- /dev/null +++ b/mysql-chart/templates/secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: {name: mysql-secret} +type: Opaque +stringData: + MYSQL_ROOT_PASSWORD: {{ .Values.mysql.rootPassword }} + MYSQL_PASSWORD: {{ .Values.mysql.password }} diff --git a/mysql-chart/templates/service.yaml b/mysql-chart/templates/service.yaml new file mode 100644 index 0000000..50eec15 --- /dev/null +++ b/mysql-chart/templates/service.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Service +metadata: {name: mysql} +spec: + clusterIP: None + selector: {app: mysql} + ports: + - port: 3306 diff --git a/mysql-chart/templates/statefulset.yaml b/mysql-chart/templates/statefulset.yaml new file mode 100644 index 0000000..a498d38 --- /dev/null +++ b/mysql-chart/templates/statefulset.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: {name: mysql} +namespace: {{ .Values.namespace }} +spec: + serviceName: mysql + replicas: 1 + selector: + matchLabels: {app: mysql} + template: + metadata: + labels: {app: mysql} + spec: + containers: + - name: mysql + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + env: + - name: MYSQL_DATABASE + value: {{ .Values.mysql.database }} + - name: MYSQL_USER + value: {{ .Values.mysql.username }} + - name: MYSQL_PASSWORD + valueFrom: {secretKeyRef: {name: mysql-secret,key: MYSQL_PASSWORD}} + - name: MYSQL_ROOT_PASSWORD + valueFrom: {secretKeyRef: {name: mysql-secret,key: MYSQL_ROOT_PASSWORD}} + volumeMounts: + - name: mysql-data + mountPath: /var/lib/mysql + volumeClaimTemplates: + - metadata: {name: mysql-data} + spec: + accessModes: ["ReadWriteOnce"] + storageClassName: {{ .Values.storage.storageClass }} + resources: + requests: + storage: {{ .Values.storage.size }} diff --git a/mysql-chart/values.yaml b/mysql-chart/values.yaml new file mode 100644 index 0000000..4cf7754 --- /dev/null +++ b/mysql-chart/values.yaml @@ -0,0 +1,12 @@ +namespace: prod +image: + repository: mysql + tag: "8.4" +mysql: + database: demo + username: demo + password: demo123 + rootPassword: root123 +storage: + storageClass: nfs-client + size: 20Gi diff --git a/nginx-chart/Chart.yaml b/nginx-chart/Chart.yaml new file mode 100644 index 0000000..61042bd --- /dev/null +++ b/nginx-chart/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: v2 +name: nginx-chart +description: Production NGINX +type: application +version: 1.0.0 +appVersion: "1.27" diff --git a/nginx-chart/templates/deployment.yaml b/nginx-chart/templates/deployment.yaml new file mode 100644 index 0000000..5b4a74a --- /dev/null +++ b/nginx-chart/templates/deployment.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "nginx-chart.fullname" . }} + namespace: {{ .Values.namespace }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: {app: nginx} + template: + metadata: + labels: {app: nginx} + spec: + containers: + - name: nginx + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + ports: + - containerPort: 80 diff --git a/nginx-chart/templates/service.yaml b/nginx-chart/templates/service.yaml new file mode 100644 index 0000000..437f851 --- /dev/null +++ b/nginx-chart/templates/service.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: Service +metadata: {name: nginx} +spec: + selector: {app: nginx} + ports: + - port: 80 + targetPort: 80 diff --git a/nginx-chart/values.yaml b/nginx-chart/values.yaml new file mode 100644 index 0000000..a9d31cf --- /dev/null +++ b/nginx-chart/values.yaml @@ -0,0 +1,13 @@ +replicaCount: 1 +namespace: prod +image: + repository: nginx + tag: latest + pullPolicy: IfNotPresent +service: + type: ClusterIP + port: 80 +ingress: + enabled: true + className: traefik + host: nginx.demo.local