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

📖 Document how to configure global pull secrets #1410

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
17 changes: 16 additions & 1 deletion docs/css/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,19 @@
.md-nav__item--active > .md-nav__link, /* Active top-level items */
.md-nav__item--nested > .md-nav__link { /* Nested top-level items */
font-weight: bold;
}
}

.tags-list {
list-style: none;
padding: 0;
}

.tag {
display: inline-block;
background-color: red;
border-radius: 3px;
padding: 2px 8px;
margin: 2px;
font-size: 0.9em;
color: white;
}
53 changes: 53 additions & 0 deletions docs/howto/configure-global-pull-secrets.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
tags:
- alpha
---

# Configure global pull secrets for allowing components to pull private images
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Configure global pull secrets for allowing components to pull private images
# Configure global pull secrets for allowing components to pull from private registries

I think it would be more clearer to use the term "private registries" instead of "private images," as the authentication is specifically for accessing the registry where images are hosted, right?


**Note: The UX for how auth info for using private images is provided is an active work in progress.**
Copy link
Contributor

@camilamacedo86 camilamacedo86 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Note: The UX for how auth info for using private images is provided is an active work in progress.**
**Note: The UX for providing authentication details for private registry images is an active work in progress.**

same ^


To configure `catalogd` and `operator-controller` to use authentication information for pulling private images (catalog/bundle images etc), the components can be informed about a kubernetes `Secret` object that contains the relevant auth information. The `Secret` must be of type `kubernetes.io/dockerconfigjson`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To configure `catalogd` and `operator-controller` to use authentication information for pulling private images (catalog/bundle images etc), the components can be informed about a kubernetes `Secret` object that contains the relevant auth information. The `Secret` must be of type `kubernetes.io/dockerconfigjson`.
To allow [catalogd](https://github.com/operator-framework/catalogd) and [operator-controller](https://github.com/operator-framework/operator-controller) to authenticate and pull images from a private registry (for catalog/bundle images, etc.), you need to provide these components with a Kubernetes `Secret` object containing the necessary credentials. The `Secret` must be of type [`kubernetes.io/dockerconfigjson`](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#registry-secret-existing-credentials).
  • The correct term would be "private registry," right, not "images"?
  • Additionally, wdyt about adding links to both project repositories for catalogd and operator-controller?
  • wdyt about including a reference to the Kubernetes documentation on kubernetes.io/dockerconfigjson secrets for further guidance?


Once the `Secret` is created, `catalogd` and `operator-controller` needs to be redeployed with an additional field, `--global-pull-secret=<secret-namespace>/<secret-name>` passed to the respective binaries.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Once the `Secret` is created, `catalogd` and `operator-controller` needs to be redeployed with an additional field, `--global-pull-secret=<secret-namespace>/<secret-name>` passed to the respective binaries.
Once the `Secret` is created, `catalogd` and `operator-controller` needs to be redeployed with an additional flag, --global-pull-secret=<secret-namespace>/<secret-name>, to pass the registry credentials to the respective binaries.


For eg, create a `Secret` using locally available `config.json`:
Copy link
Contributor

@camilamacedo86 camilamacedo86 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For eg, create a `Secret` using locally available `config.json`:
For example, to create a `Secret` using locally available `config.json` for the private registry:


```sh
$ kubectl create secret docker-registry test-secret \
--from-file=.dockerconfigjson=$HOME/.docker/config.json \
--namespace olmv1-system
secret/test-secret created
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we include the output of the command? Adding it might make it harder for users to copy, paste, and use the command directly, right?

```

Verify that the Secret is created:

```sh
$ kubectl get secret test-secret -n olmv1-system -o yaml
apiVersion: v1
data:
.dockerconfigjson: ewogICJh....
kind: Secret
metadata:
creationTimestamp: "2024-10-25T12:05:46Z"
name: test-secret
namespace: olmv1-system
resourceVersion: "237734"
uid: 880138f1-5d98-4bb0-9e45-45e8ebaff647
type: kubernetes.io/dockerconfigjson
```

Modify the `config/base/manager/manager.yaml` file for `catalogd` and `operator-controller` to include the new field in the binary args:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Modify the `config/base/manager/manager.yaml` file for `catalogd` and `operator-controller` to include the new field in the binary args:
Modify the `config/base/manager/manager.yaml` file for `catalogd` and `operator-controller` to include the new flag in the binary args:


```yaml
- command:
- ./manager
args:
- ...
- ...
- ...
- --global-pull-secret=olmv1-system/test-secret
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we edit the deployment directly, we need to re-install.
Then, if we run make run we will lose what was done above
Also, it does not seems a valid approach for end users

So, I think we need say here to:

kubectl patch deployment operator-controller-controller-manager -n olmv1-system --type=json -p='[
  {
    "op": "add",
    "path": "/spec/template/spec/containers/0/args/-",
    "value": "--global-pull-secret=olmv1-system/test-secret"
  }
]'

```

With the above configuration, creating a `ClusterCatalog` or a `ClusterExention` whose content is packaged in a private container image hosted in an image registry, will become possible.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
With the above configuration, creating a `ClusterCatalog` or a `ClusterExention` whose content is packaged in a private container image hosted in an image registry, will become possible.
With the above configuration, creating a `ClusterCatalog` or a `ClusterExention` whose content is packaged in a container image hosted in an private registry, will become possible.

is the registry which is private right?


14 changes: 14 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% extends "base.html" %}

{% block content %}
<div class="tags">
{% if page.meta.tags %}
<ul class="tags-list">
{% for tag in page.meta.tags %}
<li class="tag">{{ tag }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{{ super() }}
{% endblock %}
2 changes: 2 additions & 0 deletions docs/tutorials/install-extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ After you add a catalog to your cluster, you can install an extension by creatin
* The name, and optionally version, or channel, of the [supported extension](../project/olmv1_limitations.md) to be installed
* An existing namespace in which to install the extension

**Note** To install ClusterExentions that are shipped as private container images hosted in an image registry, please see [How to conifgure global pull secrets](../howto/configure-global-pull-secrets.md).
Copy link
Contributor

@camilamacedo86 camilamacedo86 Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Note** To install ClusterExentions that are shipped as private container images hosted in an image registry, please see [How to conifgure global pull secrets](../howto/configure-global-pull-secrets.md).
**Note** To install `ClusterExentions` that are shipped as container images hosted in an private registry, please see the HowTo [Configure global pull secrets for allowing components to pull from private registries](../howto/configure-global-pull-secrets.md).

Just to match the title


### ServiceAccount for ClusterExtension Installation and Management

Adhering to OLM v1's "Secure by Default" tenet, OLM v1 does not have the permissions
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ site_name: Operator Lifecycle Manager
theme:
logo: assets/logo.svg
name: "material"
custom_dir: docs/overrides
palette:
primary: black
features:
Expand Down Expand Up @@ -36,6 +37,7 @@ nav:
- Uninstall an Extension: tutorials/uninstall-extension.md
- How-To Guides:
- Catalog queries: howto/catalog-queries.md
- Configure Global pull secrets: howto/configure-global-pull-secrets.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Configure Global pull secrets: howto/configure-global-pull-secrets.md
- Configure global pull secrets to pull from private registries: howto/configure-global-pull-secrets.md

maybe a little more informative wdyt?

- Channel-Based Upgrades: howto/how-to-channel-based-upgrades.md
- Version Pinning: howto/how-to-pin-version.md
- Version Range Upgrades: howto/how-to-version-range-upgrades.md
Expand Down