-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from runkecheng/quick_build_image_and_apply
docs: Add tutorial of building images. #409
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||