Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.15] create a mechanism to deploy odf using operator-sdk #440

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
# We are using `--ignore-matching-lines` flag with the pattern `createdAt`
# to exclude lines with the timestamp from being considered, as the CSV file
# consistently receives a new timestamp during generation with operator-sdk 1.26 onwards.
git diff --exit-code --ignore-matching-lines createdAt || (echo -e '\e[31m'"$msg"; exit 1)
git diff --exit-code --ignore-matching-lines createdAt bundle || (echo -e '\e[31m'"$msg"; exit 1)

catalog-build:
runs-on: ubuntu-latest
Expand All @@ -71,4 +71,6 @@ jobs:
OPM_RENDER_OPTS: --use-http
run: |
docker run -d -p 5000:5000 --name registry registry:2
make bundle-build bundle-push catalog-build
make bundle-build bundle-push catalog-build catalog-deps-build
msg='Uncommitted catalog changes. run `make catalog` and commit results.'
git diff --exit-code catalog || (echo -e '\e[31m'"$msg"; exit 1)
8 changes: 6 additions & 2 deletions .github/workflows/docker-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
required: true
default: ocs-dev
IMAGE_TAG:
required: true
default: latest
required: false
default: ""

jobs:
docker-push:
Expand All @@ -32,7 +32,11 @@ jobs:
env:
REGISTRY_NAMESPACE: ${{ github.event.inputs.REGISTRY_NAMESPACE }}
IMAGE_TAG: ${{ github.event.inputs.IMAGE_TAG }}
IMAGE_TAG_SHA: ${{ github.ref_name }}-${{ github.sha }}
run: |
# Set IMAGE_TAG to a calculated <branch>-<sha> if not specified
export IMAGE_TAG=${IMAGE_TAG:-${IMAGE_TAG_SHA:0:-33}}
make docker-build docker-push
make bundle-build bundle-push
make catalog-build catalog-push
make catalog-deps-build catalog-deps-push
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,4 @@ testbin/*
*~

# catalog manifests
catalog/csiaddons.yaml
catalog/ibm.yaml
catalog/noobaa.yaml
catalog/ocs.yaml
catalog/odf.yaml
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | kubectl delete -f -

install-odf: operator-sdk ## install odf using the hack/install-odf.sh script
hack/install-odf.sh $(OPERATOR_SDK) $(BUNDLE_IMG) $(CATALOG_DEPS_IMG) $(STARTING_CSVS)

deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
cd config/default && $(KUSTOMIZE) edit set image rbac-proxy=$(RBAC_PROXY_IMG)
Expand Down Expand Up @@ -177,3 +180,11 @@ catalog-build: catalog ## Build a catalog image.
.PHONY: catalog-push
catalog-push: ## Push a catalog image.
$(MAKE) docker-push IMG=$(CATALOG_IMG)

.PHONY: catalog-deps-build
catalog-deps-build: catalog ## Build a catalog-deps image.
docker build -f catalog.deps.Dockerfile -t $(CATALOG_DEPS_IMG) .

.PHONY: catalog-deps-push
catalog-deps-push: ## Push a catalog-deps image.
$(MAKE) docker-push IMG=$(CATALOG_DEPS_IMG)
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=odf-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.30.0
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.31.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
2 changes: 1 addition & 1 deletion bundle/manifests/odf-operator.clusterserviceversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ metadata:
operators.openshift.io/infrastructure-features: '["disconnected"]'
operators.openshift.io/valid-subscription: '["OpenShift Platform Plus","OpenShift
Data Foundation Essentials","OpenShift Data Foundation Advanced"]'
operators.operatorframework.io/builder: operator-sdk-v1.30.0
operators.operatorframework.io/builder: operator-sdk-v1.31.0
operators.operatorframework.io/operator-type: standalone
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/red-hat-storage/odf-operator
Expand Down
2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ annotations:
operators.operatorframework.io.bundle.package.v1: odf-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.bundle.channel.default.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.30.0
operators.operatorframework.io.metrics.builder: operator-sdk-v1.31.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

Expand Down
26 changes: 26 additions & 0 deletions catalog.deps.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# The base image which contain rm and sed command
FROM cirros as builder

# Copy catalog files
COPY catalog /configs

# Remove odf bundle from the files
RUN rm -f /configs/odf.yaml

# Remove odf bundle details from the index file
RUN sed -i '1,11d' /configs/index.yaml


# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
FROM quay.io/operator-framework/opm:v1.26.0

# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs"]

# Copy declarative config root into image at /configs
COPY --from=builder /configs /configs

# Set DC-specific label for the location of the DC root directory in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
80 changes: 80 additions & 0 deletions catalog/csiaddons.yaml

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions catalog/ibm.yaml

Large diffs are not rendered by default.

80 changes: 80 additions & 0 deletions catalog/noobaa.yaml

Large diffs are not rendered by default.

Loading
Loading