From 35111a936cdbb6e93f7ae23415e48f4107b24fe4 Mon Sep 17 00:00:00 2001 From: Horacio Gonzalez Date: Wed, 5 Feb 2025 17:36:48 +0100 Subject: [PATCH 1/8] Adding Clever Operator --- content/guides/_index.md | 1 + content/guides/clever-operator.md | 257 ++++++++++++++++++++++++++++++ data/icons.yaml | 1 + 3 files changed, 259 insertions(+) create mode 100644 content/guides/clever-operator.md diff --git a/content/guides/_index.md b/content/guides/_index.md index e02891faa..6f9b32cdd 100644 --- a/content/guides/_index.md +++ b/content/guides/_index.md @@ -77,4 +77,5 @@ llmsTxtOptional: true {{< card link="kibana" title="Customize Kibana" subtitle= "Deploy and customize a Kibana server on Clever Cloud" icon="kibana" >}} {{< card link="pgpool" title="Pgpool-II" subtitle= "How to configure and use Pgpool-II for PostgreSQL add-ons" icon="pg" >}} {{< card link="proxysql" title="ProxySQL" subtitle= "Configure and use ProxySQL for MySQL add-ons" icon="mysql" >}} + {{< card link="clever-operator" title="Clever Operator" subtitle= "Manage your Clever Cloud databases and addons seamlessly from Kubernetes" icon="kubernetes" >}} {{< /cards >}} diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md new file mode 100644 index 000000000..a189b43f4 --- /dev/null +++ b/content/guides/clever-operator.md @@ -0,0 +1,257 @@ +--- +title: Clever Operator +description: Manage your Clever Cloud databases and addons seamlessly from Kubernetes with Clever Operator. +tags: +- guides +keywords: +- Kubernetes +- operator +- databases +- crd +type: "docs" +comments: false +draft: false +--- + +## What's the Clever Operator + +The [Clever Operator](https://github.com/CleverCloud/clever-operator) is an open-source project designed to seamlessly integrate [Clever Cloud](https://www.clever-cloud.com/)’s managed services into Kubernetes environments. By leveraging Kubernetes [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions)), the Clever Operator enables developers to manage Clever Cloud resources directly from their Kubernetes clusters, aligning cloud-native practices with Clever Cloud’s powerful platform. + +Modern applications often require a combination of containerized workloads and managed services, such as databases or caches. Managing these resources separately across platforms can become complex and error-prone. The Clever Operator simplifies this process by acting as a bridge, allowing developers to define and interact with Clever Cloud’s resources using familiar Kubernetes paradigms. + +Key features of the Clever Operator include: + +- **Custom Resource Definitions (CRDs):** Extend Kubernetes capabilities to manage Clever Cloud services like PostgreSQL, Redis, and more. +- **Declarative Resource Management:** Use YAML manifests to declare and maintain the desired state of your services. +- **Seamless Integration:** Interact with Clever Cloud’s API securely and efficiently. +- **Scalability and Flexibility:** Manage resources across multiple namespaces with consistent configurations. + +This documentation will guide you through: + +- Installing and configuring the Clever Operator in your Kubernetes cluster. +- Managing Clever Cloud resources such as PostgreSQL and Redis through examples. + + +## Prerequisites + +Before you begin, ensure that you have the following tools and resources based on your intended actions: + +### To Build the Operator + +- **Git:** Clone the Clever Operator repository to access the source code. +- **Rust Toolchain:** Install the Rust programming language and its toolchain to compile the operator from source. Follow the installation guide at [https://rustup.rs/](https://rustup.rs/). +- **Docker:** Build container images for deploying the operator in Kubernetes. + +### To Deploy the Operator + +- **Kubernetes Cluster:** Ensure you have access to a running Kubernetes cluster. +- **Kubectl:** Install Kubernetes command-line tool for managing cluster resources Installation guide available at https://kubernetes.io/docs/tasks/tools/. +- **Clever Cloud Account Credentials:** Obtain API tokens and secrets from your Clever Cloud account to configure the operator. + +These prerequisites are essential for getting started with the Clever Operator, whether you're contributing to its development or deploying it in production. + +## Installation + +We suggest you to deploy the Clever Operator either directly from Dockerhub or using the Helm chart. + +### Deploying from DockerHub + +Applying the deployment scripts: + +```bash +kubectl apply -f https://raw.githubusercontent.com/CleverCloud/clever-operator/main/deployments/kubernetes/v1.24.0/10-custom-resource-definition.yaml +kubectl apply -f https://raw.githubusercontent.com/CleverCloud/clever-operator/main/deployments/kubernetes/v1.24.0/20-deployment.yaml +``` + + +### Installing via Helm Chart + +1. Configuring `values.yaml` in `deployments/kubernetes/helm` with your values. + +2. Installing the chart: + ```bash + helm install clever-operator -n clever-operator --create-namespace -f values.yaml . + ``` + + +### Building from Source + +1. Cloning the repository: + +```bash +git clone https://github.com/CleverCloud/clever-operator.git +cd clever-operator +``` + +2. Building the binary: + +```bash +make build +``` + + 3. Running the operator: + +```bash +target/release/clever-operator +``` + +### Building and Deploying the Docker Image + +1. Building the Docker image: + + ```bash + DOCKER_IMG=//clever-operator:latest make docker-build + ``` + +1. Pushing the image to your registry: + + ```bash + DOCKER_IMG=//clever-operator:latest make docker-push + ``` + +3. Updating the Kubernetes deployment script: + + Modify `deployments/kubernetes/v1.24.0/20-deployment.yaml` to use your Docker image. + +4. Deploying to Kubernetes: + ```bash + make deploy-kubernetes + ``` + + +## Configuration + +The Clever Operator requires configuration to connect to Clever Cloud's API and manage resources within your Kubernetes cluster. Configuration options are available at two levels: global (applies to all namespaces) and namespace-specific. + +For details on how to obtain these credentials, follow the instructions on the [How to obtain the credentials for the Clever Operator](./credentials.md) document. + +### Global Configuration + +Global configuration settings apply across all namespaces and are defined via environment variables or configuration files. + +- **Environment Variables:** + + - `CLEVER_OPERATOR_API_ENDPOINT`: The endpoint for the Clever Cloud API. + - `CLEVER_OPERATOR_API_TOKEN`: Your Clever Cloud API token. + - `CLEVER_OPERATOR_API_SECRET`: The secret associated with your API token. + - `CLEVER_OPERATOR_API_CONSUMER_KEY`: Your Clever Cloud consumer key + - `CLEVER_OPERATOR_API_CONSUMER_SECRET`: Your Clever Cloud consumer secret. + +- **Configuration Files:** By default, if the `--config` flag is not provided to the binary, the operator will look at the following locations to retrieve its configuration (in order of priority): + + 1. `/usr/share/clever-operator/config.{toml,yaml,json}` + 2. `/etc/clever-operator/config.{toml,yaml,json}` + 3. `$HOME/.config/clever-operator/config.{toml,yaml,json}` + 4. `$HOME/.local/share/clever-operator/config.{toml,yaml,json}` + 5. `config.{toml,yaml,json}` (in the current working directory) + + +### Namespace-Level Configuration + +Namespace-level configurations override the global settings for specific namespaces. They are defined using a Kubernetes Secret resource named `clever-operator` with the `config` key. + +- **Creating a Namespace-Level Configuration:** Create a Kubernetes Secret with the necessary configuration keys: + + ```yaml + apiVersion: v1 + kind: Secret + metadata: + name: clever-operator + namespace: my-namespace + data: + config: |- + api: + endpoint: "https://api.clever-cloud.com/v2" + token: "" + secret: "" + consumerKey: "" + consumerSecret: "" + proxy: + host: "proxy.example.com" + port: 8080 + ``` + +- **Applying the Configuration:** Apply the Secret to your namespace: + + ```bash + kubectl apply -f namespace-config.yaml + ``` + + +The operator automatically detects and applies namespace-specific configurations when interacting with resources in that namespace. + +### Validating Configuration + +To ensure your configuration is applied correctly, check the operator logs for any errors or warnings: + +```bash +kubectl logs -n clever-operator +``` + +## Usage Examples + +The Clever Operator enables you to manage Clever Cloud resources directly from your Kubernetes cluster using custom resources. Below are examples for PostgreSQL and Redis. + +### Managing PostgreSQL Resources + +- **Creating a PostgreSQL Instance:** Define a YAML manifest for the PostgreSQL resource: + + ```yaml + apiVersion: clever-cloud.com/v1 + kind: PostgreSQL + metadata: + name: my-postgresql + namespace: default + spec: + version: "14" + plan: "dev" + region: "par" + ``` + + Apply the manifest to your cluster: + + ```bash + kubectl apply -f postgresql.yaml + ``` + +- **Verifying the Deployment:** Check the status of the PostgreSQL resource: + + ```bash + kubectl get postgresql my-postgresql -o yaml + ``` + +- **Accessing PostgreSQL:** Retrieve the connection details from the Clever Cloud dashboard or the resource’s status field. + + +### Managing Redis Resources + +- **Creating a Redis Instance:** Define a YAML manifest for the Redis resource: + + ```yaml + apiVersion: clever-cloud.com/v1 + kind: Redis + metadata: + name: my-redis + namespace: default + spec: + version: "704" + plan: "dev" + region: "par" + ``` + + Apply the manifest to your cluster: + + ```bash + kubectl apply -f redis.yaml + ``` + +- **Verifying the Deployment:** Check the status of the Redis resource: + + ```bash + kubectl get redis my-redis -o yaml + ``` + +- **Accessing Redis:** Retrieve the connection details from the Clever Cloud dashboard or the resource’s status field. + +These examples demonstrate the simplicity and power of using the Clever Operator to manage cloud resources declaratively in Kubernetes. + diff --git a/data/icons.yaml b/data/icons.yaml index 9d4b507cf..1516e84cd 100644 --- a/data/icons.yaml +++ b/data/icons.yaml @@ -116,3 +116,4 @@ hugo: mdbook: nuxt: +kubernetes: From 444a854d0111fb22d8db78d0a51340e0db3cec93 Mon Sep 17 00:00:00 2001 From: Horacio Gonzalez Date: Wed, 5 Feb 2025 18:13:19 +0100 Subject: [PATCH 2/8] Adding terms to Vale accepted words list, fixing lint errors --- .../styles/config/vocabularies/Doc/accept.txt | 5 +++++ content/guides/clever-operator.md | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/styles/config/vocabularies/Doc/accept.txt b/.github/styles/config/vocabularies/Doc/accept.txt index a0aebdc19..b042e1d18 100644 --- a/.github/styles/config/vocabularies/Doc/accept.txt +++ b/.github/styles/config/vocabularies/Doc/accept.txt @@ -75,3 +75,8 @@ VSCode webroot Wildfly Zooper +CRDs +namespace +namespaces +Kubectl +toolchain \ No newline at end of file diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index a189b43f4..644f9fd01 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -15,7 +15,7 @@ draft: false ## What's the Clever Operator -The [Clever Operator](https://github.com/CleverCloud/clever-operator) is an open-source project designed to seamlessly integrate [Clever Cloud](https://www.clever-cloud.com/)’s managed services into Kubernetes environments. By leveraging Kubernetes [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions)), the Clever Operator enables developers to manage Clever Cloud resources directly from their Kubernetes clusters, aligning cloud-native practices with Clever Cloud’s powerful platform. +The [Clever Operator](https://github.com/CleverCloud/clever-operator) is an open source project designed to seamlessly integrate [Clever Cloud](https://www.clever-cloud.com/)’s managed services into Kubernetes environments. By leveraging Kubernetes [Custom Resource Definitions (CRDs)](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/#customresourcedefinitions)), the Clever Operator enables developers to manage Clever Cloud resources directly from their Kubernetes clusters, aligning cloud-native practices with Clever Cloud’s powerful platform. Modern applications often require a combination of containerized workloads and managed services, such as databases or caches. Managing these resources separately across platforms can become complex and error-prone. The Clever Operator simplifies this process by acting as a bridge, allowing developers to define and interact with Clever Cloud’s resources using familiar Kubernetes paradigms. @@ -26,7 +26,7 @@ Key features of the Clever Operator include: - **Seamless Integration:** Interact with Clever Cloud’s API securely and efficiently. - **Scalability and Flexibility:** Manage resources across multiple namespaces with consistent configurations. -This documentation will guide you through: +This documentation guide you through: - Installing and configuring the Clever Operator in your Kubernetes cluster. - Managing Clever Cloud resources such as PostgreSQL and Redis through examples. @@ -39,7 +39,7 @@ Before you begin, ensure that you have the following tools and resources based o ### To Build the Operator - **Git:** Clone the Clever Operator repository to access the source code. -- **Rust Toolchain:** Install the Rust programming language and its toolchain to compile the operator from source. Follow the installation guide at [https://rustup.rs/](https://rustup.rs/). +- **Rust toolchain:** Install the Rust programming language and its toolchain to compile the operator from source. Follow the installation guide at [https://rustup.rs/](https://rustup.rs/). - **Docker:** Build container images for deploying the operator in Kubernetes. ### To Deploy the Operator @@ -52,7 +52,7 @@ These prerequisites are essential for getting started with the Clever Operator, ## Installation -We suggest you to deploy the Clever Operator either directly from Dockerhub or using the Helm chart. +The simplest ways to deploy the Clever Operator are either directly from Docker Hub or using the Helm chart. ### Deploying from DockerHub @@ -137,7 +137,7 @@ Global configuration settings apply across all namespaces and are defined via en - `CLEVER_OPERATOR_API_CONSUMER_KEY`: Your Clever Cloud consumer key - `CLEVER_OPERATOR_API_CONSUMER_SECRET`: Your Clever Cloud consumer secret. -- **Configuration Files:** By default, if the `--config` flag is not provided to the binary, the operator will look at the following locations to retrieve its configuration (in order of priority): +- **Configuration Files:** By default, if the `--config` flag isn't provided to the binary, the operator looks at the following locations to retrieve its configuration (in order of priority): 1. `/usr/share/clever-operator/config.{toml,yaml,json}` 2. `/etc/clever-operator/config.{toml,yaml,json}` @@ -148,7 +148,7 @@ Global configuration settings apply across all namespaces and are defined via en ### Namespace-Level Configuration -Namespace-level configurations override the global settings for specific namespaces. They are defined using a Kubernetes Secret resource named `clever-operator` with the `config` key. +Namespace-level configurations override the global settings for specific namespaces. They're defined using a Kubernetes Secret resource named `clever-operator` with the `config` key. - **Creating a Namespace-Level Configuration:** Create a Kubernetes Secret with the necessary configuration keys: @@ -182,7 +182,7 @@ The operator automatically detects and applies namespace-specific configurations ### Validating Configuration -To ensure your configuration is applied correctly, check the operator logs for any errors or warnings: +To ensure your configuration is applied correctly, look at the operator logs for any errors or warnings: ```bash kubectl logs -n clever-operator @@ -253,5 +253,5 @@ The Clever Operator enables you to manage Clever Cloud resources directly from y - **Accessing Redis:** Retrieve the connection details from the Clever Cloud dashboard or the resource’s status field. -These examples demonstrate the simplicity and power of using the Clever Operator to manage cloud resources declaratively in Kubernetes. +These examples demonstrate the simplicity and power of using the Clever Operator to manage cloud resources in a declarative way in Kubernetes. From 2f484f6c23957136c10fcf241d0cfa74110351d9 Mon Sep 17 00:00:00 2001 From: Julia March <101819212+juliamrch@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:11:57 +0900 Subject: [PATCH 3/8] Update content/guides/clever-operator.md --- content/guides/clever-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index 644f9fd01..cca73a65c 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -46,7 +46,7 @@ Before you begin, ensure that you have the following tools and resources based o - **Kubernetes Cluster:** Ensure you have access to a running Kubernetes cluster. - **Kubectl:** Install Kubernetes command-line tool for managing cluster resources Installation guide available at https://kubernetes.io/docs/tasks/tools/. -- **Clever Cloud Account Credentials:** Obtain API tokens and secrets from your Clever Cloud account to configure the operator. +- **Clever Cloud Account Credentials:** [Obtain API tokens and secrets from your Clever Cloud]({{< ref "/api/howto" >}} "API Overview") account to configure the operator. These prerequisites are essential for getting started with the Clever Operator, whether you're contributing to its development or deploying it in production. From 2102eb0ad148b6f179ca14e3cd853107b5d9d9cf Mon Sep 17 00:00:00 2001 From: Julia March <101819212+juliamrch@users.noreply.github.com> Date: Fri, 7 Feb 2025 18:12:11 +0900 Subject: [PATCH 4/8] Update content/guides/clever-operator.md --- content/guides/clever-operator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index cca73a65c..89d9ff796 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -182,7 +182,7 @@ The operator automatically detects and applies namespace-specific configurations ### Validating Configuration -To ensure your configuration is applied correctly, look at the operator logs for any errors or warnings: +To ensure your configuration applies correctly, look at the operator logs for any errors or warnings: ```bash kubectl logs -n clever-operator From 23e30cb48b3005105b59523290f7d6231458f5ef Mon Sep 17 00:00:00 2001 From: Horacio Gonzalez Date: Mon, 10 Feb 2025 15:40:44 +0100 Subject: [PATCH 5/8] Updating installation instructions --- content/guides/clever-operator.md | 167 ++++++++++++++++++++---------- 1 file changed, 110 insertions(+), 57 deletions(-) diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index 89d9ff796..b77d02870 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -50,84 +50,140 @@ Before you begin, ensure that you have the following tools and resources based o These prerequisites are essential for getting started with the Clever Operator, whether you're contributing to its development or deploying it in production. +## Getting the credentials + +The Clever Operator requires configuration to connect to Clever Cloud's API and manage resources within your Kubernetes cluster. This configuration is based on four credentials: + +- _Consumer key_ +- _Consumer Secret_ +- _Token_ +- _Secret_ + +To obtain them, you need to connect to the Clever Cloud API, that has an OAuth1 based authentication. As explained in the [Clever Cloud API Overview](/api/howto), you need to create an OAuth consumer token in the Clever Cloud console, use it to obtain the _Consumer key and the _Consumer Secret_, and do the Oauth authentication dance to get the _Token_ and _Secret_. + + +> #### This seems cumbersome, is there an easier way? +> +> Yes the OAuth dance can be complicated, we created a small application that you can deploy on Clever Cloud. It will automate most of the pain away from you. +> +> The code and tutorial are on [https://github.com/CleverCloud/oauth-consumer-server](https://github.com/CleverCloud/oauth-consumer-server). + ## Installation The simplest ways to deploy the Clever Operator are either directly from Docker Hub or using the Helm chart. ### Deploying from DockerHub -Applying the deployment scripts: +1. Clone the repository: -```bash -kubectl apply -f https://raw.githubusercontent.com/CleverCloud/clever-operator/main/deployments/kubernetes/v1.24.0/10-custom-resource-definition.yaml -kubectl apply -f https://raw.githubusercontent.com/CleverCloud/clever-operator/main/deployments/kubernetes/v1.24.0/20-deployment.yaml -``` + ```bash + git clone https://github.com/CleverCloud/clever-operator/ + ``` +1. Insert your credentials into the manifests. -### Installing via Helm Chart + The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: + + ```yaml + apiVersion: v1 + kind: ConfigMap + metadata: + name: clever-operator-configuration + namespace: clever-operator-system + data: + config.toml: | + [api] + endpoint = "https://api.clever-cloud.com/v2" + token = "" + secret = "" + consumerKey = "" + consumerSecret = "" + ``` + + Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. -1. Configuring `values.yaml` in `deployments/kubernetes/helm` with your values. +1. Apply the manifests to deploy the operator. -2. Installing the chart: - ```bash - helm install clever-operator -n clever-operator --create-namespace -f values.yaml . + + ```bash + kubectl apply -f /deployments/kubernetes/v1.24.0/10-custom-resource-definition.yaml + kubectl apply -f /deployments/kubernetes/v1.24.0/20-deployment.yaml ``` +### Installing via Helm Chart -### Building from Source +1. Clone the repository: -1. Cloning the repository: + ```bash + git clone https://github.com/CleverCloud/clever-operator/ + ``` -```bash -git clone https://github.com/CleverCloud/clever-operator.git -cd clever-operator -``` +1. Configure your credentials in the `config` section of the file `values.yaml` in `deployments/kubernetes/helm`. -2. Building the binary: + ```yaml + config: + token: "" + secret: "" + consumerKey: "" + consumerSecret: "" + ``` + Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. -```bash -make build -``` +1. Install the chart: - 3. Running the operator: + ```bash + helm install clever-operator -n clever-operator --create-namespace -f values.yaml . + ``` -```bash -target/release/clever-operator -``` +### Building from Source -### Building and Deploying the Docker Image +1. Clone the repository: -1. Building the Docker image: + ```bash + git clone https://github.com/CleverCloud/clever-operator.git + cd clever-operator + ``` - ```bash - DOCKER_IMG=//clever-operator:latest make docker-build - ``` +1. Insert your credentials into the manifests. -1. Pushing the image to your registry: + The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: - ```bash - DOCKER_IMG=//clever-operator:latest make docker-push - ``` + ```yaml + apiVersion: v1 + kind: ConfigMap + metadata: + name: clever-operator-configuration + namespace: clever-operator-system + data: + config.toml: | + [api] + endpoint = "https://api.clever-cloud.com/v2" + token = "" + secret = "" + consumerKey = "" + consumerSecret = "" + ``` -3. Updating the Kubernetes deployment script: - - Modify `deployments/kubernetes/v1.24.0/20-deployment.yaml` to use your Docker image. + Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. -4. Deploying to Kubernetes: - ```bash - make deploy-kubernetes - ``` +1. Build the binary: + ```bash + make build + ``` -## Configuration +1. Running the operator: -The Clever Operator requires configuration to connect to Clever Cloud's API and manage resources within your Kubernetes cluster. Configuration options are available at two levels: global (applies to all namespaces) and namespace-specific. + ```bash + target/release/clever-operator + ``` -For details on how to obtain these credentials, follow the instructions on the [How to obtain the credentials for the Clever Operator](./credentials.md) document. +## Configuration +Configuration options are available at two levels: global (applies to all namespaces) and namespace-specific. ### Global Configuration -Global configuration settings apply across all namespaces and are defined via environment variables or configuration files. +Global configuration settings apply across all namespaces. Global configuration can be provided through a `ConfigMap`, a `Secret` or by the environment. - **Environment Variables:** @@ -156,19 +212,16 @@ Namespace-level configurations override the global settings for specific namespa apiVersion: v1 kind: Secret metadata: - name: clever-operator - namespace: my-namespace - data: - config: |- - api: - endpoint: "https://api.clever-cloud.com/v2" - token: "" - secret: "" - consumerKey: "" - consumerSecret: "" - proxy: - host: "proxy.example.com" - port: 8080 + name: clever-secret + namespace: + stringData: + config.toml: | + [api] + endpoint = "https://api.clever-cloud.com/v2" + token = + secret = + consumerKey = + consumerSecret = ``` - **Applying the Configuration:** Apply the Secret to your namespace: From 323df85c262ee96e5a4f2a200185e9e36c3081f8 Mon Sep 17 00:00:00 2001 From: Julia March <101819212+juliamrch@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:40:36 +0900 Subject: [PATCH 6/8] Update clever-operator.md --- content/guides/clever-operator.md | 36 ++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index fa75c287b..99dd7994b 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -74,15 +74,17 @@ The simplest ways to deploy the Clever Operator are either directly from Docker ### Deploying from DockerHub -1. Clone the repository: +{{% steps %}} + +#### Clone the repository ```bash git clone https://github.com/CleverCloud/clever-operator/ ``` -1. Insert your credentials into the manifests. +#### Insert your credentials into the manifests - The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: +The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: ```yaml apiVersion: v1 @@ -102,23 +104,26 @@ The simplest ways to deploy the Clever Operator are either directly from Docker Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. -1. Apply the manifests to deploy the operator. - +#### Apply the manifests to deploy the operator - ```bash + ```bash kubectl apply -f /deployments/kubernetes/v1.24.0/10-custom-resource-definition.yaml kubectl apply -f /deployments/kubernetes/v1.24.0/20-deployment.yaml ``` +{{% /steps %}} + ### Installing via Helm Chart -1. Clone the repository: +{{% steps %}} + +#### Clone the repository ```bash git clone https://github.com/CleverCloud/clever-operator/ ``` -1. Configure your credentials in the `config` section of the file `values.yaml` in `deployments/kubernetes/helm`. +#### Configure your credentials in the `config` section of the file `values.yaml` in `deployments/kubernetes/helm` ```yaml config: @@ -129,22 +134,26 @@ The simplest ways to deploy the Clever Operator are either directly from Docker ``` Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. -1. Install the chart: +#### Install the chart: ```bash helm install clever-operator -n clever-operator --create-namespace -f values.yaml . ``` +{{% /steps %}} + ### Building from Source -1. Clone the repository: +{{% steps %}} + +#### Clone the repository ```bash git clone https://github.com/CleverCloud/clever-operator.git cd clever-operator ``` -1. Insert your credentials into the manifests. +#### Insert your credentials into the manifests. The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: @@ -166,13 +175,13 @@ The simplest ways to deploy the Clever Operator are either directly from Docker Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. -1. Build the binary: +#### Build the binary: ```bash make build ``` -1. Running the operator: +#### Running the operator: ```bash target/release/clever-operator @@ -181,6 +190,7 @@ The simplest ways to deploy the Clever Operator are either directly from Docker ## Configuration Configuration options are available at two levels: global (applies to all namespaces) and namespace-specific. + ### Global Configuration Global configuration settings apply across all namespaces. Global configuration can be provided through a `ConfigMap`, a `Secret` or by the environment. From e5c67ec6f3c0535383326bdaf1074125fa179c9c Mon Sep 17 00:00:00 2001 From: Julia March <101819212+juliamrch@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:48:14 +0900 Subject: [PATCH 7/8] style: use steps shortcode --- content/guides/clever-operator.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index 99dd7994b..a2644fbee 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -186,6 +186,7 @@ The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `Conf ```bash target/release/clever-operator ``` +{{% /steps %}} ## Configuration From 71c523314ca6daf8e3e9d825cd8a2521ae639ad7 Mon Sep 17 00:00:00 2001 From: Julia March <101819212+juliamrch@users.noreply.github.com> Date: Thu, 13 Feb 2025 23:58:25 +0900 Subject: [PATCH 8/8] fix: code blocks --- content/guides/clever-operator.md | 131 +++++++++++++++--------------- 1 file changed, 66 insertions(+), 65 deletions(-) diff --git a/content/guides/clever-operator.md b/content/guides/clever-operator.md index a2644fbee..e58d1339b 100644 --- a/content/guides/clever-operator.md +++ b/content/guides/clever-operator.md @@ -78,38 +78,37 @@ The simplest ways to deploy the Clever Operator are either directly from Docker #### Clone the repository - ```bash - git clone https://github.com/CleverCloud/clever-operator/ - ``` +```bash +git clone https://github.com/CleverCloud/clever-operator/ +``` #### Insert your credentials into the manifests The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: clever-operator-configuration + namespace: clever-operator-system + data: + config.toml: | + [api] + endpoint = "https://api.clever-cloud.com/v2" + token = "" + secret = "" + consumerKey = "" + consumerSecret = "" +``` - ```yaml - apiVersion: v1 - kind: ConfigMap - metadata: - name: clever-operator-configuration - namespace: clever-operator-system - data: - config.toml: | - [api] - endpoint = "https://api.clever-cloud.com/v2" - token = "" - secret = "" - consumerKey = "" - consumerSecret = "" - ``` - - Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. +Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. #### Apply the manifests to deploy the operator - ```bash - kubectl apply -f /deployments/kubernetes/v1.24.0/10-custom-resource-definition.yaml - kubectl apply -f /deployments/kubernetes/v1.24.0/20-deployment.yaml - ``` +```bash +kubectl apply -f /deployments/kubernetes/v1.24.0/10-custom-resource-definition.yaml +kubectl apply -f /deployments/kubernetes/v1.24.0/20-deployment.yaml +``` {{% /steps %}} @@ -119,26 +118,27 @@ The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `Conf #### Clone the repository - ```bash - git clone https://github.com/CleverCloud/clever-operator/ - ``` +```bash +git clone https://github.com/CleverCloud/clever-operator/ +``` #### Configure your credentials in the `config` section of the file `values.yaml` in `deployments/kubernetes/helm` - ```yaml - config: - token: "" - secret: "" - consumerKey: "" - consumerSecret: "" - ``` - Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. +```yaml + config: + token: "" + secret: "" + consumerKey: "" + consumerSecret: "" +``` + +Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. #### Install the chart: - ```bash - helm install clever-operator -n clever-operator --create-namespace -f values.yaml . - ``` +```bash +helm install clever-operator -n clever-operator --create-namespace -f values.yaml . +``` {{% /steps %}} @@ -148,44 +148,45 @@ The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `Conf #### Clone the repository - ```bash - git clone https://github.com/CleverCloud/clever-operator.git - cd clever-operator - ``` +```bash +git clone https://github.com/CleverCloud/clever-operator.git +cd clever-operator +``` #### Insert your credentials into the manifests. - The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: +The manifests are on folder `/deployments/kubernetes/v1.24.0/`. Modify the `ConfigMap` object in file `/deployments/kubernetes/v1.24.0/: - ```yaml - apiVersion: v1 - kind: ConfigMap - metadata: - name: clever-operator-configuration - namespace: clever-operator-system - data: - config.toml: | - [api] - endpoint = "https://api.clever-cloud.com/v2" - token = "" - secret = "" - consumerKey = "" - consumerSecret = "" - ``` +```yaml +apiVersion: v1 +kind: ConfigMap +metadata: + name: clever-operator-configuration + namespace: clever-operator-system + data: + config.toml: | + [api] + endpoint = "https://api.clever-cloud.com/v2" + token = "" + secret = "" + consumerKey = "" + consumerSecret = "" +``` - Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. +Replacing ``, ``, `` and `` by the credentials obtained in the precedent section. #### Build the binary: - ```bash - make build - ``` +```bash +make build +``` #### Running the operator: - ```bash - target/release/clever-operator - ``` +```bash +target/release/clever-operator +``` + {{% /steps %}} ## Configuration