Skip to content

Commit

Permalink
feat: Add quickstart page (aenix-io#91)
Browse files Browse the repository at this point in the history
Co-authored-by: Kirill Ilin <stitch14@yandex.ru>
  • Loading branch information
sergeyshevch and sircthulhu authored Mar 31, 2024
1 parent 755f630 commit e893b93
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 1 addition & 4 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@ resources:
- manager.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: controller
newTag: latest
images: []
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
33 changes: 33 additions & 0 deletions site/content/en/docs/v0.1/quickstart.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
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/)
- [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](https://cert-manager.io/docs/installation/) installed in the cluster

1. Install etcd-operator:
```bash
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-system -l control-plane=controller-manager
```
3. Create an etcd cluster:
```bash
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.

4. Check the etcd cluster is running:
```bash
kubectl get pods -l app.kubernetes.io/managed-by=etcd-operator
```
1 change: 1 addition & 0 deletions site/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ services:

site:
image: docsy/docsy-example
platform: linux/amd64
build:
context: .
command: server
Expand Down

0 comments on commit e893b93

Please sign in to comment.