remove separate db deployment
This commit is contained in:
@@ -6,7 +6,7 @@ metadata:
|
|||||||
namespace: default
|
namespace: default
|
||||||
data:
|
data:
|
||||||
SEMAPHORE_DB_USER: "semaphore"
|
SEMAPHORE_DB_USER: "semaphore"
|
||||||
SEMAPHORE_DB_HOST: "semaphore-db-service"
|
SEMAPHORE_DB_HOST: "localhost"
|
||||||
SEMAPHORE_DB_PORT: "3306"
|
SEMAPHORE_DB_PORT: "3306"
|
||||||
SEMAPHORE_DB_DIALECT: "mysql"
|
SEMAPHORE_DB_DIALECT: "mysql"
|
||||||
SEMAPHORE_DB: "semaphore"
|
SEMAPHORE_DB: "semaphore"
|
||||||
|
|||||||
@@ -1,39 +0,0 @@
|
|||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: semaphore-db
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: semaphore-db
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: semaphore-db
|
|
||||||
spec:
|
|
||||||
containers:
|
|
||||||
- name: mysql
|
|
||||||
image: mysql:8.4
|
|
||||||
ports:
|
|
||||||
- containerPort: 3306
|
|
||||||
env:
|
|
||||||
- name: MYSQL_RANDOM_ROOT_PASSWORD
|
|
||||||
value: "'yes'"
|
|
||||||
- name: MYSQL_DATABASE
|
|
||||||
value: "semaphore"
|
|
||||||
- name: MYSQL_USER
|
|
||||||
value: "semaphore"
|
|
||||||
- name: MYSQL_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: semaphore-secrets
|
|
||||||
key: mysql_password
|
|
||||||
volumeMounts:
|
|
||||||
- name: db
|
|
||||||
mountPath: /var/lib/mysql
|
|
||||||
volumes:
|
|
||||||
- name: db
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: longhorn-semaphore
|
|
||||||
@@ -13,17 +13,3 @@ spec:
|
|||||||
targetPort: 3000
|
targetPort: 3000
|
||||||
nodePort: 3002
|
nodePort: 3002
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
|
|
||||||
---
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: semaphore-db-service
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: semaphore-db
|
|
||||||
ports:
|
|
||||||
- protocol: TCP
|
|
||||||
port: 3306
|
|
||||||
targetPort: 3306
|
|
||||||
|
|||||||
@@ -15,16 +15,26 @@ spec:
|
|||||||
app: semaphore
|
app: semaphore
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-for-db
|
- name: mysql
|
||||||
image: busybox
|
image: mysql:8.4
|
||||||
command:
|
restartPolicy: Always
|
||||||
- sh
|
ports:
|
||||||
- -c
|
- containerPort: 3306
|
||||||
- |
|
env:
|
||||||
until nc -z -v -w30 semaphore-db-service 3306; do
|
- name: MYSQL_RANDOM_ROOT_PASSWORD
|
||||||
echo "Waiting for database to be ready..."
|
value: "'yes'"
|
||||||
sleep 2
|
- name: MYSQL_DATABASE
|
||||||
done
|
value: "semaphore"
|
||||||
|
- name: MYSQL_USER
|
||||||
|
value: "semaphore"
|
||||||
|
- name: MYSQL_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: semaphore-secrets
|
||||||
|
key: mysql_password
|
||||||
|
volumeMounts:
|
||||||
|
- name: db
|
||||||
|
mountPath: /var/lib/mysql
|
||||||
containers:
|
containers:
|
||||||
- name: semaphore
|
- name: semaphore
|
||||||
image: public.ecr.aws/semaphore/pro/server:v2.14.8
|
image: public.ecr.aws/semaphore/pro/server:v2.14.8
|
||||||
@@ -49,3 +59,7 @@ spec:
|
|||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: semaphore-secrets
|
name: semaphore-secrets
|
||||||
key: key
|
key: key
|
||||||
|
volumes:
|
||||||
|
- name: db
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: longhorn-semaphore
|
||||||
|
|||||||
Reference in New Issue
Block a user