File tree Expand file tree Collapse file tree 10 files changed +96
-55
lines changed Expand file tree Collapse file tree 10 files changed +96
-55
lines changed Original file line number Diff line number Diff line change 8181 git add helm/values.yaml
8282 git commit -m "Update image tag to ${{ inputs.image-tag || github.sha }}" || exit 0
8383 git push https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
84-
84+
85+ - name : Deploy ArgoCD Applications
86+ if : ${{ inputs.terraform-action == 'apply' || inputs.terraform-action == '' }}
87+ run : |
88+ kubectl apply -f ./argocd/application.yml
89+
8590 - name : Get Application URL
8691 run : |
8792 echo "Application URL: http://$(kubectl get svc solar-system-svc -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')"
Original file line number Diff line number Diff line change @@ -24,14 +24,18 @@ jobs:
2424 with :
2525 terraform_version : 1.5.7
2626
27- - name : Delete LoadBalancer Services
27+ - name : Update kubeconfig
28+ run : aws eks update-kubeconfig --name otel-cluster --region us-east-1
29+
30+ - name : Delete Monitoring Stack
2831 run : |
29- aws eks update-kubeconfig --name otel-cluster --region us-east-1 || true
32+ kubectl delete application kube-prometheus-stack -n argocd || true
33+ kubectl delete namespace monitoring || true
3034
35+ - name : Uninstall ArgoCD
36+ run : |
3137 helm uninstall argocd -n argocd || true
32-
33- kubectl delete svc argocd-server -n argocd || true
34- kubectl delete svc solar-system-svc -n default || true
38+ kubectl delete namespace argocd || true
3539
3640 - name : Terraform Init
3741 run : terraform init
Original file line number Diff line number Diff line change @@ -76,11 +76,13 @@ jobs:
7676 run : |
7777 kubectl create namespace monitoring --dry-run=client -o yaml | kubectl apply -f -
7878 kubectl create secret generic grafana-admin-secret \
79+ --from-literal=admin-user=admin \
7980 --from-literal=admin-password='${{ secrets.GRAFANA_ADMIN_PASSWORD }}' \
8081 --namespace monitoring \
8182 --dry-run=client -o yaml | kubectl apply -f -
8283
8384 - name : Deploy Monitoring
8485 if : ${{ inputs.terraform-action == 'apply' || inputs.terraform-action == '' }}
8586 run : |
86- kubectl apply -f ./argocd/monitoring-stack.yaml
87+ kubectl apply -f ./argocd/monitoring.yml
88+
Original file line number Diff line number Diff line change 1+ apiVersion : argoproj.io/v1alpha1
2+ kind : Application
3+ metadata :
4+ name : my-app
5+ namespace : argocd
6+ spec :
7+ project : default
8+ source :
9+ repoURL : ' https://github.com/KarimZakzouk/Graduation-Project-Devops'
10+ targetRevision : main
11+ path : helm
12+ helm :
13+ valueFiles :
14+ - values.yaml
15+ parameters :
16+ - name : mongo.uri
17+ value : <secret>
18+ - name : mongo.username
19+ value : <secret>
20+ - name : mongo.password
21+ value : <secret>
22+ destination :
23+ server : https://kubernetes.default.svc
24+ namespace : my-app-namespace
25+ syncPolicy :
26+ automated :
27+ prune : true
28+ selfHeal : true
Original file line number Diff line number Diff line change 1010 chart : kube-prometheus-stack
1111 targetRevision : " 45.7.1"
1212 helm :
13+ skipCrds : false
1314 values : |
15+ crds:
16+ enabled: true # Enable CRD installation
1417 prometheus:
1518 service:
1619 type: LoadBalancer
3134 prune : true
3235 selfHeal : true
3336 syncOptions :
34- - CreateNamespace=true
37+ - CreateNamespace=true
38+ - ServerSideApply=true
39+ - SkipDryRunOnMissingResource=true
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Secret
3+ metadata :
4+ name : mongo-secrets
5+ namespace : {{ .Release.Namespace }}
6+ type : Opaque
7+ stringData :
8+ MONGO_URI : {{ .Values.mongo.uri }}
9+ MONGO_USERNAME : {{ .Values.mongo.username }}
10+ MONGO_PASSWORD : {{ .Values.mongo.password }}
11+ env :
12+ - name : MONGO_URI
13+ valueFrom :
14+ secretKeyRef :
15+ name : mongo-secrets
16+ key : MONGO_URI
17+ - name : MONGO_USERNAME
18+ valueFrom :
19+ secretKeyRef :
20+ name : mongo-secrets
21+ key : MONGO_USERNAME
22+ - name : MONGO_PASSWORD
23+ valueFrom :
24+ secretKeyRef :
25+ name : mongo-secrets
26+ key : MONGO_PASSWORD
Original file line number Diff line number Diff line change 1+ apiVersion : monitoring.coreos.com/v1
2+ kind : ServiceMonitor
3+ metadata :
4+ name : {{ .Release.Name }}-monitor
5+ namespace : monitoring
6+ spec :
7+ selector :
8+ matchLabels :
9+ app : {{ .Release.Name }}
10+ endpoints :
11+ - port : http
12+ path : /metrics
13+ interval : 30s
Original file line number Diff line number Diff line change 99 type : LoadBalancer
1010 port : 80
1111 targetPort : 3000
12+
13+ mongo :
14+ uri : " YOUR_URI"
15+ username : " YOUR_USERNAME"
16+ password : " YOUR_PASSWORD"
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments