Skip to content

Commit

Permalink
Adding kueue-viz templates in helm charts
Browse files Browse the repository at this point in the history
  • Loading branch information
akram committed Dec 16, 2024
1 parent 8f51174 commit e7546f3
Show file tree
Hide file tree
Showing 10 changed files with 258 additions and 0 deletions.
24 changes: 24 additions & 0 deletions charts/kueue/templates/kueue-viz/backend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: kueue-viz-backend
namespace: {{ .Values.kueueViz.namespace }}
spec:
replicas: {{ .Values.kueueViz.replicaCount }}
selector:
matchLabels:
app: kueue-viz-backend
template:
metadata:
labels:
app: kueue-viz-backend
spec:
containers:
- name: backend
image: {{ .Values.kueueViz.backend.image }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
{{- end }}

28 changes: 28 additions & 0 deletions charts/kueue/templates/kueue-viz/backend-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if and .Values.kueueViz.enabled .Values.kueueViz.backend.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "kueue.fullname" . }}-backend-ingress
namespace: '{{ .Release.Namespace }}'
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
{{- if and .Values.enableCertManager .Values.kueueViz.tls.enabled }}
tls:
- hosts:
- {{ .Values.kueueViz.backend.ingress.host }}
secretName: {{ include "kueue.fullname" . }}-kueue-viz-tls-secret
{{- end }}
rules:
- host: {{ .Values.kueueViz.backend.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "kueue.fullname" . }}-backend
port:
number: 8080
{{- end }}
15 changes: 15 additions & 0 deletions charts/kueue/templates/kueue-viz/backend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: v1
kind: Service
metadata:
name: kueue-viz-backend
namespace: {{ .Values.kueueViz.namespace }}
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: kueue-viz-backend
{{- end }}

17 changes: 17 additions & 0 deletions charts/kueue/templates/kueue-viz/clusterrole.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kueue-backend-read-access
rules:
- apiGroups: ["kueue.x-k8s.io"]
resources: ["workloads", "clusterqueues", "localqueues", "resourceflavors"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["pods", "events", "nodes"]
verbs: ["get", "list", "watch"]
- apiGroups: ["kueue.x-k8s.io"]
resources: ["workloadpriorityclass"]
verbs: ["get", "list", "watch"]
{{- end }}

15 changes: 15 additions & 0 deletions charts/kueue/templates/kueue-viz/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kueue-backend-read-access-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kueue-backend-read-access
subjects:
- kind: ServiceAccount
name: default
namespace: {{ .Values.kueueViz.namespace }}
{{- end }}

29 changes: 29 additions & 0 deletions charts/kueue/templates/kueue-viz/frontend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: kueue-viz-frontend
namespace: {{ .Values.kueueViz.namespace }}
spec:
replicas: {{ .Values.kueueViz.replicaCount }}
selector:
matchLabels:
app: kueue-viz-frontend
template:
metadata:
labels:
app: kueue-viz-frontend
spec:

containers:
- name: frontend
image: {{ .Values.kueueViz.frontend.image }}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
env:
- name: REACT_APP_WEBSOCKET_URL
value: "{{ if and .Values.kueueViz.tls.enabled }}wss://{{ else }}ws://{{ end }}{{ .Values.kueueViz.backend.ingress.host }}"

{{- end }}

28 changes: 28 additions & 0 deletions charts/kueue/templates/kueue-viz/frontend-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "kueue.fullname" . }}-frontend-ingress
namespace: '{{ .Release.Namespace }}'
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
{{- if and .Values.enableCertManager .Values.kueueViz.tls.enabled }}
tls:
- hosts:
- {{ .Values.kueueViz.frontend.ingress.host }}
secretName: {{ include "kueue.fullname" . }}-kueue-viz-tls-secret
{{- end }}
rules:
- host: {{ .Values.kueueViz.frontend.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "kueue.fullname" . }}-frontend
port:
number: 8080
{{- end }}
15 changes: 15 additions & 0 deletions charts/kueue/templates/kueue-viz/frontend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.kueueViz.enabled }}
apiVersion: v1
kind: Service
metadata:
name: kueue-viz-frontend
namespace: {{ .Values.kueueViz.namespace }}
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
app: kueue-viz-frontend
{{- end }}

17 changes: 17 additions & 0 deletions charts/kueue/templates/kueue-viz/tls-certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if and .Values.enableCertManager .Values.kueueViz.tls.enabled }}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ include "kueue.fullname" . }}-kueue-viz-cert
namespace: '{{ .Release.Namespace }}'
labels:
{{- include "kueue.labels" . | nindent 4 }}
spec:
dnsNames:
- {{ .Values.kueueViz.backend.ingress.host }}
- {{ .Values.kueueViz.frontend.ingress.host }}
issuerRef:
kind: Issuer
name: {{ include "kueue.fullname" . }}-selfsigned-issuer
secretName: {{ include "kueue.fullname" . }}-kueue-viz-tls-secret
{{- end }}
70 changes: 70 additions & 0 deletions charts/kueue/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,73 @@ webhookService:
protocol: TCP
targetPort: 9443
type: ClusterIP

# kueue-viz dashboard
kueueViz:
enabled: true
replicaCount: 1
backend:
image: us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue-viz-backend:latest
ingress:
enabled: true
host: backend.kueue-viz.local

frontend:
image: us-central1-docker.pkg.dev/k8s-staging-images/kueue/kueue-viz-frontend:latest
ingress:
enabled: true
host: frontend.kueue-viz.local

tls:
enabled: true
tlsSecretName: kueue-viz-tls-secret
cert: |
-----BEGIN CERTIFICATE-----
MIIDDzCCAfegAwIBAgIUb4IhecON6lZwwli6+pcA3YO9RWAwDQYJKoZIhvcNAQEL
BQAwMDEaMBgGA1UEAwwRa3ViZXJuZXRlcy1pc3N1ZXIxEjAQBgNVBAoMCUt1ZXVl
LVZpejAeFw0yNDEyMTYwNzQ5MjlaFw0yNTEyMTYwNzQ5MjlaMDAxGjAYBgNVBAMM
EWt1YmVybmV0ZXMtaXNzdWVyMRIwEAYDVQQKDAlLdWV1ZS1WaXowggEiMA0GCSqG
SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCa/q+BFPohVtgoqn4U8oj1O6m3qZDN5TLx
3pHedagXweXKjDa9iX9FYeOhO7ME/x8Pk9IZKA9ykZlqAZ9p690ntMTNOXswxCAL
DZl02eOV5Hy3IkR3RmcE6Ot4BN8d2VlTugcoR9ACtBILGY3u/jRiJQplZRDScZtv
ajiTEoO7TfxXt/2tT0vkpmtsHkH/ZMPueH0Bqo8bkf45Ejs2i3qcbL//pH5sDfNi
rxP5xGpEJQmPFKS+E/DL4D6vSJEiYGY9Ca/JQ9pN3w26O7Whl2l+tZh+IJ9taUT0
0PveGjQZuW/EOoJ+tayzk3y1kGtfiJ4rCSmxvKabjRplf7INwP9VAgMBAAGjITAf
MB0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