diff --git a/Makefile b/Makefile index 8eb316d2c..0e6874651 100644 --- a/Makefile +++ b/Makefile @@ -18,9 +18,10 @@ BINDATA=pkg/manifests/bindata.go GOFMT_CHECK=$(shell find . -not \( \( -wholename './.*' -o -wholename '*/vendor/*' \) -prune \) -name '*.go' | sort -u | xargs gofmt -s -l) +# Container image-related variables +IMAGE_BUILD_CMD ?= podman build +IMAGE_PUSH_CMD ?= podman push DOCKERFILE=Dockerfile -IMAGE_TAG=openshift-psap/origin-cluster-nfd-operator -IMAGE_REGISTRY=quay.io vpath bin/go-bindata $(GOPATH) GOBINDATA_BIN=bin/go-bindata @@ -85,13 +86,16 @@ clean: go clean rm -f $(BIN) +clean-labels: + kubectl get no -o yaml | sed -e '/^\s*nfd.node.kubernetes.io/d' -e '/^\s*feature.node.kubernetes.io/d' | kubectl replace -f - + local-image: - podman build --no-cache -t $(IMAGE) -f $(DOCKERFILE) . + $(IMAGE_BUILD_CMD) $(IMAGE_BUILD_EXTRA_OPTS) -t $(IMAGE) -f $(DOCKERFILE) . + +local-image-push: + $(IMAGE_PUSH_CMD) $(IMAGE_PUSH_EXTRA_OPTS) $(IMAGE) test: go test ./cmd/... ./pkg/... -coverprofile cover.out -local-image-push: - podman push $(IMAGE) - .PHONY: all build generate verify verify-gofmt clean local-image local-image-push $(DEPLOY_OBJECTS) $(DEPLOY_OPERATOR) $(DEPLOY_CRDS) $(DEPLOY_CRS) diff --git a/assets/worker/0700_worker_daemonset.yaml b/assets/worker/0700_worker_daemonset.yaml index 5318a6117..70efa08ab 100644 --- a/assets/worker/0700_worker_daemonset.yaml +++ b/assets/worker/0700_worker_daemonset.yaml @@ -13,13 +13,16 @@ spec: labels: app: nfd-worker spec: - nodeSelector: - node-role.kubernetes.io/worker: "" tolerations: - - operator: Exists - - key: nvidia.com/gpu - operator: Exists - effect: NoSchedule + - operator: "Exists" + effect: "NoSchedule" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: node-role.kubernetes.io/master + operator: DoesNotExist hostNetwork: true serviceAccount: nfd-worker readOnlyRootFilesystem: true @@ -78,5 +81,3 @@ spec: items: - key: nfd-worker-conf path: nfd-worker.conf - -