oc-deploy/README.md

103 lines
3.3 KiB
Markdown
Raw Normal View History

2024-07-30 11:59:52 +02:00
# Purpose of this component
2024-07-30 11:56:24 +02:00
The purpose of oc-deploy, is to deploy all the OC components over a Kubernetes cluster.
An OpenCloud deployment is composed of the following layers:
2024-07-30 11:59:52 +02:00
OpenCloud components | <-- TODO
2024-07-30 11:56:24 +02:00
--------------------------
2024-07-30 11:59:52 +02:00
KubernetesCluster | <-- TODO
2024-07-30 11:56:24 +02:00
--------------------------
2024-07-30 11:59:52 +02:00
IaaS (VMs, LAN) | <-- pre-requisite
2024-07-30 11:56:24 +02:00
--------------------------
2024-07-30 11:59:52 +02:00
HW (network and servers) | <-- pre-requisite
2024-07-30 11:56:24 +02:00
--------------------------
It thus contains a first optional installation layer which deploys the Kubernetes nodes (control plane(s) and workers) above an existing infrastructure (Iaas).
Then the second installation layer uses Helm charts to deploy and configure all the OC components.
This documentation will be updated with the needed command and/or requirements to properly execute the installation.
2024-07-10 17:05:05 +02:00
# Deploy cluster
## For dev in Docker
Install brew
2023-11-02 15:51:57 +01:00
2024-07-10 17:05:05 +02:00
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install Talos
brew install siderolabs/tap/talosctl
talosctl cluster create
# Install helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
--------------------------
2024-07-10 17:05:05 +02:00
# Create OpenCloud Chart
# `oc-deploy` Component
The `oc-deploy` component aims to simplify and automate the deployment of OpenCloud components on a Kubernetes cluster through the creation of Helm Charts.
## Prerequisites:
- Access to the OpenCloud forge and the associated Harbor registry: [https://registry.o-forge.io/](https://registry.o-forge.io/), which will allow pulling OpenCloud release images from the "stable" project.
- To test the connection to this registry from the Docker client:
```bash
docker login registry.o-forge.io
```
- A Kubernetes cluster: Minikube, K3s, RKE2, etc. See `KubernetesCluster`.
- Helm installed locally
## **To Be Defined:**
### Configuring a Docker Secret for Kubernetes
Kubernetes needs to know your credentials to pull images from the "registry.o-forge.io" registry. Create a Docker secret in Kubernetes:
```bash
kubectl create secret docker-registry regcred \
--docker-server=registry.o-forge.io \
--docker-username=<your_username> \
--docker-password=<your_password> \
--docker-email=<your_email>
```
## Checking if Helm Recognizes Your Local Kubernetes Cluster:
### 1. Verify Connection to Kubernetes:
Before checking Helm, ensure that your `kubectl` is properly configured to connect to your local Kubernetes cluster.
Run the following command to see if you can communicate with the cluster:
```bash
kubectl get nodes
```
If this command returns the list of nodes in your cluster, it means `kubectl` is properly connected.
### 2. Verify Helm Configuration:
Now, you can check if Helm can access the cluster by using the following command:
```bash
helm version
```
This command displays the Helm version and the Kubernetes version it is connected to.
## Deploying with Helm:
You can deploy the `oc-deploy` Chart with Helm:
```bash
helm install oc-deploy path/to/your/Helm/oc-deploy
```
## Checking Helm Releases:
You can also list the existing releases to see if Helm is properly connected to the cluster:
```bash
helm list
```
If all these commands execute without errors and give the expected results, your Helm installation is correctly configured to recognize and interact with your local Kubernetes cluster