Skip to content

Commit

Permalink
Update README and docs for HTTPS
Browse files Browse the repository at this point in the history
  • Loading branch information
trgeiger committed May 13, 2024
1 parent 8376ca4 commit 0d46314
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ Catalogd helps customers discover installable content by hosting catalog metadat
[![asciicast](https://asciinema.org/a/624043.svg)](https://asciinema.org/a/624043)

## Quickstart Steps
**NOTE:** Procedure steps marked with an asterisk (`*`) are likely to change with future API updates.
Procedure steps marked with an asterisk (`*`) are likely to change with future API updates.

**NOTE:** The examples below use the `-k` flag in curl to skip validating the TLS certificates. This is for demonstration purposes only.

1. To install catalogd, navigate to the [releases](https://github.com/operator-framework/catalogd/releases/) page, and follow the install instructions included in the release you want to install.

Expand Down Expand Up @@ -95,13 +97,13 @@ Catalogd helps customers discover installable content by hosting catalog metadat
1. Port forward the `catalogd-catalogserver` service in the `catalogd-system` namespace:
```sh
$ kubectl -n catalogd-system port-forward svc/catalogd-catalogserver 8080:80
$ kubectl -n catalogd-system port-forward svc/catalogd-catalogserver 8080:443
```
1. Run the following command to get a list of packages:
```sh
$ curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.package") | .name'
$ curl -k https://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.package") | .name'
```
*Example output*
Expand All @@ -128,7 +130,7 @@ Catalogd helps customers discover installable content by hosting catalog metadat
1. Run the following command to get a list of channels for the `ack-acm-controller` package:
```sh
$ curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.channel") | select(.package == "ack-acm-controller") | .name'
$ curl -k https://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.channel") | select(.package == "ack-acm-controller") | .name'
```
*Example output*
Expand All @@ -142,7 +144,7 @@ Catalogd helps customers discover installable content by hosting catalog metadat
1. Run the following command to get a list of bundles belonging to the `ack-acm-controller` package:
```sh
$ curl http://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.bundle") | select(.package == "ack-acm-controller") | .name'
$ curl -k https://localhost:8080/catalogs/operatorhubio/all.json | jq -s '.[] | select(.schema == "olm.bundle") | select(.package == "ack-acm-controller") | .name'
```
*Example output*
Expand Down
18 changes: 11 additions & 7 deletions docs/fetching-catalog-contents.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Fetching `Catalog` contents from the Catalogd HTTP Server
This document covers how to fetch the contents for a `Catalog` from the
Catalogd HTTP Server that runs when the `HTTPServer` feature-gate is enabled
Catalogd HTTP(S) Server that runs when the `HTTPServer` feature-gate is enabled
(enabled by default).

For example purposes we make the following assumption:
- A `Catalog` named `operatorhubio` has been created and successfully unpacked
(denoted in the `Catalog.Status`)

**NOTE:** By default, Catalogd is configured to use TLS with self-signed certificates for demonstration purposes.
For local development, consider skipping TLS verification, such as `curl -k`, or reference external material
on self-signed certificate verification.

`Catalog` CRs have a status.contentURL field whose value is the location where the content
of a catalog can be read from:

Expand All @@ -18,7 +22,7 @@ of a catalog can be read from:
reason: UnpackSuccessful
status: "True"
type: Unpacked
contentURL: http://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json
contentURL: https://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json
phase: Unpacked
resolvedSource:
image:
Expand All @@ -34,11 +38,11 @@ object.

When making a request for the contents of the `operatorhubio` `Catalog` from within
the cluster issue a HTTP `GET` request to
`http://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json`
`https://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json`

An example command to run a `Pod` to `curl` the catalog contents:
```sh
kubectl run fetcher --image=curlimages/curl:latest -- curl http://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json
kubectl run fetcher --image=curlimages/curl:latest -- curl https://catalogd-catalogserver.catalogd-system.svc/catalogs/operatorhubio/all.json
```

## Off cluster
Expand All @@ -47,11 +51,11 @@ When making a request for the contents of the `operatorhubio` `Catalog` from out
the cluster, we have to perform an extra step:
1. Port forward the `catalogd-catalogserver` service in the `catalogd-system` namespace:
```sh
kubectl -n catalogd-system port-forward svc/catalogd-catalogserver 8080:80
kubectl -n catalogd-system port-forward svc/catalogd-catalogserver 8080:443
```

Once the service has been successfully forwarded to a localhost port, issue a HTTP `GET`
request to `http://localhost:8080/catalogs/operatorhubio/all.json`
request to `https://localhost:8080/catalogs/operatorhubio/all.json`

An example `curl` request that assumes the port-forwarding is mapped to port 8080 on the local machine:
```sh
Expand Down Expand Up @@ -126,7 +130,7 @@ This section outlines a way of exposing the `Catalogd` Service's endpoints outsi
1. Run the below example `curl` request to retrieve all of the catalog contents:
```sh
$ curl http://<address>/catalogs/operatorhubio/all.json
$ curl https://<address>/catalogs/operatorhubio/all.json
```
To obtain `address` of the ingress object, you can run the below command and look for the value in the `ADDRESS` field from output:
Expand Down

0 comments on commit 0d46314

Please sign in to comment.