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 4a993a9
Show file tree
Hide file tree
Showing 10 changed files with 208 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 .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 }}
20 changes: 20 additions & 0 deletions charts/kueue/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,23 @@ 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

0 comments on commit 4a993a9

Please sign in to comment.