Skip to content

Commit

Permalink
Merge pull request #410 from runkecheng/quick_build_image_and_apply
Browse files Browse the repository at this point in the history
docs: Add tutorial of building images. #409
  • Loading branch information
andyli029 authored Apr 1, 2022
2 parents 2e89d69 + 5ebdad2 commit e7eb189
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions docs/en-us/build_images_and_apply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
## How to build images and apply

### Operator

1. Build operator image and push to your dockerhub.

```
docker build -t {your repo}/mysql-operator:{your tag} . && docker push {your repo}/mysql-operator:{your tag}
```

2. Add radondb mysql helm repo.

```
helm repo add radondb https://radondb.github.io/radondb-mysql-kubernetes/
```

3. Install/Update operator using your image.

```
helm upgrade demo radondb/mysql-operator --install --set manager.image={your repo}/mysql-operator --set manager.tag={your tag}
```

### Sidecar

1. Build sidecar image and push to your dockerhub.

```
docker build -f Dockerfile.sidecar -t {your repo}/mysql-sidecar:{your tag} . && docker push {your repo}/mysql-sidecar:{your tag}
```

2. Create a sample cluster if not exist.

```
kubectl apply -f https://github.com/radondb/radondb-mysql-kubernetes/releases/latest/download/mysql_v1alpha1_mysqlcluster.yaml
```

3. Apply image to existing cluster.

```
kubectl patch mysql sample -p '{"spec": {"podPolicy": {"sidecarImage": "{your repo}/mysql-sidecar:{your tag}"}}}' --type=merge
```

> This example is for cluster named `sample`, you can modify as your cluster.

0 comments on commit e7eb189

Please sign in to comment.