-
Notifications
You must be signed in to change notification settings - Fork 13
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 #47 from rustycl0ck/kpt
Integrate `kpt` with Kustomize resources
- Loading branch information
Showing
11 changed files
with
33 additions
and
349 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 |
---|---|---|
|
@@ -76,23 +76,36 @@ $ kubectl apply -f config/samples/spanner_v1alpha1_spannerautoscaler.yaml | |
### KPT | ||
Spanner Autoscaler can be installed using [KPT](https://github.com/GoogleContainerTools/kpt). | ||
Spanner Autoscaler can be installed using [KPT](https://kpt.dev/installation/). | ||
The installation has 2 steps: | ||
1. Fetch package | ||
2. Create Custom Resource | ||
1. Deploy the operator through `kpt` | ||
2. Create a Custom Resource for managing a spanner instance | ||
#### 1. Fetch package | ||
#### 1. Deploy the operator | ||
``` | ||
$ mkdir tmp | ||
$ kpt pkg get https://github.com/mercari/spanner-autoscaler tmp/ | ||
``` | ||
```console | ||
$ kpt pkg get https://github.com/mercari/spanner-autoscaler/[email protected] spanner-autoscaler | ||
$ kpt live init spanner-autoscaler/kpt | ||
$ kpt live install-resource-group | ||
#### 2. Create Custom Resource | ||
## Append '--dry-run' to the below line to just | ||
## check the resources which will be created | ||
$ kustomize build spanner-autoscaler/kpt | kpt live apply - | ||
## To uninstall, use the following | ||
$ kustomize build spanner-autoscaler/kpt | kpt live destroy - | ||
``` | ||
$ kubectl apply -R -f tmp/kpt | ||
> :information_source: **TIP:** Instead of `kpt`, you can also use `kubectl` directly to apply the resources with | ||
> ```console | ||
> $ kustomize build spanner-autoscaler/default | kubectl apply -f - | ||
> ``` | ||
> These resources can then be adopted by `kpt` by using the `--inventory-policy=adopt` flag while using `kpt live apply` command. [More info](https://kpt.dev/reference/cli/live/apply/?id=flags). | ||
#### 2. Create a Custom Resource | ||
```console | ||
$ kubectl apply -f spanner-autoscaler/samples/spanner_v1alpha1_spannerautoscaler.yaml | ||
``` | ||
### (Optional) Setting GKE Workload Identity | ||
|
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,6 @@ | ||
apiVersion: kpt.dev/v1 | ||
kind: Kptfile | ||
metadata: | ||
name: spanner-autoscaler | ||
info: | ||
description: Autoscaler for Google Cloud Spanner |
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,4 @@ | ||
resources: | ||
- ../default | ||
- Kptfile | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.