diff --git a/pkg/controller/ground/bootstrap.go b/pkg/controller/ground/bootstrap.go index 5abb1e24f1..449523cdee 100644 --- a/pkg/controller/ground/bootstrap.go +++ b/pkg/controller/ground/bootstrap.go @@ -18,7 +18,6 @@ import ( "github.com/sapcc/kubernikus/pkg/controller/ground/bootstrap/ccm" "github.com/sapcc/kubernikus/pkg/controller/ground/bootstrap/csi" "github.com/sapcc/kubernikus/pkg/controller/ground/bootstrap/dns" - "github.com/sapcc/kubernikus/pkg/controller/ground/bootstrap/gpu" "github.com/sapcc/kubernikus/pkg/controller/ground/bootstrap/network" "github.com/sapcc/kubernikus/pkg/util" "github.com/sapcc/kubernikus/pkg/version" @@ -81,12 +80,6 @@ func SeedKluster(clients config.Clients, factories config.Factories, images vers } } - if ok, _ := util.KlusterVersionConstraint(kluster, ">= 1.10"); ok { - if err := gpu.SeedGPUSupport(kubernetes); err != nil { - return errors.Wrap(err, "seed GPU support") - } - } - if ok, _ := util.KlusterVersionConstraint(kluster, ">= 1.20"); ok { dynamicKubernetes, err := clients.Satellites.DynamicClientFor(kluster) if err != nil { diff --git a/pkg/controller/ground/bootstrap/gpu/gpu.go b/pkg/controller/ground/bootstrap/gpu/gpu.go deleted file mode 100644 index 2fb9b3a654..0000000000 --- a/pkg/controller/ground/bootstrap/gpu/gpu.go +++ /dev/null @@ -1,37 +0,0 @@ -package gpu - -import ( - apps "k8s.io/api/apps/v1" - "k8s.io/apimachinery/pkg/runtime/serializer" - clientset "k8s.io/client-go/kubernetes" - clientsetscheme "k8s.io/client-go/kubernetes/scheme" - - "github.com/sapcc/kubernikus/pkg/controller/ground/bootstrap" -) - -func SeedGPUSupport(client clientset.Interface) error { - if err := createDaemonSet(client, NVIDIADevicePlugin_v20180808); err != nil { - return err - } - if err := createDaemonSet(client, NVIDIADriverInstaller_v20180808); err != nil { - return err - } - return nil -} - -func createDaemonSet(client clientset.Interface, manifest string) error { - template, err := bootstrap.RenderManifest(manifest, nil) - if err != nil { - return err - } - - daemonset, _, err := serializer.NewCodecFactory(clientsetscheme.Scheme).UniversalDeserializer().Decode(template, nil, &apps.DaemonSet{}) - if err != nil { - return err - } - - if err := bootstrap.CreateOrUpdateDaemonset(client, daemonset.(*apps.DaemonSet)); err != nil { - return err - } - return nil -} diff --git a/pkg/controller/ground/bootstrap/gpu/manifest.go b/pkg/controller/ground/bootstrap/gpu/manifest.go deleted file mode 100644 index 54763f4774..0000000000 --- a/pkg/controller/ground/bootstrap/gpu/manifest.go +++ /dev/null @@ -1,129 +0,0 @@ -package gpu - -const ( - NVIDIADevicePlugin_v20180808 = ` -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: nvidia-gpu-device-plugin - namespace: kube-system - labels: - k8s-app: nvidia-gpu-device-plugin - addonmanager.kubernetes.io/mode: Reconcile -spec: - selector: - matchLabels: - k8s-app: nvidia-gpu-device-plugin - template: - metadata: - labels: - k8s-app: nvidia-gpu-device-plugin - annotations: - scheduler.alpha.kubernetes.io/critical-pod: '' - spec: - priorityClassName: system-node-critical - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: gpu - operator: Exists - tolerations: - - operator: "Exists" - effect: "NoExecute" - - operator: "Exists" - effect: "NoSchedule" - volumes: - - name: device-plugin - hostPath: - path: /var/lib/kubelet/device-plugins - - name: dev - hostPath: - path: /dev - containers: - - image: "k8s.gcr.io/nvidia-gpu-device-plugin@sha256:d18b678437fedc4ec4211c20b3e5469a137a44f989da43dc275e4f2678170db4" - command: - - /usr/bin/nvidia-gpu-device-plugin - - -host-path=/opt/nvidia/current - - -logtostderr - name: nvidia-gpu-device-plugin - resources: - requests: - cpu: 50m - memory: 50Mi - limits: - cpu: 50m - memory: 50Mi - terminationGracePeriodSeconds: 0 - securityContext: - privileged: true - volumeMounts: - - name: device-plugin - mountPath: /device-plugin - - name: dev - mountPath: /dev - updateStrategy: - type: OnDelete -` - - NVIDIADriverInstaller_v20180808 = ` -apiVersion: apps/v1 -kind: DaemonSet -metadata: - name: nvidia-driver-installer - namespace: kube-system - labels: - k8s-app: nvidia-driver-installer -spec: - selector: - matchLabels: - k8s-app: nvidia-driver-installer - updateStrategy: - type: RollingUpdate - template: - metadata: - labels: - name: nvidia-driver-installer - k8s-app: nvidia-driver-installer - spec: - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: gpu - operator: Exists - tolerations: - - key: "nvidia.com/gpu" - effect: "NoSchedule" - operator: "Exists" - hostNetwork: true - hostPID: true - volumes: - - name: rootfs - hostPath: - path: / - - name: dev - hostPath: - path: /dev - initContainers: - - image: bugroger/coreos-nvidia-driver:stable-396.44-tesla - name: nvidia-driver-installer - imagePullPolicy: Always - terminationGracePeriodSeconds: 0 - terminationMessagePath: /tmp/termination-log - securityContext: - privileged: true - volumeMounts: - - name: rootfs - mountPath: /root - mountPropagation: Bidirectional - - name: dev - mountPath: /dev - mountPropagation: Bidirectional - containers: - - image: "gcr.io/google-containers/pause:2.0" - name: pause -` -) diff --git a/pkg/templates/ignition.go b/pkg/templates/ignition.go index 661de8b119..8dfac3abb3 100644 --- a/pkg/templates/ignition.go +++ b/pkg/templates/ignition.go @@ -106,12 +106,6 @@ func (i *ignition) GenerateNode(kluster *kubernikusv1.Kluster, pool *models.Node isFlatcar := true if pool != nil { nodeLabels = append(nodeLabels, "ccloud.sap.com/nodepool="+pool.Name) - if strings.HasPrefix(pool.Flavor, "zg") { - nodeLabels = append(nodeLabels, "gpu=nvidia-tesla-v100") - } - if strings.HasPrefix(pool.Flavor, "zg") { - nodeTaints = append(nodeTaints, "nvidia.com/gpu=present:NoSchedule") - } for _, userTaint := range pool.Taints { nodeTaints = append(nodeTaints, userTaint) } diff --git a/pkg/templates/ignition_test.go b/pkg/templates/ignition_test.go index ebeb0adb94..3c26fa768a 100644 --- a/pkg/templates/ignition_test.go +++ b/pkg/templates/ignition_test.go @@ -121,12 +121,4 @@ func TestNodeLabels(t *testing.T) { //Ensure we rendered the expected template assert.Contains(t, string(data), fmt.Sprintf("--node-labels=ccloud.sap.com/nodepool=%s", pool.Name)) } - - gpuPool := &models.NodePool{Name: "some-name", Flavor: "zghuh"} - data, err = Ignition.GenerateNode(kluster, gpuPool, "test", &testKlusterSecret, false, imageRegistry, log.NewNopLogger()) - if assert.NoError(t, err, "Failed to generate node") { - //Ensure we rendered the expected template - assert.Contains(t, string(data), fmt.Sprintf("--node-labels=ccloud.sap.com/nodepool=%s,gpu=nvidia-tesla-v100", pool.Name)) - assert.Contains(t, string(data), fmt.Sprintf("--register-with-taints=nvidia.com/gpu=present:NoSchedule")) - } }