Skip to content

Commit 41ef341

Browse files
committed
Add Kubernetes resources for Code Jam namespace including deployments, services, and routes
1 parent 69319b7 commit 41ef341

6 files changed

Lines changed: 294 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Code Jam namespace
2+
3+
This is a temporary namespace to hold resources associated with Code Jam winners (we are hosting their services for a short period to showcase).
4+
5+
Destroying this namespace and removing the associated zonefile from within the `dns/` directory should tear down all associated resources.
6+
7+
## Apply Order
8+
9+
1. Namespace
10+
2. Deployments
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: winner-grand-gardenias
5+
namespace: code-jam
6+
spec:
7+
replicas: 1
8+
selector:
9+
matchLabels:
10+
app: gardenias
11+
template:
12+
metadata:
13+
labels:
14+
app: gardenias
15+
spec:
16+
securityContext:
17+
fsGroup: 2000
18+
runAsUser: 1000
19+
runAsNonRoot: true
20+
containers:
21+
- name: gardenias
22+
image: ghcr.io/swfarnsworth/cj12-grand-gardenias:latest
23+
imagePullPolicy: Always
24+
resources:
25+
requests:
26+
cpu: 100m
27+
memory: 100Mi
28+
limits:
29+
cpu: 200m
30+
memory: 150Mi
31+
securityContext:
32+
readOnlyRootFilesystem: true
33+
ports:
34+
- name: http
35+
containerPort: 8000
36+
---
37+
apiVersion: apps/v1
38+
kind: Deployment
39+
metadata:
40+
name: winner-tubular-tulips
41+
namespace: code-jam
42+
spec:
43+
replicas: 1
44+
selector:
45+
matchLabels:
46+
app: tulips
47+
template:
48+
metadata:
49+
labels:
50+
app: tulips
51+
spec:
52+
securityContext:
53+
fsGroup: 2000
54+
runAsUser: 1000
55+
runAsNonRoot: true
56+
containers:
57+
- name: tulips
58+
image: ghcr.io/swfarnsworth/cj12-tubular-tulips:latest
59+
imagePullPolicy: Always
60+
resources:
61+
requests:
62+
cpu: 100m
63+
memory: 100Mi
64+
limits:
65+
cpu: 200m
66+
memory: 150Mi
67+
securityContext:
68+
readOnlyRootFilesystem: true
69+
ports:
70+
- name: http
71+
containerPort: 8000
72+
---
73+
apiVersion: apps/v1
74+
kind: Deployment
75+
metadata:
76+
name: winner-monumental-monsteras
77+
namespace: code-jam
78+
spec:
79+
replicas: 1
80+
selector:
81+
matchLabels:
82+
app: monsteras
83+
template:
84+
metadata:
85+
labels:
86+
app: monsteras
87+
spec:
88+
securityContext:
89+
fsGroup: 2000
90+
runAsUser: 1000
91+
runAsNonRoot: true
92+
containers:
93+
- name: monsteras
94+
image: ghcr.io/swfarnsworth/cj12-monumental-monsteras:latest
95+
imagePullPolicy: Always
96+
resources:
97+
requests:
98+
cpu: 100m
99+
memory: 200Mi
100+
limits:
101+
cpu: 200m
102+
memory: 250Mi
103+
securityContext:
104+
readOnlyRootFilesystem: true
105+
ports:
106+
- name: http
107+
containerPort: 8080
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: code-jam
5+
labels:
6+
name: code-jam
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: gateway.networking.k8s.io/v1beta1
2+
kind: ReferenceGrant
3+
metadata:
4+
name: allow-nginx-gateway-to-code-jam
5+
namespace: code-jam
6+
spec:
7+
from:
8+
- group: gateway.networking.k8s.io
9+
kind: HTTPRoute
10+
namespace: nginx-gateway
11+
to:
12+
- group: ""
13+
kind: Service
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# THESE ROUTES ARE TEMPORARILY LIVING HERE AS OPPOSED TO THE NGINX GATEWAY NAMESPACE
2+
# AS THEY ARE A TEMPORARY DEPLOYMENT, WE WILL BE REMOVING THESE ONCE WE STOP HOSTING
3+
# THE CODE JAM WINNER PROJECTS.
4+
5+
apiVersion: gateway.networking.k8s.io/v1
6+
kind: HTTPRoute
7+
metadata:
8+
name: code-jam-winners
9+
namespace: nginx-gateway
10+
spec:
11+
hostnames:
12+
- gardenias.pydis.com
13+
- monsteras.pydis.com
14+
- tulips.pydis.com
15+
parentRefs:
16+
- name: nginx
17+
namespace: nginx-gateway
18+
rules:
19+
- matches:
20+
- headers:
21+
- name: host
22+
value: "gardenias.pydis.com"
23+
backendRefs:
24+
- name: gardenias
25+
namespace: code-jam
26+
port: 80
27+
filters:
28+
- type: ExtensionRef
29+
extensionRef:
30+
group: gateway.nginx.org
31+
kind: SnippetsFilter
32+
name: enforce-mtls
33+
- matches:
34+
- headers:
35+
- name: host
36+
value: "monsteras.pydis.com"
37+
backendRefs:
38+
- name: monsteras
39+
namespace: code-jam
40+
port: 80
41+
filters:
42+
- type: ExtensionRef
43+
extensionRef:
44+
group: gateway.nginx.org
45+
kind: SnippetsFilter
46+
name: enforce-mtls
47+
- matches:
48+
- headers:
49+
- name: host
50+
value: "tulips.pydis.com"
51+
backendRefs:
52+
- name: tulips
53+
namespace: code-jam
54+
port: 80
55+
filters:
56+
- type: ExtensionRef
57+
extensionRef:
58+
group: gateway.nginx.org
59+
kind: SnippetsFilter
60+
name: enforce-mtls
61+
---
62+
apiVersion: gateway.networking.k8s.io/v1
63+
kind: HTTPRoute
64+
metadata:
65+
name: code-jam-redirects
66+
namespace: nginx-gateway
67+
spec:
68+
hostnames:
69+
- gardenias.pythondiscord.com
70+
- monsteras.pythondiscord.com
71+
- tulips.pythondiscord.com
72+
parentRefs:
73+
- name: nginx
74+
namespace: nginx-gateway
75+
rules:
76+
- matches:
77+
- headers:
78+
- name: host
79+
value: "gardenias.pythondiscord.com"
80+
filters:
81+
- type: ExtensionRef
82+
extensionRef:
83+
group: gateway.nginx.org
84+
kind: SnippetsFilter
85+
name: enforce-mtls
86+
- type: RequestRedirect
87+
requestRedirect:
88+
scheme: https
89+
hostname: "gardenias.pydis.com"
90+
statusCode: 302
91+
- matches:
92+
- headers:
93+
- name: host
94+
value: "monsteras.pythondiscord.com"
95+
filters:
96+
- type: ExtensionRef
97+
extensionRef:
98+
group: gateway.nginx.org
99+
kind: SnippetsFilter
100+
name: enforce-mtls
101+
- type: RequestRedirect
102+
requestRedirect:
103+
scheme: https
104+
hostname: "monsteras.pydis.com"
105+
statusCode: 302
106+
- matches:
107+
- headers:
108+
- name: host
109+
value: "tulips.pythondiscord.com"
110+
filters:
111+
- type: ExtensionRef
112+
extensionRef:
113+
group: gateway.nginx.org
114+
kind: SnippetsFilter
115+
name: enforce-mtls
116+
- type: RequestRedirect
117+
requestRedirect:
118+
scheme: https
119+
hostname: "tulips.pydis.com"
120+
statusCode: 302
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: gardenias
5+
namespace: code-jam
6+
spec:
7+
selector:
8+
app: gardenias
9+
ports:
10+
- protocol: TCP
11+
port: 80
12+
targetPort: http
13+
---
14+
apiVersion: v1
15+
kind: Service
16+
metadata:
17+
name: tulips
18+
namespace: code-jam
19+
spec:
20+
selector:
21+
app: tulips
22+
ports:
23+
- protocol: TCP
24+
port: 80
25+
targetPort: http
26+
---
27+
apiVersion: v1
28+
kind: Service
29+
metadata:
30+
name: monsteras
31+
namespace: code-jam
32+
spec:
33+
selector:
34+
app: monsteras
35+
ports:
36+
- protocol: TCP
37+
port: 80
38+
targetPort: http

0 commit comments

Comments
 (0)