Skip to content
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
15 changes: 15 additions & 0 deletions Dockerfile.catalog
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# The base image is expected to contain
# /bin/opm (with a serve subcommand) and /bin/grpc_health_probe
FROM registry.redhat.io/openshift4/ose-operator-registry-rhel9:v4.16

# Configure the entrypoint and command
ENTRYPOINT ["/bin/opm"]
CMD ["serve", "/configs", "--cache-dir=/tmp/cache"]

# Copy declarative config root into image at /configs and pre-populate serve cache
ADD catalog /configs
RUN ["/bin/opm", "serve", "/configs", "--cache-dir=/tmp/cache", "--cache-only"]

# Set DC-specific label for the location of the DC root directory
# in the image
LABEL operators.operatorframework.io.index.configs.v1=/configs
31 changes: 19 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ CONTAINER_PUSH_ARGS ?= $(if $(filter ${CONTAINER_ENGINE}, docker), , --tls-verif

BUNDLE_DIR := bundle
BUNDLE_MANIFEST_DIR := $(BUNDLE_DIR)/manifests
BUNDLE_IMG ?= olm-bundle:latest
INDEX_IMG ?= olm-bundle-index:latest
OPM_VERSION ?= v1.17.4
BUNDLE_IMG ?= quay.io/external-dns-operator/external-dns-operator-bundle:latest
CATALOG_DIR := catalog
PACKAGE_DIR := $(CATALOG_DIR)/external-dns-operator
CATALOG_IMG ?= quay.io/external-dns-operator/external-dns-operator-catalog:latest
OPM_VERSION ?= v1.31.0

GOLANGCI_LINT_BIN=$(BIN_DIR)/golangci-lint

Expand Down Expand Up @@ -175,25 +177,30 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
.PHONY: bundle
bundle: $(OPERATOR_SDK_BIN) manifests
$(OPERATOR_SDK_BIN) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image quay.io/openshift/origin-external-dns-operator=${IMG}
cd config/manager && $(KUSTOMIZE) edit set image quay.io/openshift/origin-external-dns-operator=$(IMG)
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK_BIN) generate bundle -q --overwrite=false --version $(BUNDLE_VERSION) $(BUNDLE_METADATA_OPTS)
$(OPERATOR_SDK_BIN) bundle validate $(BUNDLE_DIR)

.PHONY: bundle-image-build
bundle-image-build: bundle
$(CONTAINER_ENGINE) build -t ${BUNDLE_IMG} -f Dockerfile.bundle .
$(CONTAINER_ENGINE) build -t $(BUNDLE_IMG) -f Dockerfile.bundle .

.PHONY: bundle-image-push
bundle-image-push:
$(CONTAINER_ENGINE) push ${BUNDLE_IMG}
$(CONTAINER_ENGINE) push $(BUNDLE_IMG)

.PHONY: catalog
catalog: opm
$(OPM) render $(BUNDLE_IMG) -o yaml > $(PACKAGE_DIR)/bundle.yaml
$(OPM) validate $(CATALOG_DIR)

.PHONY: index-image-build
index-image-build: opm
$(OPM) index add -c $(CONTAINER_ENGINE) --bundles ${BUNDLE_IMG} --tag ${INDEX_IMG}
.PHONY: catalog-image-build
catalog-image-build: catalog
$(CONTAINER_ENGINE) build -t $(CATALOG_IMG) -f Dockerfile.catalog .

.PHONY: index-image-push
index-image-push:
$(CONTAINER_ENGINE) push ${INDEX_IMG}
.PHONY: catalog-image-push
catalog-image-push:
$(CONTAINER_ENGINE) push $(CATALOG_IMG)

OPM=$(BIN_DIR)/opm
opm: ## Download opm locally if necessary.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The `ExternalDNS` Operator allows you to deploy and manage [ExternalDNS](https:/
- [Deploying the ExternalDNS Operator](#deploying-the-externaldns-operator)
- [Preparing the environment](#preparing-the-environment)
- [Installing the ExternalDNS Operator by building and pushing the Operator image to a registry](#installing-the-externaldns-operator-by-building-and-pushing-the-operator-image-to-a-registry)
- [Installing the ExternalDNS Operator using a custom index image on OperatorHub](#installing-the-externaldns-operator-using-a-custom-index-image-on-operatorhub)
- [Installing the ExternalDNS Operator using a custom catalog image on OperatorHub](#installing-the-externaldns-operator-using-a-custom-catalog-image-on-operatorhub)
- [Using custom operand image](#using-custom-operand-image)
- [Running end-to-end tests manually](#running-end-to-end-tests-manually)
- [Proxy support](#proxy-support)
Expand Down Expand Up @@ -86,7 +86,7 @@ Prepare your environment for the installation commands.
*Note*: For other providers, see `config/samples/`.


### Installing the `ExternalDNS` Operator using a custom index image on OperatorHub
### Installing the `ExternalDNS` Operator using a custom catalog image on OperatorHub
1. Build and push the operator image to the registry:
```sh
export IMG=${REGISTRY}/${REPOSITORY}/external-dns-operator:${VERSION}
Expand All @@ -99,10 +99,10 @@ Prepare your environment for the installation commands.
make bundle-image-build bundle-image-push
```

3. Build and push the index image to the registry:
3. Build and push the catalog image to the registry:
```sh
export INDEX_IMG=${REGISTRY}/${REPOSITORY}/external-dns-operator-bundle-index:${VERSION}
make index-image-build index-image-push
export CATALOG_IMG=${REGISTRY}/${REPOSITORY}/external-dns-operator-catalog:${VERSION}
make catalog-image-build catalog-image-push
```

4. _Optional_: you may need to link the registry secret to the pod of `external-dns-operator` created in the `openshift-marketplace` namespace if the image is not made public ([Doc link](https://docs.openshift.com/container-platform/4.10/openshift_images/managing_images/using-image-pull-secrets.html#images-allow-pods-to-reference-images-from-secure-registries_using-image-pull-secrets)). If you are using `podman` then these are the instructions:
Expand All @@ -126,7 +126,7 @@ Prepare your environment for the installation commands.
namespace: openshift-marketplace
spec:
sourceType: grpc
image: ${INDEX_IMG}
image: ${CATALOG_IMG}
EOF
```

Expand Down
Loading