Skip to content

Commit 9290f7a

Browse files
committed
feat: Rename Helm chart from devops-project-time to terraform-config
- Rename Helm chart directory from devops-project-time to terraform-config - Update ArgoCD application manifest to use new terraform-config path - Create complete Helm chart structure with proper templates: - Chart.yaml with terraform-config name - values.yaml with Docker image configuration - Kubernetes deployment, service, and serviceaccount templates - Helper templates for consistent labeling - Update CI/CD pipeline to update Helm values in terraform-config directory - This provides a cleaner, more descriptive name for the GitOps configuration
1 parent 713c8b6 commit 9290f7a

8 files changed

Lines changed: 219 additions & 6 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,18 @@ jobs:
8282
run: |
8383
docker push ${{ env.DOCKER_IMAGE }}:${{ env.SHORT_SHA }}
8484
docker push ${{ env.DOCKER_IMAGE }}:latest
85-
- name: Docker Build Summary
85+
- name: Configure Git Author
8686
run: |
87-
echo "✅ Docker images built and pushed successfully:"
88-
echo " - ${{ env.DOCKER_IMAGE }}:${{ env.SHORT_SHA }}"
89-
echo " - ${{ env.DOCKER_IMAGE }}:latest"
90-
echo " - Image ready for ArgoCD deployment"
87+
git config --local user.email "hello@ozzyi.com"
88+
git config --local user.name "ozzyi0b"
89+
90+
- name: Update Helm Chart with new image tag
91+
run: |
92+
sed -i.bak "s|tag: .*|tag: \"${{ env.SHORT_SHA }}\"|g" terraform-config/values.yaml
93+
rm terraform-config/values.yaml.bak
94+
git add terraform-config/values.yaml
95+
git commit -m "Update Helm chart with new image tag ${{ env.SHORT_SHA }}"
96+
git push
9197
9298
9399
terraform:

argocd-app.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
source:
99
repoURL: "https://github.com/ozzyib/devops-project"
1010
targetRevision: HEAD
11-
path: devops-project
11+
path: terraform-config
1212
destination:
1313
server: "https://kubernetes.default.svc"
1414
namespace: default

terraform-config/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v2
2+
name: terraform-config
3+
description: A Helm chart for DevOps Project Flask Application
4+
type: application
5+
version: 0.1.0
6+
appVersion: "1.0.0"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "terraform-config.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "terraform-config.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "terraform-config.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "terraform-config.labels" -}}
37+
helm.sh/chart: {{ include "terraform-config.chart" . }}
38+
{{ include "terraform-config.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "terraform-config.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "terraform-config.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "terraform-config.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "terraform-config.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "terraform-config.fullname" . }}
5+
labels:
6+
{{- include "terraform-config.labels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicaCount }}
10+
{{- end }}
11+
selector:
12+
matchLabels:
13+
{{- include "terraform-config.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
{{- with .Values.podAnnotations }}
17+
annotations:
18+
{{- toYaml . | nindent 8 }}
19+
{{- end }}
20+
labels:
21+
{{- include "terraform-config.selectorLabels" . | nindent 8 }}
22+
spec:
23+
{{- with .Values.imagePullSecrets }}
24+
imagePullSecrets:
25+
{{- toYaml . | nindent 8 }}
26+
{{- end }}
27+
serviceAccountName: {{ include "terraform-config.serviceAccountName" . }}
28+
securityContext:
29+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
30+
containers:
31+
- name: {{ .Chart.Name }}
32+
securityContext:
33+
{{- toYaml .Values.securityContext | nindent 12 }}
34+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
35+
imagePullPolicy: {{ .Values.image.pullPolicy }}
36+
ports:
37+
- name: http
38+
containerPort: {{ .Values.service.targetPort }}
39+
protocol: TCP
40+
livenessProbe:
41+
httpGet:
42+
path: /health
43+
port: http
44+
readinessProbe:
45+
httpGet:
46+
path: /health
47+
port: http
48+
resources:
49+
{{- toYaml .Values.resources | nindent 12 }}
50+
{{- with .Values.nodeSelector }}
51+
nodeSelector:
52+
{{- toYaml . | nindent 8 }}
53+
{{- end }}
54+
{{- with .Values.affinity }}
55+
affinity:
56+
{{- toYaml . | nindent 8 }}
57+
{{- end }}
58+
{{- with .Values.tolerations }}
59+
tolerations:
60+
{{- toYaml . | nindent 8 }}
61+
{{- end }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "terraform-config.fullname" . }}
5+
labels:
6+
{{- include "terraform-config.labels" . | nindent 4 }}
7+
spec:
8+
type: {{ .Values.service.type }}
9+
ports:
10+
- port: {{ .Values.service.port }}
11+
targetPort: http
12+
protocol: TCP
13+
name: http
14+
selector:
15+
{{- include "terraform-config.selectorLabels" . | nindent 4 }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{{- if .Values.serviceAccount.create -}}
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: {{ include "terraform-config.serviceAccountName" . }}
6+
labels:
7+
{{- include "terraform-config.labels" . | nindent 4 }}
8+
{{- with .Values.serviceAccount.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
{{- end }}

terraform-config/values.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
replicaCount: 1
2+
3+
image:
4+
repository: ozzyi/devops-project
5+
pullPolicy: IfNotPresent
6+
tag: "latest"
7+
8+
imagePullSecrets: []
9+
nameOverride: ""
10+
fullnameOverride: ""
11+
12+
serviceAccount:
13+
create: true
14+
annotations: {}
15+
name: ""
16+
17+
podAnnotations: {}
18+
19+
podSecurityContext: {}
20+
21+
securityContext: {}
22+
23+
service:
24+
type: ClusterIP
25+
port: 80
26+
targetPort: 8080
27+
28+
ingress:
29+
enabled: false
30+
className: ""
31+
annotations: {}
32+
hosts:
33+
- host: chart-example.local
34+
paths:
35+
- path: /
36+
pathType: Prefix
37+
tls: []
38+
39+
resources: {}
40+
41+
autoscaling:
42+
enabled: false
43+
minReplicas: 1
44+
maxReplicas: 100
45+
targetCPUUtilizationPercentage: 80
46+
47+
nodeSelector: {}
48+
49+
tolerations: []
50+
51+
affinity: {}

0 commit comments

Comments
 (0)