blob: 469bcc80b8af8108806ab91b579af3d63e4f1cca [file] [log] [blame]
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +04001apiVersion: v1
2kind: Service
3metadata:
4 name: url-shortener
5 namespace: {{ .Release.Namespace }}
6spec:
7 type: ClusterIP
8 selector:
9 app: url-shortener
10 ports:
Giorgi Lekveishvili06a67912025-04-20 15:56:03 +040011 - name: http
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040012 protocol: TCP
Giorgi Lekveishvili06a67912025-04-20 15:56:03 +040013 port: {{ .Values.port }}
14 targetPort: http
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040015---
16apiVersion: apps/v1
17kind: Deployment
18metadata:
19 name: url-shortener
20 namespace: {{ .Release.Namespace }}
21spec:
22 replicas: 1
23 selector:
24 matchLabels:
25 app: url-shortener
26 template:
27 metadata:
28 labels:
29 app: url-shortener
30 spec:
31 containers:
32 - name: url-shortener
33 image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
34 ports:
Giorgi Lekveishvili06a67912025-04-20 15:56:03 +040035 - name: http
36 containerPort: {{ .Values.port }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040037 protocol: TCP
38 command:
39 - url-shortener
Giorgi Lekveishvili06a67912025-04-20 15:56:03 +040040 - --port={{ .Values.port }}
Giorgi Lekveishvili4ec4c022024-08-17 15:09:24 +040041 - --db-path=/data/urls.db
42 - --require-auth={{ .Values.requireAuth }}
43 volumeMounts:
44 - name: url-shortener
45 mountPath: /data
46 volumes:
47 - name: url-shortener
48 persistentVolumeClaim:
Giorgi Lekveishvili631f9b22024-08-29 15:44:46 +040049 claimName: {{ .Values.persistentVolumeClaimName }}