diff --git a/config/nginx-ingress/kustomization.yaml b/config/nginx-ingress/kustomization.yaml new file mode 100644 index 00000000..7bdced5d --- /dev/null +++ b/config/nginx-ingress/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: +- ../default +- resources/nginx_ingress.yaml +- https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml diff --git a/manifests/overlays/nginx-ingress/resources/nginx_ingress.yaml b/config/nginx-ingress/resources/nginx_ingress.yaml similarity index 70% rename from manifests/overlays/nginx-ingress/resources/nginx_ingress.yaml rename to config/nginx-ingress/resources/nginx_ingress.yaml index e29a559f..2154bc1a 100644 --- a/manifests/overlays/nginx-ingress/resources/nginx_ingress.yaml +++ b/config/nginx-ingress/resources/nginx_ingress.yaml @@ -3,10 +3,6 @@ kind: Ingress metadata: name: catalogd-nginx-ingress namespace: catalogd-system - annotations: - nginx.org/proxy-connect-timeout: "30s" - nginx.org/proxy-read-timeout: "20s" - nginx.org/client-max-body-size: "4m" spec: ingressClassName: nginx rules: @@ -19,4 +15,3 @@ spec: name: catalogd-catalogserver port: number: 80 - diff --git a/docs/fetching-catalog-contents.md b/docs/fetching-catalog-contents.md index 52f5b814..8fd008e1 100644 --- a/docs/fetching-catalog-contents.md +++ b/docs/fetching-catalog-contents.md @@ -63,37 +63,16 @@ curl http://localhost:8080/catalogs/operatorhubio/all.json This section outlines a way of exposing the `Catalogd` Service's endpoints outside the cluster and then accessing the catalog contents using `Ingress`. **Prerequisites** + - [Install kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) +- Assuming `kind` is installed, create a `kind` cluster with `extraPortMappings` and `node-labels` as shown in the [kind documentation](https://kind.sigs.k8s.io/docs/user/ingress/) - Install latest version of `Catalogd` by navigating to the [releases page](https://github.com/operator-framework/catalogd/releases) and following the install instructions included in the release you want to install. +- Install the `Ingress NGINX` Controller by running the below command: + ```sh + $ kubectl apply -k https://github.com/operator-framework/catalogd/tree/main/config/nginx-ingress + ``` -1. Create a `kind` cluster with `extraPortMappings` and `node-labels` by running the below command: - - ```sh - cat </catalogs/operatorhubio/all.json ``` - -1. Wait until `Ingress` is ready by running the below `kubectl wait` command: - - ```sh - $ kubectl wait --namespace ingress-nginx \ - --for=condition=ready pod \ - --selector=app.kubernetes.io/component=controller \ - --timeout=90s - ``` - -1. At this point the `Ingress` controller is ready to process requests. Let's create an `Ingress` object by running the below command: - - ```sh - $ kubectl apply -f https://github.com/operator-framework/catalogd/tree/main/manifests/overlays/nginx-ingress/resources/nginx_ingress.yaml - - Sample `Ingress` Resource: - ```yaml - apiVersion: networking.k8s.io/v1 - kind: Ingress - metadata: - name: catalogd-nginx-ingress - namespace: catalogd-system - annotations: - nginx.org/proxy-connect-timeout: "30s" - nginx.org/proxy-read-timeout: "20s" - nginx.org/client-max-body-size: "4m" - spec: - ingressClassName: nginx - rules: - - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: catalogd-catalogserver - port: - number: 80 - ``` - - -1. Once the `Ingress` object has been successfully created, issue a `curl` request. Below is an example `curl` request to retrieve all of the catalog contents: - + + To obtain `address` of the ingress object, you can run the below command and look for the value in the `ADDRESS` field from output: ```sh - $ curl http://localhost/catalogs/operatorhubio/all.json + $ kubectl -n catalogd-system get ingress ``` - + You can further use the `curl` commands outlined in the [Catalogd README](https://github.com/operator-framework/catalogd/blob/main/README.md) to filter out the JSON content by list of bundles, channels & packages. diff --git a/manifests/overlays/nginx-ingress/kustomization.yaml b/manifests/overlays/nginx-ingress/kustomization.yaml deleted file mode 100644 index 570ad9c3..00000000 --- a/manifests/overlays/nginx-ingress/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -resources: -- ../default -- resources/nginx_ingress.yaml -