From 5a761b84193d27fb0ab56e90b9d0782f23e52752 Mon Sep 17 00:00:00 2001 From: husam-lb Date: Mon, 16 Dec 2024 10:44:17 +0200 Subject: [PATCH 1/3] Add lb.yaml Signed-off-by: husam-lb --- lb.yaml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lb.yaml diff --git a/lb.yaml b/lb.yaml new file mode 100644 index 0000000..d017a3f --- /dev/null +++ b/lb.yaml @@ -0,0 +1,32 @@ +los-csi: + lb-csi-plugin: + build: + - make -f Makefile.lb docker-build docker-bundle + install: + - make -f Makefile.lb install + checkin: + - make -f Makefile.lb checkin + deps: + - file://Makefile + - file://Makefile.lb + - file://main.go + - file://pkg + - file://deploy/Dockerfile + - file://Dockerfile.builder + - file://deploy/licenses + - file://go.mod + - file://go.sum + - file://VERSION + - file://lb.yaml + lb-csi-bundle: + build: + - make -f Makefile.lb docker-bundle + deps: + - file://Makefile + - file://Makefile.lb + - file://main.go + - file://pkg + - file://deploy + - file://go.mod + - file://go.sum + - file://VERSION From 98e7686b96187a3f01125a5651a4aaeced5a8c54 Mon Sep 17 00:00:00 2001 From: husam-lb Date: Fri, 20 Dec 2024 12:38:30 +0200 Subject: [PATCH 2/3] Add Makefile.lb --- Makefile.lb | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Makefile.lb diff --git a/Makefile.lb b/Makefile.lb new file mode 100644 index 0000000..b213f03 --- /dev/null +++ b/Makefile.lb @@ -0,0 +1,50 @@ +# Copyright (C) 2016--2020 Lightbits Labs Ltd. +# SPDX-License-Identifier: Apache-2.0 + +include $(WORKSPACE_TOP)/common/Makefile.env + +DOCKER_REGISTRY := $(or $(DOCKER_REGISTRY),lbdocker:5000) +SIDECAR_DOCKER_REGISTRY := $(or $(SIDECAR_DOCKER_REGISTRY),lbdocker:5000) + +REPO_NAME = los-csi +INSTALL_PATH ?= $(shell component-tool localpath --repo=$(REPO_NAME) --type=$(BUILD_TYPE) lb-csi-plugin) + +ifeq ($(INSTALL_PATH),"") + $(error "lb-csi install path is not specified") +endif + +override BUILD_HASH := $(shell component-tool version --repo $(REPO_NAME) --type=$(BUILD_TYPE) lb-csi-plugin) + +override DISCOVERY_CLIENT_BUILD_HASH := $(shell component-tool version --repo discovery-client lb-nvme-discovery-client) + +BUILD_FLAGS := DOCKER_REGISTRY=$(DOCKER_REGISTRY) \ + SIDECAR_DOCKER_REGISTRY=$(SIDECAR_DOCKER_REGISTRY) \ + BUILD_HASH=$(BUILD_HASH) \ + DISCOVERY_CLIENT_BUILD_HASH=$(DISCOVERY_CLIENT_BUILD_HASH) \ + HELM_CHART_REPOSITORY=$(HELM_CHART_REPOSITORY) \ + HELM_CHART_REPOSITORY_USERNAME=$(HELM_CHART_REPOSITORY_USERNAME) \ + HELM_CHART_REPOSITORY_PASSWORD=$(HELM_CHART_REPOSITORY_PASSWORD) + +.PHONY: all checkout_deps build clean install_dir install checkin + +all: docker-build docker-bundle install + +checkout_deps: + $(Q)lb-build -d -o + +clean: + $(Q)$(MAKE) -f Makefile clean + +install_dir: + $(Q)mkdir -p $(INSTALL_PATH) + +install: |install_dir + $(BUILD_FLAGS) $(MAKE) -f Makefile push + cp -r deploy $(INSTALL_PATH)/ + $(call save_manifest,$(REPO_NAME):lb-csi-plugin,$(INSTALL_PATH)) + +checkin: + $(Q)component-tool checkin -v --repo=$(REPO_NAME) lb-csi-plugin + +.DEFAULT: ## passthrough each command to the Makefile with predefined lightbits specific variables. + $(Q)$(BUILD_FLAGS) $(MAKE) --no-print-directory -f Makefile "$@" From 98abd453273f32453b143e08948baf3b7d82401a Mon Sep 17 00:00:00 2001 From: husam-lb Date: Fri, 20 Dec 2024 12:41:27 +0200 Subject: [PATCH 3/3] Makefile: Add sidecar image for dc manifests --- Makefile | 44 +++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index 459701b..e855e56 100644 --- a/Makefile +++ b/Makefile @@ -147,7 +147,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.17 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.17-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.17-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -164,7 +165,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.18 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.18-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.18-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -181,7 +183,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.19 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.19-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.19-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -198,7 +201,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.20 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.20-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.20-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -215,7 +219,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.21 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.21-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.21-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -232,7 +237,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.22 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.22-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.22-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -249,7 +255,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.23 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.23-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.23-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -266,7 +273,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.24 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.24-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.24-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -283,7 +291,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.25 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.25-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.25-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -300,7 +309,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.26 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.26-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.26-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -317,7 +327,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.27 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.27-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.27-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -334,7 +345,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.28 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.28-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.28-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -351,7 +363,8 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.29 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.29-dc.yaml + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.29-dc.yaml helm template deploy/helm/lb-csi/ \ --namespace=kube-system \ --set allowExpandVolume=true \ @@ -368,8 +381,9 @@ lb-csi-manifests: verify_image_registry deploy/k8s --set kubeVersion=v1.30 \ --set imageRegistry=$(DOCKER_REGISTRY) \ --set sidecarImageRegistry=$(SIDECAR_DOCKER_REGISTRY) \ - --set image=$(DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.30-dc.yaml - + --set image=$(DOCKER_TAG) \ + --set discoveryClientImage=$(DISCOVERY_CLIENT_DOCKER_TAG) > deploy/k8s/lb-csi-plugin-k8s-v1.30-dc.yaml + deploy/examples: mkdir -p deploy/examples