generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #690 from Danil-Grigorev/document-oci
📖 Document OCI source usage, publish and preload subcommands
- Loading branch information
Showing
6 changed files
with
349 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,3 @@ | ||
# Plugin installation | ||
|
||
The `cluster-api-operator` plugin can be installed using krew, the kubectl plugin manager. | ||
|
||
## Prerequisites | ||
|
||
[krew][] installed on your system. See the krew installation guide for instructions. | ||
|
||
[krew]: [https://krew.sigs.k8s.io/docs/user-guide/setup/install/] | ||
|
||
## Steps | ||
|
||
1. Add the cluster-api-operator plugin index to krew: | ||
```bash | ||
kubectl krew index add operator https://github.com/kubernetes-sigs/cluster-api-operator.git | ||
``` | ||
|
||
2. Install the cluster-api-operator plugin: | ||
```bash | ||
kubectl krew install operator/clusterctl-operator | ||
``` | ||
|
||
3. Verify the installation: | ||
```bash | ||
kubectl operator | ||
``` | ||
|
||
This should print help information for the kubectl operator plugin. | ||
|
||
The `cluster-api-operator` plugin is now installed and ready to use with `kubectl`. | ||
|
||
### Optionally: installing as a `clusterctl` plugin | ||
Typically the plugin is installed under `~/.krew/bin/kubectl-operator`, which would be present under your `$PATH` after correct `krew` installation. If you want to use plugin with `clusterctl`, you need to rename this file to be prefixed with `clusterctl-` instead, like so: | ||
```bash | ||
cp ~/.krew/bin/kubectl-operator ~/.krew/bin/clusterctl-operator | ||
``` | ||
|
||
After that plugin is available to use as a `clusterctl` plugin: | ||
```bash | ||
clusterctl operator --help | ||
``` | ||
|
||
## Upgrade | ||
|
||
To upgrade your plugin with the new release of `cluster-api-operator` you will need to run: | ||
|
||
```bash | ||
kubectl krew upgrade | ||
``` | ||
Please refer to [plugin installation](../03_topics/03_plugin/01_installation.md) section. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Plugin | ||
|
||
This section descibes plugin commands with usage and examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Plugin installation | ||
|
||
The `cluster-api-operator` plugin can be installed using krew, the kubectl plugin manager. | ||
|
||
## Prerequisites | ||
|
||
[krew][] installed on your system. See the krew installation guide for instructions. | ||
|
||
[krew]: [https://krew.sigs.k8s.io/docs/user-guide/setup/install/] | ||
|
||
## Steps | ||
|
||
1. Add the cluster-api-operator plugin index to krew: | ||
```bash | ||
kubectl krew index add operator https://github.com/kubernetes-sigs/cluster-api-operator.git | ||
``` | ||
|
||
2. Install the cluster-api-operator plugin: | ||
```bash | ||
kubectl krew install operator/clusterctl-operator | ||
``` | ||
|
||
3. Verify the installation: | ||
```bash | ||
kubectl operator | ||
``` | ||
|
||
This should print help information for the kubectl operator plugin. | ||
|
||
The `cluster-api-operator` plugin is now installed and ready to use with `kubectl`. | ||
|
||
### Optionally: installing as a `clusterctl` plugin | ||
Typically the plugin is installed under `~/.krew/bin/kubectl-operator`, which would be present under your `$PATH` after correct `krew` installation. If you want to use plugin with `clusterctl`, you need to rename this file to be prefixed with `clusterctl-` instead, like so: | ||
```bash | ||
cp ~/.krew/bin/kubectl-operator ~/.krew/bin/clusterctl-operator | ||
``` | ||
|
||
After that plugin is available to use as a `clusterctl` plugin: | ||
```bash | ||
clusterctl operator --help | ||
``` | ||
|
||
## Upgrade | ||
|
||
To upgrade your plugin with the new release of `cluster-api-operator` you will need to run: | ||
|
||
```bash | ||
kubectl krew upgrade | ||
``` |
77 changes: 77 additions & 0 deletions
77
docs/book/src/03_topics/03_plugin/02_preload_subcommand.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Using the `preload` Plugin for Kubernetes Operator | ||
|
||
## Overview | ||
|
||
The `preload` subcommand allows users to preload provider `ConfigMaps` into a management cluster from an OCI (Open Container Initiative) artifact, known provider source, or URL override. Users can supply any number of provider stings or discover and use existing provider manifests from the cluster. | ||
|
||
## Command Syntax | ||
The basic syntax for using the `preload` command is: | ||
|
||
```sh | ||
kubectl operator preload [flags] | ||
``` | ||
|
||
## Flags and Options | ||
| Flag | Short | Description | | ||
|------|-------|-------------| | ||
| `--kubeconfig` | | Path to the kubeconfig file for the source management cluster. Uses default discovery rules if unspecified. | | ||
| `--existing` | `-e` | Discover all providers in the cluster and prepare `ConfigMap` for each of them. | | ||
| `--core` | | Specifies the core provider and version (e.g., `cluster-api:v1.1.5`). Defaults to the latest release. | | ||
| `--infrastructure` | `-i` | Specifies infrastructure providers and versions (e.g., `aws:v0.5.0`). | | ||
| `--bootstrap` | `-b` | Specifies bootstrap providers and versions (e.g., `kubeadm:v1.1.5`). | | ||
| `--control-plane` | `-c` | Specifies control plane providers and versions (e.g., `kubeadm:v1.1.5`). | | ||
| `--ipam` | | Specifies IPAM providers and versions (e.g., `infoblox:v0.0.1`). | | ||
| `--runtime-extension` | | Specifies runtime extension providers and versions (e.g., `my-extension:v0.0.1`). | | ||
| `--addon` | | Specifies add-on providers and versions (e.g., `helm:v0.1.0`). | | ||
| `--target-namespace` | `-n` | Specifies the target namespace where the operator should be deployed. Defaults to `capi-operator-system`. | | ||
| `--artifact-url` | `-u` | Specifies the URL of the OCI artifact containing component manifests. | | ||
|
||
## Examples | ||
|
||
### Load CAPI Operator Manifests from an OCI Source | ||
```sh | ||
kubectl operator preload --core cluster-api | ||
``` | ||
This command loads the `cluster-api` core provider manifests into the management cluster. If no version is specified, the latest release is used. | ||
|
||
### Load CAPI Operator Manifests from Existing Providers in the Cluster | ||
```sh | ||
kubectl operator preload -e | ||
``` | ||
This command discovers all existing providers in the cluster and prepares ConfigMaps containing their manifests. | ||
|
||
### Prepare Provider ConfigMap from OCI for a Specific Infrastructure Provider | ||
```sh | ||
kubectl operator preload --infrastructure=aws -u my-registry.example.com/infrastructure-provider | ||
``` | ||
This command fetches the latest available version of the `aws` infrastructure provider from the specified OCI registry and creates a ConfigMap. | ||
|
||
### Prepare Provider ConfigMap with a Specific Version | ||
```sh | ||
kubectl operator preload --infrastructure=aws::v2.3.0 -u my-registry.example.com/infrastructure-provider | ||
``` | ||
This command loads the AWS infrastructure provider version `v2.3.0` from the OCI registry into the default namespace. | ||
|
||
### Prepare Provider ConfigMap with a Custom Namespace | ||
```sh | ||
kubectl operator preload --infrastructure=aws:custom-namespace -u my-registry.example.com/infrastructure-provider | ||
``` | ||
This command loads the latest version of the AWS infrastructure provider into the `custom-namespace`. | ||
|
||
### Prepare Provider ConfigMap with a Specific Version and Namespace | ||
```sh | ||
kubectl operator preload --infrastructure=aws:custom-namespace:v2.3.0 -u my-registry.example.com/infrastructure-provider | ||
``` | ||
This command loads AWS provider version `v2.3.0` into `custom-namespace`. | ||
|
||
### Prepare Provider ConfigMap for Multiple Infrastructure Providers | ||
```sh | ||
kubectl operator preload --infrastructure=aws --infrastructure=vsphere -u my-registry.example.com/infrastructure-provider | ||
``` | ||
This command fetches and loads manifests for both AWS and vSphere infrastructure providers from the OCI registry. | ||
|
||
### Prepare Provider ConfigMap with a Custom Target Namespace | ||
```sh | ||
kubectl operator preload --infrastructure aws --target-namespace foo -u my-registry.example.com/infrastructure-provider | ||
``` | ||
This command loads the AWS infrastructure provider into the `foo` namespace, ensuring that the operator uses a customized deployment location. |
Oops, something went wrong.