From 1a83fa1035326edaabd78c01303a5f393edaad2b Mon Sep 17 00:00:00 2001 From: Sergey Shevchenko Date: Wed, 27 Mar 2024 20:41:04 +0200 Subject: [PATCH 1/4] feat: Add quickstart page --- site/content/en/docs/v0.1/quickstart.md | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 site/content/en/docs/v0.1/quickstart.md diff --git a/site/content/en/docs/v0.1/quickstart.md b/site/content/en/docs/v0.1/quickstart.md new file mode 100644 index 00000000..c1a15dab --- /dev/null +++ b/site/content/en/docs/v0.1/quickstart.md @@ -0,0 +1,29 @@ +--- +title: Quickstart +weight: 0 +description: Get etcd with etcd-operator up and running in less than 5 minutes! +--- + +Follow these instructions to install, run, and test etcd with etcd-operator in a Kubernetes cluster. + +Pre-requisites: +- [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +- Kubernetes cluster and `kubectl` configured to use it + - If you don't have a Kubernetes cluster, you can use [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) to create a local one + +1. Install etcd-operator: + ```bash + kustomize build 'https://github.com/aenix-io/etcd-operator//config/default?ref=main' | kubectl apply -n etcd-operator -f - + ``` +2. Check the operator is running: + ```bash + kubectl get pods -n etcd-operator -l control-plane=controller-manager + ``` +3. Create an etcd cluster: + ```bash + kubectl apply -f https://raw.githubusercontent.com/aenix-io/etcd-operator/main/config/samples/etcd_v1alpha1_etcdcluster.yaml + ``` +4. Check the etcd cluster is running: + ```bash + kubectl get pods -l app.kubernetes.io/managed-by=etcd-operator + ``` From a9b78a8549b2225e808a6341da769b41748f1c51 Mon Sep 17 00:00:00 2001 From: Kirill Ilin Date: Sun, 31 Mar 2024 15:45:23 +0500 Subject: [PATCH 2/4] add pre-requisites and caution message --- site/content/en/docs/v0.1/quickstart.md | 10 +++++++--- site/docker-compose.yaml | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/site/content/en/docs/v0.1/quickstart.md b/site/content/en/docs/v0.1/quickstart.md index c1a15dab..f1d6fa50 100644 --- a/site/content/en/docs/v0.1/quickstart.md +++ b/site/content/en/docs/v0.1/quickstart.md @@ -8,21 +8,25 @@ Follow these instructions to install, run, and test etcd with etcd-operator in a Pre-requisites: - [kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) +- [kustomize](https://github.com/kubernetes-sigs/kustomize) - Kubernetes cluster and `kubectl` configured to use it - If you don't have a Kubernetes cluster, you can use [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) to create a local one +- cert-manager installed in the cluster 1. Install etcd-operator: ```bash - kustomize build 'https://github.com/aenix-io/etcd-operator//config/default?ref=main' | kubectl apply -n etcd-operator -f - + kustomize build 'https://github.com/aenix-io/etcd-operator//config/default?ref=main' | kubectl apply -f - ``` 2. Check the operator is running: ```bash - kubectl get pods -n etcd-operator -l control-plane=controller-manager + kubectl get pods -n etcd-operator-system -l control-plane=controller-manager ``` 3. Create an etcd cluster: ```bash - kubectl apply -f https://raw.githubusercontent.com/aenix-io/etcd-operator/main/config/samples/etcd_v1alpha1_etcdcluster.yaml + kubectl apply -f https://raw.githubusercontent.com/aenix-io/etcd-operator/main/config/samples/etcd.aenix.io_v1alpha1_etcdcluster.yaml ``` + **Caution**: by default emptyDir storage is used. It means such cluster configuration is not intended for long-term storage. + 4. Check the etcd cluster is running: ```bash kubectl get pods -l app.kubernetes.io/managed-by=etcd-operator diff --git a/site/docker-compose.yaml b/site/docker-compose.yaml index 9069dc06..72359166 100644 --- a/site/docker-compose.yaml +++ b/site/docker-compose.yaml @@ -4,6 +4,7 @@ services: site: image: docsy/docsy-example + platform: linux/amd64 build: context: . command: server From ee93cdd6228b656b4c7595a48e6c0e2c0d390d37 Mon Sep 17 00:00:00 2001 From: Kirill Ilin Date: Sun, 31 Mar 2024 16:13:43 +0500 Subject: [PATCH 3/4] add link to cert-manager, change link to github raw --- site/content/en/docs/v0.1/quickstart.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/site/content/en/docs/v0.1/quickstart.md b/site/content/en/docs/v0.1/quickstart.md index f1d6fa50..31e7fd62 100644 --- a/site/content/en/docs/v0.1/quickstart.md +++ b/site/content/en/docs/v0.1/quickstart.md @@ -11,7 +11,7 @@ Pre-requisites: - [kustomize](https://github.com/kubernetes-sigs/kustomize) - Kubernetes cluster and `kubectl` configured to use it - If you don't have a Kubernetes cluster, you can use [kind](https://kind.sigs.k8s.io/docs/user/quick-start/) to create a local one -- cert-manager installed in the cluster +- [cert-manager](https://cert-manager.io/docs/installation/) installed in the cluster 1. Install etcd-operator: ```bash @@ -23,7 +23,7 @@ Pre-requisites: ``` 3. Create an etcd cluster: ```bash - kubectl apply -f https://raw.githubusercontent.com/aenix-io/etcd-operator/main/config/samples/etcd.aenix.io_v1alpha1_etcdcluster.yaml + kubectl apply -f https://github.com/aenix-io/etcd-operator/raw/main/config/samples/etcd.aenix.io_v1alpha1_etcdcluster.yaml ``` **Caution**: by default emptyDir storage is used. It means such cluster configuration is not intended for long-term storage. From 2955cc84622bba1cec0a1f11a8b4fca161b4e338 Mon Sep 17 00:00:00 2001 From: Kirill Ilin Date: Sun, 31 Mar 2024 16:28:04 +0500 Subject: [PATCH 4/4] hardcode controller version --- Makefile | 6 +++--- config/manager/kustomization.yaml | 5 +---- config/manager/manager.yaml | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 7f86c48b..183137d7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Image URL to use all building/pushing image targets -IMG ?= controller:latest +IMG ?= ghcr.io/aenix-io/etcd-operator:latest # ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary. ENVTEST_K8S_VERSION = 1.29.0 @@ -122,7 +122,7 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi $(KUSTOMIZE) build config/crd > dist/install.yaml; \ fi echo "---" >> dist/install.yaml # Add a document separator before appending - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/aenix-io/etcd-operator=${IMG} $(KUSTOMIZE) build config/default >> dist/install.yaml ##@ Deployment @@ -141,7 +141,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified .PHONY: deploy deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config. - cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG} + cd config/manager && $(KUSTOMIZE) edit set image ghcr.io/aenix-io/etcd-operator=${IMG} $(KUSTOMIZE) build config/default | $(KUBECTL) apply -f - .PHONY: undeploy diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index ad13e96b..8335489f 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -2,7 +2,4 @@ resources: - manager.yaml apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -images: -- name: controller - newName: controller - newTag: latest +images: [] diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 6aaf0c70..b62c4319 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -70,7 +70,7 @@ spec: - /manager args: - --leader-elect - image: ghcr.io/aenix-io/etcd-operator:latest + image: ghcr.io/aenix-io/etcd-operator:v0.0.2 imagePullPolicy: IfNotPresent name: manager securityContext: