Skip to content

Commit add9154

Browse files
committed
add openshift template
Signed-off-by: Rafa Porres Molina <[email protected]>
1 parent b15ebe3 commit add9154

File tree

2 files changed

+116
-1
lines changed

2 files changed

+116
-1
lines changed

app.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
export PROMETHEUS_MULTIPROC_DIR=$(mktemp -d)
44
trap "rm -rf $PROMETHEUS_MULTIPROC_DIR" INT TERM EXIT
55
export UVICORN_HOST="0.0.0.0"
6-
exec uvicorn python gitlab_project_exporter/main.py
6+
exec python gitlab_project_exporter/main.py

openshift/deploy.yaml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
apiVersion: v1
2+
kind: Template
3+
metadata:
4+
name: gitlab-project-exporter
5+
objects:
6+
- apiVersion: v1
7+
kind: ServiceAccount
8+
metadata:
9+
name: ${NAME}
10+
- apiVersion: apps/v1
11+
kind: Deployment
12+
metadata:
13+
annotations:
14+
ignore-check.kube-linter.io/minimum-three-replicas: "multiple replicas is multiple cost"
15+
ignore-check.kube-linter.io/unset-cpu-requirements: "no cpu limits"
16+
labels:
17+
app: ${NAME}
18+
name: ${NAME}
19+
spec:
20+
replicas: ${{REPLICAS}}
21+
selector:
22+
matchLabels:
23+
app: ${NAME}
24+
template:
25+
metadata:
26+
labels:
27+
app: ${NAME}
28+
spec:
29+
serviceAccountName: ${NAME}
30+
containers:
31+
- name: gitlab-project-exporter
32+
image: ${IMAGE}:${IMAGE_TAG}
33+
ports:
34+
- containerPort: 8080
35+
name: http
36+
protocol: TCP
37+
env:
38+
- name: GITLAB_TOKEN
39+
valueFrom:
40+
secretKeyRef:
41+
name: ${SECRET_NAME}
42+
key: ${SECRET_KEY}
43+
- name: PROJECT_IDS
44+
value: '${PROJECT_IDS}'
45+
- name: GITLAB_URL
46+
value: ${GITLAB_URL}
47+
- name: LOG_LEVEL
48+
value: ${LOG_LEVEL}
49+
resources:
50+
limits:
51+
memory: ${MEMORY_LIMITS}
52+
requests:
53+
cpu: ${CPU_REQUESTS}
54+
memory: ${MEMORY_REQUESTS}
55+
readinessProbe:
56+
failureThreshold: 3
57+
periodSeconds: 10
58+
successThreshold: 1
59+
httpGet:
60+
path: /healthz
61+
port: http
62+
scheme: HTTP
63+
timeoutSeconds: 1
64+
initialDelaySeconds: 10
65+
livenessProbe:
66+
failureThreshold: 3
67+
periodSeconds: 10
68+
successThreshold: 1
69+
httpGet:
70+
path: /healthz
71+
port: http
72+
scheme: HTTP
73+
timeoutSeconds: 1
74+
initialDelaySeconds: 10
75+
- apiVersion: v1
76+
kind: Service
77+
metadata:
78+
labels:
79+
app: ${NAME}
80+
name: ${NAME}
81+
spec:
82+
selector:
83+
app: ${NAME}
84+
ports:
85+
- name: http
86+
protocol: TCP
87+
port: 8080
88+
targetPort: 8080
89+
type: ClusterIP
90+
parameters:
91+
- name: NAME
92+
value: gitlab-project-exporter
93+
- name: IMAGE
94+
value: quay.io/redhat-services-prod/app-sre-tenant/gitlab-project-exporter-main/gitlab-project-exporter-main
95+
- name: IMAGE_TAG
96+
value: latest
97+
- name: REPLICAS
98+
value: "1"
99+
- name: SECRET_NAME
100+
value: gitlab-token
101+
- name: SECRET_KEY
102+
value: gitlab-token
103+
- name: GITLAB_URL
104+
value: https://gitlab.cee.redhat.com
105+
- name: PROJECT_IDS
106+
description: gitlab project ids
107+
required: true
108+
- name: LOG_LEVEL
109+
value: INFO
110+
- name: CPU_REQUESTS
111+
value: 50m
112+
- name: MEMORY_LIMITS
113+
value: 150Mi
114+
- name: MEMORY_REQUESTS
115+
value: 150Mi

0 commit comments

Comments
 (0)