add vault secrets and fix still poiting to election
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 3m14s
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 3m14s
This commit is contained in:
12
deploy/base/app-secret.yaml
Normal file
12
deploy/base/app-secret.yaml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: secrets.hashicorp.com/v1beta1
|
||||||
|
kind: HCPStaticSecret
|
||||||
|
metadata:
|
||||||
|
name: taskarr-ap
|
||||||
|
spec:
|
||||||
|
method: GET
|
||||||
|
mount: secret
|
||||||
|
path: taskarr/app
|
||||||
|
destination:
|
||||||
|
name: taskarr-app
|
||||||
|
create: true
|
||||||
|
refreshAfter: 1h
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
apiVersion: cert-manager.io/v1
|
apiVersion: cert-manager.io/v1
|
||||||
kind: Certificate
|
kind: Certificate
|
||||||
metadata:
|
metadata:
|
||||||
name: election-tls
|
name: taskarr-tls
|
||||||
namespace: vhsmp
|
|
||||||
spec:
|
spec:
|
||||||
secretName: election-tls
|
secretName: taskarr-tls
|
||||||
issuerRef:
|
issuerRef:
|
||||||
name: letsencrypt-prod
|
name: letsencrypt-prod
|
||||||
kind: ClusterIssuer
|
kind: ClusterIssuer
|
||||||
|
|||||||
13
deploy/base/database-secret.yaml
Normal file
13
deploy/base/database-secret.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: secrets.hashicorp.com/v1beta1
|
||||||
|
kind: HCPStaticSecret
|
||||||
|
metadata:
|
||||||
|
name: taskarr-db
|
||||||
|
spec:
|
||||||
|
method: GET
|
||||||
|
mount: secret
|
||||||
|
path: taskarr/db
|
||||||
|
destination:
|
||||||
|
name: taskarr-db
|
||||||
|
create: true
|
||||||
|
refreshAfter: 1h
|
||||||
|
|
||||||
@@ -2,14 +2,13 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: election
|
name: taskarr
|
||||||
namespace: vhsmp
|
|
||||||
labels:
|
labels:
|
||||||
app: election
|
app: taskarr
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: election
|
app: taskarr
|
||||||
replicas: 1
|
replicas: 1
|
||||||
strategy:
|
strategy:
|
||||||
rollingUpdate:
|
rollingUpdate:
|
||||||
@@ -19,13 +18,13 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
annotations:
|
annotations:
|
||||||
kubectl.kubernetes.io/default-container: election
|
kubectl.kubernetes.io/default-container: taskarr
|
||||||
labels:
|
labels:
|
||||||
app: election
|
app: taskarr
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: election
|
- name: taskarr
|
||||||
image: election
|
image: main
|
||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
@@ -44,33 +43,33 @@ spec:
|
|||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
name: election
|
name: http
|
||||||
env:
|
env:
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: election
|
name: taskarr-app
|
||||||
key: DATABASE_URL
|
key: DATABASE_URL
|
||||||
- name: ORIGIN
|
- name: ORIGIN
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: election
|
name: taskarr-app
|
||||||
key: ORIGIN
|
key: ORIGIN
|
||||||
- name: BETTER_AUTH_SECRET
|
- name: BETTER_AUTH_SECRET
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: election
|
name: taskarr-app
|
||||||
key: BETTER_AUTH_SECRET
|
key: BETTER_AUTH_SECRET
|
||||||
- name: GITHUB_CLIENT_SECRET
|
- name: GITEA_CLIENT_SECRET
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: election
|
name: taskarr-app
|
||||||
key: GITHUB_CLIENT_SECRET
|
key: GITEA_CLIENT_SECRET
|
||||||
- name: GITHUB_CLIENT_ID
|
- name: GITEA_CLIENT_ID
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: election
|
name: taskarr-app
|
||||||
key: GITHUB_CLIENT_ID
|
key: GITEA_CLIENT_ID
|
||||||
|
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
apiVersion: traefik.io/v1alpha1
|
apiVersion: traefik.io/v1alpha1
|
||||||
kind: IngressRoute
|
kind: IngressRoute
|
||||||
metadata:
|
metadata:
|
||||||
name: election-ingress
|
name: taskarr-ingress
|
||||||
namespace: vhsmp
|
namespace: vhsmp
|
||||||
spec:
|
spec:
|
||||||
entryPoints:
|
entryPoints:
|
||||||
- websecure
|
- websecure
|
||||||
- web
|
- web
|
||||||
routes:
|
routes:
|
||||||
- match: Host(`election.milasholsting.dk`)
|
- match: Host(`taskarr.milasholsting.dk`)
|
||||||
kind: Rule
|
kind: Rule
|
||||||
services:
|
services:
|
||||||
- name: election
|
- name: taskarr
|
||||||
port: 3000
|
port: 3000
|
||||||
tls:
|
tls:
|
||||||
secretName: election-tls
|
secretName: taskarr-tls
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
namespace: vhsmp
|
namespace: taskarr
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ./deployment.yaml
|
- ./deployment.yaml
|
||||||
@@ -11,3 +11,5 @@ resources:
|
|||||||
- ./postgres-service.yaml
|
- ./postgres-service.yaml
|
||||||
- ./postgres-storage.yaml
|
- ./postgres-storage.yaml
|
||||||
- ./postgres.yaml
|
- ./postgres.yaml
|
||||||
|
- ./database-secret.yaml
|
||||||
|
- ./app-secret.yaml
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
kind: Job
|
kind: Job
|
||||||
metadata:
|
metadata:
|
||||||
name: election-migration
|
name: taskarr-migration
|
||||||
annotations:
|
annotations:
|
||||||
# 1. Tells Argo this is a hook to run during sync
|
# 1. Tells Argo this is a hook to run during sync
|
||||||
argocd.argoproj.io/hook: Sync
|
argocd.argoproj.io/hook: Sync
|
||||||
@@ -13,17 +13,17 @@ metadata:
|
|||||||
# 3. Deletes the job after it succeeds so it can run again next time
|
# 3. Deletes the job after it succeeds so it can run again next time
|
||||||
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
|
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
|
||||||
labels:
|
labels:
|
||||||
app: election-migration
|
app: taskarr-migration
|
||||||
spec:
|
spec:
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
name: election-migration
|
name: taskarr-migration
|
||||||
labels:
|
labels:
|
||||||
app: election-migration
|
app: taskarr-migration
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: election-migration
|
- name: taskarr-migrator
|
||||||
image: election-migration
|
image: migrator
|
||||||
env:
|
env:
|
||||||
- name: DATABASE_URL
|
- name: DATABASE_URL
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|||||||
@@ -19,11 +19,20 @@ spec:
|
|||||||
- containerPort: 5432
|
- containerPort: 5432
|
||||||
env:
|
env:
|
||||||
- name: POSTGRES_DB
|
- name: POSTGRES_DB
|
||||||
value: mydatabase
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: taskarr-db
|
||||||
|
key: DATABASE
|
||||||
- name: POSTGRES_USER
|
- name: POSTGRES_USER
|
||||||
value: user123
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: taskarr-db
|
||||||
|
key: USER
|
||||||
- name: POSTGRES_PASSWORD
|
- name: POSTGRES_PASSWORD
|
||||||
value: password123 # In production, use a Secret!
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: taskarr-db
|
||||||
|
key: PASSWORD
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /var/lib/postgresql
|
- mountPath: /var/lib/postgresql
|
||||||
name: postgredb
|
name: postgredb
|
||||||
|
|||||||
@@ -2,14 +2,13 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: election
|
name: taskarr
|
||||||
namespace: vhsmp
|
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
app: election
|
app: taskarr
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
- name: election
|
- name: taskarr
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
port: 3000
|
port: 3000
|
||||||
targetPort: 3000
|
targetPort: 3000
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: election # Must match the name in base/
|
name: taskarr # Must match the name in base/
|
||||||
spec:
|
spec:
|
||||||
replicas: 2 # Scale up for production
|
replicas: 2 # Scale up for production
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: election # This name must match base EXACTLY
|
- name: main # This name must match base EXACTLY
|
||||||
ports: # Adding this back into the patch solves the diff
|
ports: # Adding this back into the patch solves the diff
|
||||||
- containerPort: 3000
|
- containerPort: 3000
|
||||||
name: election
|
name: taskarr
|
||||||
# Production-specific resource limits
|
# Production-specific resource limits
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
|
|||||||
@@ -10,15 +10,15 @@ patches:
|
|||||||
- path: deployment.yaml
|
- path: deployment.yaml
|
||||||
target:
|
target:
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
name: election
|
name: taskarr
|
||||||
|
|
||||||
# 4. Change the namespace for this overlay
|
# 4. Change the namespace for this overlay
|
||||||
namespace: vhsmp
|
namespace: taskarr
|
||||||
|
|
||||||
images:
|
images:
|
||||||
- name: election
|
- name: main
|
||||||
newName: reg.milasholsting.dk/vhsmp/election
|
newName: reg.milasholsting.dk/taskarr/taskarr
|
||||||
newTag: sha-6017ea9
|
newTag: latest
|
||||||
- name: election-migration
|
- name: migrator
|
||||||
newName: reg.milasholsting.dk/vhsmp/election-migrator
|
newName: reg.milasholsting.dk/taskarr/migrator
|
||||||
newTag: sha-6017ea9
|
newTag: latest
|
||||||
|
|||||||
Reference in New Issue
Block a user