Skip to content

Commit 46cc25f

Browse files
committed
feat(ws): Define k8s workload manifest for frontend component #404
Signed-off-by: Noa <[email protected]>
1 parent bd66a26 commit 46cc25f

File tree

7 files changed

+118
-0
lines changed

7 files changed

+118
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: frontend
5+
spec:
6+
selector:
7+
matchLabels: {}
8+
replicas: 1
9+
strategy:
10+
type: RollingUpdate
11+
rollingUpdate:
12+
maxUnavailable: 0
13+
maxSurge: 1
14+
template:
15+
spec:
16+
terminationGracePeriodSeconds: 30
17+
containers:
18+
- name: nb-frontend
19+
image: nb-frontend
20+
imagePullPolicy: IfNotPresent
21+
securityContext:
22+
allowPrivilegeEscalation: false
23+
capabilities:
24+
drop:
25+
- "ALL"
26+
ports:
27+
- name: http-frontend
28+
containerPort: 8080
29+
env:
30+
- name: PORT
31+
value: "8080"
32+
resources:
33+
limits:
34+
cpu: "1"
35+
memory: 512Mi
36+
requests:
37+
cpu: 100m
38+
memory: 256Mi
39+
livenessProbe:
40+
httpGet:
41+
path: /
42+
port: 8080
43+
scheme: HTTP
44+
initialDelaySeconds: 15
45+
periodSeconds: 20
46+
timeoutSeconds: 5
47+
failureThreshold: 3
48+
readinessProbe:
49+
httpGet:
50+
path: /
51+
port: 8080
52+
scheme: HTTP
53+
initialDelaySeconds: 5
54+
periodSeconds: 10
55+
timeoutSeconds: 3
56+
failureThreshold: 3
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: kubeflow-system
5+
6+
namePrefix: nb-
7+
8+
resources:
9+
- deployment.yaml
10+
- service.yaml
11+
12+
images:
13+
- name: nb-frontend
14+
15+
labels:
16+
- includeSelectors: true
17+
pairs:
18+
app.kubernetes.io/name: kubeflow-notebooks
19+
app.kubernetes.io/component: workspace-frontend
20+
app.kubernetes.io/managed-by: kustomize
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: frontend
5+
spec:
6+
ports:
7+
- name: http-frontend
8+
port: 8080
9+
targetPort: http-frontend
10+
type: ClusterIP
11+

workspaces/frontend/config/manifests/kustomize/options/destination-rule.yaml

Whitespace-only changes.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: security.istio.io/v1beta1
2+
kind: AuthorizationPolicy
3+
metadata:
4+
name: frontend
5+
spec:
6+
action: ALLOW
7+
selector:
8+
matchLabels:
9+
app.kubernetes.io/component: workspace-frontend
10+
rules:
11+
- {}

workspaces/frontend/config/manifests/kustomize/options/kustomization.yaml

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: networking.istio.io/v1beta1
2+
kind: VirtualService
3+
metadata:
4+
name: frontend
5+
spec:
6+
hosts:
7+
- "*"
8+
gateways:
9+
- kubeflow-gateway
10+
http:
11+
- match:
12+
- uri:
13+
prefix: /notebooks
14+
rewrite:
15+
uri: "/"
16+
route:
17+
- destination:
18+
host: nb-frontend.kubeflow-system.svc.cluster.local
19+
port:
20+
number: 8080

0 commit comments

Comments
 (0)