Skip to content

Commit

Permalink
chore: update README (#178)
Browse files Browse the repository at this point in the history
  • Loading branch information
nakamasato authored Mar 28, 2023
1 parent e1c2b8b commit 73557cc
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ This is a go-based Kubernetes operator built with [operator-sdk](https://sdk.ope
- Go: 1.19
## Components

- `MySQL`: MySQL cluster
- `MySQL`: MySQL cluster (holds credentials to connect to MySQL)
- `MySQLUser`: MySQL user (`mysqlName` and `host`)
- `MySQLDB`: MySQL database including schema repository (ToDo)
- `MySQLDB`: MySQL database (`mysqlName` and `dbName`)

## Getting Started

Expand All @@ -23,7 +23,7 @@ This is a go-based Kubernetes operator built with [operator-sdk](https://sdk.ope
```
kubectl apply -k https://github.com/nakamasato/mysql-operator/config/mysql
```
1. Apply custom resources (`MySQL`, `MySQLUser`).
1. Apply custom resources (`MySQL`, `MySQLUser`, `MySQLDB`).
`mysql.yaml` credentials to connect to the MySQL:
Expand All @@ -50,6 +50,18 @@ This is a go-based Kubernetes operator built with [operator-sdk](https://sdk.ope
host: '%'
```
`mysqldb.yaml`: MySQL database
```yaml
apiVersion: mysql.nakamasato.com/v1alpha1
kind: MySQLDB
metadata:
name: sample-db # this is not a name for MySQL database but just a Kubernetes object name
spec:
dbName: sample_db # this is MySQL database name
mysqlName: mysql-sample
```
```
kubectl apply -k https://github.com/nakamasato/mysql-operator/config/samples-on-k8s
```
Expand All @@ -70,7 +82,7 @@ This is a go-based Kubernetes operator built with [operator-sdk](https://sdk.ope
```
kubectl exec -it $(kubectl get po | grep mysql | head -1 | awk '{print $1}') -- mysql -unakamasato -p$(kubectl get secret mysql-mysql-sample-nakamasato -o jsonpath='{.data.password}' | base64 --decode)
```
1. Delete custom resources (`MySQL`, `MySQLUser`).
1. Delete custom resources (`MySQL`, `MySQLUser`, `MySQLDB`).
Example:
```
kubectl delete -k https://github.com/nakamasato/mysql-operator/config/samples-on-k8s
Expand All @@ -83,7 +95,7 @@ This is a go-based Kubernetes operator built with [operator-sdk](https://sdk.ope
```
kubectl delete -k https://github.com/nakamasato/mysql-operator/config/mysql
```
1. Uninstall
1. Uninstall `mysql-operator`
```
kubectl delete -k https://github.com/nakamasato/mysql-operator/config/install
```
Expand Down

0 comments on commit 73557cc

Please sign in to comment.