Skip to content
This repository was archived by the owner on Sep 16, 2025. It is now read-only.
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
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,9 @@ jobs:
exit 1
fi
cd k8s/overlays/$OVERLAY
kustomize build . | kubectl apply --prune -l app=public-wiki --prune-allowlist=core/v1/Namespace --prune-allowlist=apps/v1/Deployment --prune-allowlist=core/v1/Service --prune-allowlist=networking.k8s.io/v1/Ingress -f -
if [ "$OVERLAY" = "main" ]; then
ENV_LABEL="main"
else
ENV_LABEL="dev"
fi
kustomize build . | kubectl apply -f -
7 changes: 2 additions & 5 deletions k8s/base/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: public-wiki
namespace: wiki
labels:
app: public-wiki
spec:
replicas: 3 # default, will be overridden by overlays
replicas: 1 # default, will be overridden by overlays
selector:
matchLabels:
app: public-wiki
Expand All @@ -17,6 +14,6 @@ spec:
spec:
containers:
- name: public-wiki
image: IMAGE_TAG # will be replaced by kustomize
image: ghcr.io/42core-team/wiki:dev # will be replaced by overlays
ports:
- containerPort: 3000
13 changes: 8 additions & 5 deletions k8s/base/ingress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: public-wiki-ingress
namespace: wiki
labels:
app: public-wiki
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "true"
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
ingressClassName: nginx
tls:
- hosts:
- PLACEHOLDER_HOST # will be patched in overlays
secretName: PLACEHOLDER_TLS_SECRET # will be patched in overlays
rules:
- host: PLACEHOLDER_HOST
- host: PLACEHOLDER_HOST # will be patched in overlays
http:
paths:
- path: /
Expand Down
4 changes: 0 additions & 4 deletions k8s/base/kustomization.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@ resources:
- service.yml
- ingress.yml

images:
- name: public-wiki
newName: IMAGE_TAG

namespace: wiki
2 changes: 0 additions & 2 deletions k8s/base/namespace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ apiVersion: v1
kind: Namespace
metadata:
name: wiki
labels:
app: public-wiki
3 changes: 0 additions & 3 deletions k8s/base/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ apiVersion: v1
kind: Service
metadata:
name: public-wiki
namespace: wiki
labels:
app: public-wiki
spec:
selector:
app: public-wiki
Expand Down
22 changes: 0 additions & 22 deletions k8s/deployment.yml

This file was deleted.

21 changes: 0 additions & 21 deletions k8s/ingress.yml

This file was deleted.

10 changes: 0 additions & 10 deletions k8s/kustomization.yml

This file was deleted.

6 changes: 0 additions & 6 deletions k8s/namespace.yml

This file was deleted.

23 changes: 16 additions & 7 deletions k8s/overlays/dev/kustomization.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
namePrefix: dev-
namespace: wiki
labels:
- pairs:
app: public-wiki
env: dev

resources:
- ../../base

namespace: wiki

patches:
- target:
kind: Deployment
Expand All @@ -11,15 +16,19 @@ patches:
- op: replace
path: /spec/replicas
value: 1
- op: replace
path: /spec/template/spec/containers/0/image
value: ghcr.io/42core-team/wiki:dev
- target:
kind: Ingress
name: public-wiki-ingress
patch: |-
- op: replace
path: /spec/rules/0/host
value: dev.wiki.coregame.de

images:
- name: IMAGE_TAG
newName: ghcr.io/42core-team/wiki
newTag: dev
- op: replace
path: /spec/tls/0/hosts/0
value: dev.wiki.coregame.de
- op: replace
path: /spec/tls/0/secretName
value: dev-wiki-coregame-de-tls
23 changes: 15 additions & 8 deletions k8s/overlays/main/kustomization.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namePrefix: main-
namespace: wiki
labels:
- pairs:
app: public-wiki
env: main
resources:
- ../../base

namespace: wiki

patches:
- target:
kind: Deployment
Expand All @@ -11,15 +14,19 @@ patches:
- op: replace
path: /spec/replicas
value: 3
- op: replace
path: /spec/template/spec/containers/0/image
value: ghcr.io/42core-team/wiki:main
- target:
kind: Ingress
name: public-wiki-ingress
patch: |-
- op: replace
path: /spec/rules/0/host
value: wiki.coregame.de

images:
- name: IMAGE_TAG
newName: ghcr.io/42core-team/wiki
newTag: main
- op: replace
path: /spec/tls/0/hosts/0
value: wiki.coregame.de
- op: replace
path: /spec/tls/0/secretName
value: wiki-coregame-de-tls
14 changes: 0 additions & 14 deletions k8s/service.yml

This file was deleted.