Skip to content

Commit

Permalink
Merge pull request #20 from msherif1234/fix_kind_deploy
Browse files Browse the repository at this point in the history
fix kind and ocp deploy and run on targets
  • Loading branch information
mergify[bot] authored Jun 6, 2024
2 parents ee50b19 + 1861e30 commit b86d220
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 11 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ jobs:
fail_ci_if_error: true
verbose: true

bundle-check:
runs-on: ubuntu-latest
name: Checking bundle up-to-date
steps:
- name: install make
run: sudo apt-get install make
- name: checkout
uses: actions/checkout@v3
- name: Verify generated bundle manifest
run: |
make bundle
git diff --exit-code -I'^ createdAt: ' bundle
kubernetes-integration-tests:
runs-on: ubuntu-latest
strategy:
Expand Down Expand Up @@ -113,6 +126,7 @@ jobs:
[
check-license,
build-lint-test,
bundle-check,
kubernetes-integration-tests,
]
runs-on: ubuntu-latest
Expand Down
27 changes: 17 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ LOCALBIN ?= $(shell pwd)/bin
$(LOCALBIN):
mkdir -p $(LOCALBIN)

# Allows building bundles in Mac replacing BSD 'sed' command by GNU-compatible 'gsed'
ifeq (,$(shell which gsed 2>/dev/null))
SED ?= sed
else
SED ?= gsed
endif

## Tool Binaries
KUSTOMIZE ?= $(LOCALBIN)/kustomize
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
Expand Down Expand Up @@ -292,7 +299,7 @@ test: fmt envtest ## Run Unit tests.
test-integration: ## Run Integration tests.
go clean -testcache
cd config/bpfman-deployment && \
sed -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
$(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)@' \
kustomization.yaml.env > kustomization.yaml
GOFLAGS="-tags=integration_tests" go test -race -v ./test/integration/...
Expand All @@ -305,8 +312,8 @@ test-integration: ## Run Integration tests.
bundle: operator-sdk generate kustomize manifests ## Generate bundle manifests and metadata, then validate generated files.
cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG}
cd config/bpfman-deployment && \
sed -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)@' \
$(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)-$(MULTIARCH_TARGETS)@' \
kustomization.yaml.env > kustomization.yaml
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
cp config/manifests/dependencies.yaml bundle/metadata/
Expand Down Expand Up @@ -402,7 +409,7 @@ images: operator-images agent-images ## Build and push bpfman-agent, and bpfman-

.PHONY: load-images-kind
load-images-kind: ## Load bpfman-agent, and bpfman-operator images into the running local kind devel cluster.
kind load docker-image ${BPFMAN_OPERATOR_IMG} ${BPFMAN_AGENT_IMG} --name ${KIND_CLUSTER_NAME}
kind load docker-image ${BPFMAN_OPERATOR_IMG}-${MULTIARCH_TARGETS} ${BPFMAN_AGENT_IMG}-${MULTIARCH_TARGETS} --name ${KIND_CLUSTER_NAME}

.PHONY: bundle-build
bundle-build: ## Build the bundle image.
Expand Down Expand Up @@ -461,10 +468,10 @@ destroy-kind: ## Destroy Kind cluster
## Default deploy target is KIND based with its CSI driver initialized.
.PHONY: deploy
deploy: manifests kustomize ## Deploy bpfman-operator to the K8s cluster specified in ~/.kube/config with the csi driver initialized.
cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG}
cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG}-${MULTIARCH_TARGETS}
cd config/bpfman-deployment && \
sed -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)@' \
$(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)-$(MULTIARCH_TARGETS)@' \
kustomization.yaml.env > kustomization.yaml
$(KUSTOMIZE) build config/default | kubectl apply -f -

Expand All @@ -486,10 +493,10 @@ run-on-kind: kustomize setup-kind build-images load-images-kind deploy ## Kind D

.PHONY: deploy-openshift
deploy-openshift: manifests kustomize ## Deploy bpfman-operator to the Openshift cluster specified in ~/.kube/config.
cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG}
cd config/bpfman-operator-deployment && $(KUSTOMIZE) edit set image quay.io/bpfman/bpfman-operator=${BPFMAN_OPERATOR_IMG}-${MULTIARCH_TARGETS}
cd config/bpfman-deployment && \
sed -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)@' \
$(SED) -e 's@bpfman\.image=.*@bpfman.image=$(BPFMAN_IMG)@' \
-e 's@bpfman\.agent\.image=.*@bpfman.agent.image=$(BPFMAN_AGENT_IMG)-$(MULTIARCH_TARGETS)@' \
kustomization.yaml.env > kustomization.yaml
$(KUSTOMIZE) build config/openshift | kubectl apply -f -

Expand Down
4 changes: 3 additions & 1 deletion bundle/manifests/bpfman-config_v1_configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
data:
bpfman.agent.healthprobe.addr: :8175
bpfman.agent.image: quay.io/bpfman/bpfman-agent:latest
bpfman.agent.image: quay.io/bpfman/bpfman-agent:latest-amd64
bpfman.agent.log.level: info
bpfman.agent.metric.addr: 127.0.0.1:8174
bpfman.image: quay.io/bpfman/bpfman:latest
Expand All @@ -12,4 +12,6 @@ data:
millisec_delay = 10000
kind: ConfigMap
metadata:
annotations: {}
labels: {}
name: bpfman-config

0 comments on commit b86d220

Please sign in to comment.