From 4c6302d66fe941d1c2aeeb411143c6666e708960 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20J=C3=B6rg?= Date: Fri, 26 Sep 2025 16:19:12 +0200 Subject: [PATCH] feat: Create slurm --- helmfile.d/slurm.yaml.gotmpl | 44 +++++++++++++ .../values/{values-prod.yaml => values.yaml} | 0 values/slurm/env-oceanbox.yaml.gotmpl | 3 + values/slurm/env.yaml.gotmpl | 3 + .../CiliumNetworkPolicy-allow-api-server.yaml | 18 +++++ values/slurm/manifests/slurm-operator.yaml | 66 +++++++++++++++++++ values/slurm/values/values.yaml | 16 +++++ 7 files changed, 150 insertions(+) create mode 100644 helmfile.d/slurm.yaml.gotmpl rename values/mariadb-operator/values/{values-prod.yaml => values.yaml} (100%) create mode 100644 values/slurm/env-oceanbox.yaml.gotmpl create mode 100644 values/slurm/env.yaml.gotmpl create mode 100644 values/slurm/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml create mode 100644 values/slurm/manifests/slurm-operator.yaml create mode 100644 values/slurm/values/values.yaml diff --git a/helmfile.d/slurm.yaml.gotmpl b/helmfile.d/slurm.yaml.gotmpl new file mode 100644 index 00000000..b352335d --- /dev/null +++ b/helmfile.d/slurm.yaml.gotmpl @@ -0,0 +1,44 @@ +bases: + - ../envs/environments.yaml.gotmpl + +repositories: +- name: slurm + oci: true + url: ghcr.io/slinkyproject/charts + +commonLabels: + tier: system + +releases: +- name: slurm + namespace: slurm + chart: slurm/slurm + version: 0.4.0 + condition: slurm.enabled + values: + - ../values/slurm/values/slurm.yaml.gotmpl + - ../values/slurm/values/slurm-{{ .Environment.Name }}.yaml.gotmpl + postRenderer: ../bin/kustomizer + postRendererArgs: + - ../values/slurm/kustomize/{{ .Environment.Name }} + missingFileHandler: Info +- name: manifests + namespace: slurm + chart: manifests + condition: slurm.enabled + missingFileHandler: Info + values: + - ../values/env.yaml + - ../values/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml + - ../values/slurm/env.yaml.gotmpl + - ../values/slurm/env-{{ requiredEnv "ARGOCD_ENV_CLUSTER_NAME" }}.yaml.gotmpl + hooks: + - events: [ prepare, cleanup ] + showlogs: true + command: ../bin/helmify + args: + - '{{`{{ if eq .Event.Name "prepare" }}build{{ else }}clean{{ end }}`}}' + - '{{`{{ .Release.Chart }}`}}' + - '{{`{{ .Environment.Name }}`}}' + - ../values/slurm/manifests + - manifests diff --git a/values/mariadb-operator/values/values-prod.yaml b/values/mariadb-operator/values/values.yaml similarity index 100% rename from values/mariadb-operator/values/values-prod.yaml rename to values/mariadb-operator/values/values.yaml diff --git a/values/slurm/env-oceanbox.yaml.gotmpl b/values/slurm/env-oceanbox.yaml.gotmpl new file mode 100644 index 00000000..e483a02a --- /dev/null +++ b/values/slurm/env-oceanbox.yaml.gotmpl @@ -0,0 +1,3 @@ +slurm: + enabled: true + autosync: false diff --git a/values/slurm/env.yaml.gotmpl b/values/slurm/env.yaml.gotmpl new file mode 100644 index 00000000..8dfa6252 --- /dev/null +++ b/values/slurm/env.yaml.gotmpl @@ -0,0 +1,3 @@ +slurm: + enabled: false + autosync: false diff --git a/values/slurm/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml b/values/slurm/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml new file mode 100644 index 00000000..97ff48c6 --- /dev/null +++ b/values/slurm/manifests/policies/CiliumNetworkPolicy-allow-api-server.yaml @@ -0,0 +1,18 @@ +{{- if .Values.clusterConfig.cilium.enabled }} +apiVersion: cilium.io/v2 +kind: CiliumNetworkPolicy +metadata: + name: allow-api-server + namespace: slinky +spec: + egress: + - toEntities: + - kube-apiserver + toPorts: + - ports: + - port: "6443" + protocol: TCP + endpointSelector: + matchLabels: + app.kubernetes.io/instance: slurm-operator +{{- end }} diff --git a/values/slurm/manifests/slurm-operator.yaml b/values/slurm/manifests/slurm-operator.yaml new file mode 100644 index 00000000..e903f86c --- /dev/null +++ b/values/slurm/manifests/slurm-operator.yaml @@ -0,0 +1,66 @@ +{{- if .Values.clusterConfig.argo.enabled }} +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: slurm-operator + namespace: argocd +spec: + destination: + namespace: slinky + server: 'https://kubernetes.default.svc' + sources: + - repoURL: {{ .Values.clusterConfig.manifests }} + targetRevision: HEAD + path: helmfile.d + plugin: + name: helmfile-cmp + env: + - name: CLUSTER_NAME + value: {{ .Values.clusterConfig.cluster }} + - name: HELMFILE_ENVIRONMENT + value: default + - name: HELMFILE_FILE_PATH + value: slurm-operator.yaml.gotmpl + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + syncOptions: + - CreateNamespace=true + - ApplyOutOfSyncOnly=true + - ServerSideApply=true + {{- if .Values.slurm_operator.autosync }} + automated: + prune: true + # selfHeal: false + {{- end }} +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: slurm-crd + namespace: argocd + annotations: + argocd.argoproj.io/sync-wave: "-1" + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + destination: + namespace: slinky + server: 'https://kubernetes.default.svc' + source: + repoURL: 'ghcr.io/slinkyproject/charts' + targetRevision: '0.4.0' + chart: slurm-operator-crds + project: sys + syncPolicy: + managedNamespaceMetadata: + labels: + component: sys + automated: {} + syncOptions: + - ServerSideApply=true + - CreateNamespace=true + - ApplyOutOfSyncOnly=true +{{- end }} diff --git a/values/slurm/values/values.yaml b/values/slurm/values/values.yaml new file mode 100644 index 00000000..4839fb44 --- /dev/null +++ b/values/slurm/values/values.yaml @@ -0,0 +1,16 @@ +accounting: + enabled: true + +slurm-exporter: + enabled: false + +loginsets: + slinky: + enabled: false + +nodesets: + slinky: + replicas: 0 + +restapi: + replicas: 0