Added pull notifactions service
This commit is contained in:
1 parent
61351bcd7d
commit
0168841e00
3 files changed
+101
No files matched your search
@@ -0,0 +1,72 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: backend-pull-notifications
|
||||||
|
namespace: app-notifications
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: backend-pull-notifications
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: backend-pull-notifications
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: ghcr-secret
|
||||||
|
initContainers:
|
||||||
|
- name: wait-for-mysql
|
||||||
|
image: busybox
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
until nslookup mysql.app-notifications.svc.cluster.local; do
|
||||||
|
echo "Waiting for MySQL DNS..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
until nc -z mysql.app-notifications.svc.cluster.local 3306; do
|
||||||
|
echo "Waiting for MySQL..."
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "MySQL is available"
|
||||||
|
- name: copy-secrets
|
||||||
|
image: busybox
|
||||||
|
command:
|
||||||
|
- sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
for f in /secrets/*; do
|
||||||
|
cp "$f" /etc/secrets/
|
||||||
|
chmod 666 "/etc/secrets/$(basename $f)"
|
||||||
|
done
|
||||||
|
volumeMounts:
|
||||||
|
- name: backend-pull-notifications-secrets
|
||||||
|
mountPath: /secrets
|
||||||
|
- name: writable-secrets
|
||||||
|
mountPath: /etc/secrets
|
||||||
|
containers:
|
||||||
|
- name: backend-pull-notifications
|
||||||
|
image: ghcr.io/gansejunge/app-notifications-backend-pull-notifications:1
|
||||||
|
ports:
|
||||||
|
- containerPort: 8101
|
||||||
|
env:
|
||||||
|
- name: RMQ_HOST
|
||||||
|
value: "rabbitmq.app-notifications.svc.cluster.local"
|
||||||
|
- name: DB_HOST
|
||||||
|
value: "mysql.app-notifications.svc.cluster.local"
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: "INFO"
|
||||||
|
volumeMounts:
|
||||||
|
- name: writable-secrets
|
||||||
|
mountPath: /etc/secrets
|
||||||
|
volumes:
|
||||||
|
- name: backend-pull-notifications-secrets
|
||||||
|
secret:
|
||||||
|
secretName: backend-pull-notifications
|
||||||
|
- name: writable-secrets
|
||||||
|
emptyDir: {}
|
||||||
|
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: backend-pull-notifications
|
||||||
|
namespace: app-notifications
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: backend-pull-notifications
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 8101
|
||||||
|
targetPort: 8101
|
||||||
|
name: fastapi
|
||||||
|
type: ClusterIP
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: backend-pull-notifications-prometheus-metrics
|
||||||
|
namespace: app-notifications
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: backend-pull-notifications
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 9000
|
||||||
|
targetPort: 9000
|
||||||
|
nodePort: 30905
|
||||||
|
name: prometheus-metrics
|
||||||
|
type: NodePort
|
||||||
Reference in new issue
Block a user