Skip to content

Commit 64d5f19

Browse files
committed
eks deployment
1 parent 1a8301f commit 64d5f19

1 file changed

Lines changed: 125 additions & 0 deletions

File tree

deploy/eks-deployment.yaml

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# This file contains the Kubernetes deployment configuration for the Copilot Usage Advanced Dashboard
2+
3+
# --- elasticsearch ---
4+
apiVersion: apps/v1
5+
kind: Deployment
6+
metadata:
7+
name: copilot-elasticsearch
8+
namespace: default
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
app: elasticsearch
14+
template:
15+
metadata:
16+
labels:
17+
app: elasticsearch
18+
spec:
19+
securityContext:
20+
runAsUser: 1000
21+
fsGroup: 1000
22+
containers:
23+
- name: elasticsearch
24+
image: ghcr.io/satomic/copilot-usage-advanced-dashboard/elastic-search:main
25+
ports:
26+
- containerPort: 9200
27+
volumeMounts:
28+
- name: elasticsearch
29+
mountPath: /usr/share/elasticsearch/data
30+
subPath: data
31+
- name: elasticsearch
32+
mountPath: /usr/share/elasticsearch/log
33+
subPath: logs
34+
resources:
35+
requests:
36+
cpu: "1"
37+
memory: "2Gi"
38+
limits:
39+
cpu: "2"
40+
memory: "4Gi"
41+
livenessProbe:
42+
httpGet:
43+
path: /_cluster/health
44+
port: 9200
45+
initialDelaySeconds: 30
46+
periodSeconds: 10
47+
readinessProbe:
48+
httpGet:
49+
path: /_cluster/health
50+
port: 9200
51+
initialDelaySeconds: 10
52+
periodSeconds: 10
53+
volumes:
54+
- name: elasticsearch
55+
emptyDir: {}
56+
57+
---
58+
59+
# --- elasticsearch service ----
60+
61+
apiVersion: v1
62+
kind: Service
63+
metadata:
64+
name: elasticsearch
65+
namespace: default
66+
spec:
67+
selector:
68+
app: elasticsearch
69+
ports:
70+
- name: http
71+
port: 9200
72+
targetPort: 9200
73+
74+
---
75+
76+
# --- cronjob which pull data from github api, please also create secret for cronjob deployment github-pat ----
77+
78+
79+
apiVersion: batch/v1
80+
kind: CronJob
81+
metadata:
82+
name: cpuad-updater
83+
spec:
84+
schedule: "*/12 * * * *" # every 12 hour
85+
jobTemplate:
86+
spec:
87+
template:
88+
spec:
89+
securityContext:
90+
runAsUser: 1000
91+
fsGroup: 1000
92+
containers:
93+
- name: cpuad-updater
94+
image: ghcr.io/satomic/copilot-usage-advanced-dashboard/cpuad-updater:main
95+
envFrom:
96+
- secretRef:
97+
name: github-pat
98+
env:
99+
- name: ORGANIZATION_SLUGS
100+
value: "name of the ORGANIZATION_SLUGS"
101+
- name: ELASTICSEARCH_URL
102+
value: "http://elasticsearch:9200"
103+
- name: LOG_PATH
104+
value: "logs"
105+
- name: EXECUTION_INTERVAL
106+
value: "6"
107+
volumeMounts:
108+
- name: cpuad-updater-logs
109+
mountPath: /app/logs
110+
subPath: cpuad
111+
resources:
112+
requests:
113+
cpu: "0.5"
114+
memory: "512Mi"
115+
limits:
116+
cpu: "1"
117+
memory: "1Gi"
118+
securityContext:
119+
runAsUser: 1000 # match your app user if needed
120+
runAsGroup: 3000 # optional
121+
allowPrivilegeEscalation: false
122+
restartPolicy: OnFailure
123+
volumes:
124+
- name: cpuad-updater-logs
125+
emptyDir: {}

0 commit comments

Comments
 (0)