File tree Expand file tree Collapse file tree 9 files changed +273
-0
lines changed
Expand file tree Collapse file tree 9 files changed +273
-0
lines changed Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : ConfigMap
3+ metadata :
4+ name : cryptoexchangeapi-config
5+ namespace : default
6+ data :
7+ server.port : " 1927"
8+ spring.data.mongodb.host : " mongodb"
9+ spring.data.mongodb.port : " 27017"
10+ spring.data.mongodb.database : " cryptoexchangedatabase"
11+
12+ CMC_BASE_URL : " https://pro-api.coinmarketcap.com"
13+ CMC_CACHE_TTL : " 10000"
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : cryptoexchangeapi
5+ namespace : default
6+ spec :
7+ replicas : 1
8+ selector :
9+ matchLabels :
10+ app : cryptoexchangeapi
11+ template :
12+ metadata :
13+ labels :
14+ app : cryptoexchangeapi
15+ spec :
16+ containers :
17+ - name : cryptoexchangeapi
18+ image : noyandocker/cryptoexchangeapi:latest
19+ ports :
20+ - containerPort : 1133
21+ envFrom :
22+ - configMapRef :
23+ name : cryptoexchangeapi-config
24+ - secretRef :
25+ name : cryptoexchangeapi-secrets
26+ volumeMounts :
27+ - name : cryptoexchangeapi-data
28+ mountPath : /data/logs
29+ # Optional health checks (you enabled management endpoints)
30+ livenessProbe :
31+ httpGet :
32+ path : /actuator/health/liveness
33+ port : 1927
34+ initialDelaySeconds : 20
35+ periodSeconds : 10
36+ readinessProbe :
37+ httpGet :
38+ path : /actuator/health/readiness
39+ port : 1927
40+ initialDelaySeconds : 10
41+ periodSeconds : 10
42+ volumes :
43+ - name : cryptoexchangeapi-data
44+ emptyDir : {}
45+ ---
46+ apiVersion : v1
47+ kind : Service
48+ metadata :
49+ name : cryptoexchangeapi-service
50+ namespace : default
51+ spec :
52+ selector :
53+ app : cryptoexchangeapi
54+ ports :
55+ - protocol : TCP
56+ port : 1927
57+ targetPort : 1927
58+ type : NodePort
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Secret
3+ metadata :
4+ name : cryptoexchangeapi-secrets
5+ namespace : default
6+ type : Opaque
7+ stringData :
8+ CMC_API_KEY : " ODRiZDBmOGQtZmFjNy00MGZkLThiMTktZWEwMTJhYzUwMDNl"
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : grafana
5+ spec :
6+ replicas : 1
7+ selector :
8+ matchLabels :
9+ app : grafana
10+ template :
11+ metadata :
12+ labels :
13+ app : grafana
14+ spec :
15+ containers :
16+ - name : grafana
17+ image : grafana/grafana-oss:latest
18+ ports :
19+ - containerPort : 3000
20+ env :
21+ - name : GF_SECURITY_ADMIN_PASSWORD
22+ valueFrom :
23+ secretKeyRef :
24+ name : grafana-secret
25+ key : GF_SECURITY_ADMIN_PASSWORD
26+ ---
27+ apiVersion : v1
28+ kind : Service
29+ metadata :
30+ name : grafana-service
31+ spec :
32+ selector :
33+ app : grafana
34+ ports :
35+ - protocol : TCP
36+ port : 3000
37+ targetPort : 3000
38+ type : NodePort
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : Secret
3+ metadata :
4+ name : grafana-secret
5+ namespace : default
6+ type : Opaque
7+ data :
8+ GF_SECURITY_ADMIN_PASSWORD : YWRtaW4= # Base64 encoded password (admin)
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : PersistentVolume
3+ metadata :
4+ name : mongodb-pv
5+ namespace : default
6+ spec :
7+ capacity :
8+ storage : 5Gi
9+ accessModes :
10+ - ReadWriteOnce
11+ hostPath :
12+ path : /data/mongodb
13+
14+ ---
15+
16+ apiVersion : v1
17+ kind : PersistentVolumeClaim
18+ metadata :
19+ name : mongodb-pvc
20+ namespace : default
21+ spec :
22+ accessModes :
23+ - ReadWriteOnce
24+ resources :
25+ requests :
26+ storage : 5Gi
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : StatefulSet
3+ metadata :
4+ name : mongodb
5+ namespace : default
6+ spec :
7+ serviceName : mongodb
8+ replicas : 1
9+ selector :
10+ matchLabels :
11+ app : mongodb
12+ template :
13+ metadata :
14+ labels :
15+ app : mongodb
16+ spec :
17+ containers :
18+ - name : mongodb
19+ image : mongo:latest
20+ ports :
21+ - containerPort : 27017
22+ volumeMounts :
23+ - name : mongodb-data
24+ mountPath : /data/db
25+ volumeClaimTemplates :
26+ - metadata :
27+ name : mongodb-data
28+ spec :
29+ accessModes : [ "ReadWriteOnce" ]
30+ resources :
31+ requests :
32+ storage : 5Gi
33+
34+ ---
35+
36+ apiVersion : v1
37+ kind : Service
38+ metadata :
39+ name : mongodb
40+ namespace : default
41+ labels :
42+ app : mongodb
43+ spec :
44+ ports :
45+ - name : mongo
46+ port : 27017
47+ targetPort : 27017
48+ clusterIP : None # Headless service for StatefulSet
49+ selector :
50+ app : mongodb
Original file line number Diff line number Diff line change 1+ apiVersion : v1
2+ kind : ConfigMap
3+ metadata :
4+ name : prometheus-config
5+ namespace : default
6+ data :
7+ prometheus.yml : |
8+ global:
9+ scrape_interval: 120s # By default, scrape targets every 15 seconds.
10+ evaluation_interval: 120s # By default, evaluate rules every 15 seconds.
11+
12+ # A scrape configuration containing exactly one endpoint to scrape:
13+ # Here it's Prometheus itself.
14+ scrape_configs:
15+ # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
16+ - job_name: 'prometheus'
17+ # Override the global default and scrape targets from this job every 5 seconds.
18+ scrape_interval: 5s
19+ # metrics_path defaults to '/metrics'
20+ # scheme defaults to 'http'.
21+ static_configs:
22+ - targets: ['prometheus-service.default.svc.cluster.local:9090']
23+
24+ - job_name: 'Spring Boot Application input'
25+ metrics_path: '/actuator/prometheus'
26+ scrape_interval: 2s
27+ static_configs:
28+ - targets: ['cryptoexchangeapi-service.default.svc.cluster.local:1927']
29+ labels:
30+ application: 'Crypto Exchange Api'
Original file line number Diff line number Diff line change 1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : prometheus
5+ spec :
6+ replicas : 1
7+ selector :
8+ matchLabels :
9+ app : prometheus
10+ template :
11+ metadata :
12+ labels :
13+ app : prometheus
14+ spec :
15+ containers :
16+ - name : prometheus
17+ image : prom/prometheus:latest
18+ args :
19+ - ' --config.file=/etc/prometheus/prometheus.yml'
20+ ports :
21+ - containerPort : 9090
22+ volumeMounts :
23+ - name : prometheus-config
24+ mountPath : /etc/prometheus/prometheus.yml
25+ subPath : prometheus.yml # Ensure only the file is mounted
26+ volumes :
27+ - name : prometheus-config
28+ configMap :
29+ name : prometheus-config
30+ ---
31+ apiVersion : v1
32+ kind : Service
33+ metadata :
34+ name : prometheus-service
35+ spec :
36+ selector :
37+ app : prometheus
38+ ports :
39+ - protocol : TCP
40+ port : 9090
41+ targetPort : 9090
42+ type : NodePort
You can’t perform that action at this time.
0 commit comments