The following procedure has been identified to consistently work.
The first piece of the puzzle is minikube
, which the latest version can be installed using the following commands:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
Minikube can use different drivers to provide its runtime, such as kvm2
, docker
and others. This document focuses on using the docker
backend.
The following recipe installs the Docker CE provided by Docker, and adds the current logged-in user to the docker
group created by the package:
sudo dnf config-manager \
--add-repo \
https://download.docker.com/linux/fedora/docker-ce.repo
sudo dnf install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable --now docker
# Add the current user to the 'docker' group created above.
sudo usermod -a -G docker ${USER}
export OPERATOR_SDK_VERSION="1.3.0"
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v${OPERATOR_SDK_VERSION}
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
sudo install operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
skopeo
is one of the tools required to build the Service Binding Operator bundle, and is available on Fedora's default repositories:
sudo dnf install -y skopeo
umoci
is other of the tools required to build the Service Binding Operator bundle, which can be installed using the recipe below:
export UMOCI_VERSION="0.4.7"
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export UMOCI_DL_URL="https://github.com/opencontainers/umoci/releases/download/v${UMOCI_VERSION}"
curl -LO ${UMOCI_DL_URL}/umoci.${ARCH}
sudo install umoci.${ARCH} /usr/local/bin/umoci
Once all the dependencies are available in the system, the following recipe will:
- Build the operator's image using Minikube's registry.
- Build the bundle's image, which requires the operator image to previously exist.
- Push all the tags present locally to Minikube's registry.
- Generate the
out/release.yaml
file with information extracted from the bundle image generated above. - Install and wait until
cert-manager
is rolled out, since it is a dependency for the operator to properly function in a later stage. - Install the operator and all its dependencies from the generated file
out/release.yaml
. - Wait for the operator to start and perform the acceptance tests.
rm out/release.yaml
eval $(minikube docker-env)
export KUBECONFIG=$HOME/.kube/config
export OPERATOR_REGISTRY="$(minikube ip):5000"
export TEST_ACCEPTANCE_CLI=kubectl
export TEST_ACCEPTANCE_START_SBO=remote
export SKIP_REGISTRY_LOGIN=true
make image -o push-image
make bundle-image -o push-image
docker push -a "${OPERATOR_REGISTRY}/redhat-developer/servicebinding-operator"
make release-manifests
make deploy-cert-manager
kubectl rollout status -n cert-manager deploy/cert-manager -w --timeout=120s
kubectl apply -f out/release.yaml
kubectl rollout status -n service-binding-operator deploy/service-binding-operator -w --timeout=60s
make TEST_ACCEPTANCE_START_SBO=remote test-acceptance