Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kube/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.sec.env
25 changes: 25 additions & 0 deletions kube/base/api_gateway/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkedout-apigw
labels:
app.kubernetes.io/name: linkedout-apigw
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: linkedout-apigw
template:
metadata:
labels:
app.kubernetes.io/name: linkedout-apigw
app.kubernetes.io/part-of: linkedout
spec:
containers:
- name: linkedout-apigw
image: ghcr.io/thomas-mauran/linkedout/api_gateway
imagePullPolicy: Always
env: []
ports:
- containerPort: 9090
name: api
16 changes: 16 additions & 0 deletions kube/base/api_gateway/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: linkedout
spec:
rules:
- host: linkedout.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: linkedout-apigw
port:
number: 9090
11 changes: 11 additions & 0 deletions kube/base/api_gateway/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: linkedout-apigw
spec:
selector:
app.kubernetes.io/name: linkedout-apigw
ports:
- protocol: TCP
port: 9090
targetPort: api
25 changes: 25 additions & 0 deletions kube/base/employer/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkedout-employer
labels:
app.kubernetes.io/name: linkedout-employer
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: linkedout-employer
template:
metadata:
labels:
app.kubernetes.io/name: linkedout-employer
app.kubernetes.io/part-of: linkedout
spec:
containers:
- name: linkedout-employer
image: ghcr.io/thomas-mauran/linkedout/employer
imagePullPolicy: Always
env: []
ports:
- containerPort: 8083
name: api
11 changes: 11 additions & 0 deletions kube/base/employer/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: linkedout-employer
spec:
selector:
app.kubernetes.io/name: linkedout-employer
ports:
- protocol: TCP
port: 9090
targetPort: api
25 changes: 25 additions & 0 deletions kube/base/jobs/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkedout-jobs
labels:
app.kubernetes.io/name: linkedout-jobs
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: linkedout-jobs
template:
metadata:
labels:
app.kubernetes.io/name: linkedout-jobs
app.kubernetes.io/part-of: linkedout
spec:
containers:
- name: linkedout-jobs
image: ghcr.io/thomas-mauran/linkedout/jobs
imagePullPolicy: Always
env: []
ports:
- containerPort: 8081
name: api
11 changes: 11 additions & 0 deletions kube/base/jobs/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: linkedout-jobs
spec:
selector:
app.kubernetes.io/name: linkedout-jobs
ports:
- protocol: TCP
port: 9090
targetPort: api
20 changes: 20 additions & 0 deletions kube/base/kustomization.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- api_gateway/deployment.yml
- api_gateway/ingress.yml
- api_gateway/svc.yml
- employer/deployment.yml
- employer/svc.yml
- jobs/deployment.yml
- jobs/svc.yml
- messaging/deployment.yml
- messaging/svc.yml
- notification/deployment.yml
- notification/svc.yml
- profile/deployment.yml
- profile/svc.yml

commonLabels:
app.kubernetes.io/part-of: linkedout
25 changes: 25 additions & 0 deletions kube/base/messaging/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkedout-messaging
labels:
app.kubernetes.io/name: linkedout-messaging
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: linkedout-messaging
template:
metadata:
labels:
app.kubernetes.io/name: linkedout-messaging
app.kubernetes.io/part-of: linkedout
spec:
containers:
- name: linkedout-messaging
image: ghcr.io/thomas-mauran/linkedout/messaging
imagePullPolicy: Always
env: []
ports:
- containerPort: 8082
name: api
11 changes: 11 additions & 0 deletions kube/base/messaging/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: linkedout-messaging
spec:
selector:
app.kubernetes.io/name: linkedout-messaging
ports:
- protocol: TCP
port: 9090
targetPort: api
25 changes: 25 additions & 0 deletions kube/base/notification/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkedout-notification
labels:
app.kubernetes.io/name: linkedout-notification
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: linkedout-notification
template:
metadata:
labels:
app.kubernetes.io/name: linkedout-notification
app.kubernetes.io/part-of: linkedout
spec:
containers:
- name: linkedout-notification
image: ghcr.io/thomas-mauran/linkedout/notification
imagePullPolicy: Always
env: []
ports:
- containerPort: 8084
name: api
11 changes: 11 additions & 0 deletions kube/base/notification/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: linkedout-notification
spec:
selector:
app.kubernetes.io/name: linkedout-notification
ports:
- protocol: TCP
port: 9090
targetPort: api
25 changes: 25 additions & 0 deletions kube/base/profile/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: linkedout-profile
labels:
app.kubernetes.io/name: linkedout-profile
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: linkedout-profile
template:
metadata:
labels:
app.kubernetes.io/name: linkedout-profile
app.kubernetes.io/part-of: linkedout
spec:
containers:
- name: linkedout-profile
image: ghcr.io/thomas-mauran/linkedout/profile
imagePullPolicy: Always
env: []
ports:
- containerPort: 8085
name: api
11 changes: 11 additions & 0 deletions kube/base/profile/svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: Service
metadata:
name: linkedout-profile
spec:
selector:
app.kubernetes.io/name: linkedout-profile
ports:
- protocol: TCP
port: 9090
targetPort: api
5 changes: 5 additions & 0 deletions kube/prod/add-nats.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: NATS_SPRING_SERVER
value: nats://nats:4222
15 changes: 15 additions & 0 deletions kube/prod/api_gateway/configure-ingress.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- op: add
path: /metadata/annotations/cert-manager.io~1cluster-issuer
value: letsencrypt-prod
- op: add
path: /spec/ingressClassName
value: nginx
- op: replace
path: /spec/rules/0/host
value: linkedout.cluster-2020-5.dopolytech.fr
- op: add
path: /spec/tls
value:
- hosts:
- linkedout.cluster-2020-5.dopolytech.fr
secretName: linkedout.cluster-2020-5.dopolytech.fr-tls
42 changes: 42 additions & 0 deletions kube/prod/employer/add-postgres.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_R2DBC_URL
value: r2dbc:postgresql://postgres-postgresql:5432/employer
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_R2DBC_USERNAME
valueFrom:
secretKeyRef:
name: database-credentials
key: employer-username
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_R2DBC_PASSWORD
valueFrom:
secretKeyRef:
name: database-credentials
key: employer-password
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_FLYWAY_URL
value: jdbc:postgresql://postgres-postgresql:5432/employer
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_FLYWAY_USER
valueFrom:
secretKeyRef:
name: database-credentials
key: employer-username
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_FLYWAY_PASSWORD
valueFrom:
secretKeyRef:
name: database-credentials
key: employer-password
42 changes: 42 additions & 0 deletions kube/prod/jobs/add-postgres.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_R2DBC_URL
value: r2dbc:postgresql://postgres-postgresql:5432/job
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_R2DBC_USERNAME
valueFrom:
secretKeyRef:
name: database-credentials
key: jobs-username
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_R2DBC_PASSWORD
valueFrom:
secretKeyRef:
name: database-credentials
key: jobs-password
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_FLYWAY_URL
value: jdbc:postgresql://postgres-postgresql:5432/job
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_FLYWAY_USER
valueFrom:
secretKeyRef:
name: database-credentials
key: jobs-username
- op: add
path: /spec/template/spec/containers/0/env/-
value:
name: SPRING_FLYWAY_PASSWORD
valueFrom:
secretKeyRef:
name: database-credentials
key: jobs-password
Loading