-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add cronjob for readreplica rotator (#2242)
* Implement sample read replica rotation logic * Add external-snapshotter in go.mod * Add readreplica initial implementation * Add service implementation of readreplica rotator * Add readreplica rotate config * Refactor to read labels * replace id to _MY_TARGET_REPLICA_ID_ * Add snapshot k8s client * Format * Fix snapshot client initialization * Add Apache License to main.go * Use GetConfigOrDie * Use internal/k8s client * Refactor * Use controller-runtime for CRUD in readreplica * Remove snapshot client and use controller-runtime * Move LabelSelector into internal/k8s * Report error to span * Update go modules * Remove old example * Refactor * Disable exhaustruct for now * Fix predeclared * Fix stylecheck * nolint:gomnd * Add test template * Add test for getNewBaseName * Add readreplica-rotate build scripts * Add service account and clusterroles for read replica rotator * Update charts * Update comment * update charts * Update docker image name in Makefile.d/docker.mk * Fix scheme * Update docs * Fix comment * style: format code with Gofumpt and Prettier This commit fixes the style issues introduced in 6dba952 according to the output from Gofumpt and Prettier. Details: #2242 * Fix indent * Add network policy for readreplica rotator * Update README.md --------- Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
- Loading branch information
1 parent
bf77201
commit 4fddfb0
Showing
16 changed files
with
3,131 additions
and
772 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,78 @@ | ||
# | ||
# Copyright (C) 2019-2023 vdaas.org vald team <[email protected]> | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# You may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
name: "Build docker image: readreplica-rotate" | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*.*.*" | ||
- "v*.*.*" | ||
- "*.*.*-*" | ||
- "v*.*.*-*" | ||
paths: | ||
- ".github/actions/docker-build/actions.yaml" | ||
- ".github/workflows/dockers-readreplica-rotate.yml" | ||
- "go.mod" | ||
- "go.sum" | ||
- "internal/**" | ||
- "!internal/**/*_test.go" | ||
- "!internal/db/**" | ||
- "!internal/k8s/**" | ||
- "apis/grpc/**" | ||
- "pkg/index/job/readreplica/rotate/**" | ||
- "cmd/index/job/readreplica/rotate/**" | ||
- "dockers/index/job/readreplica/rotate/Dockerfile" | ||
- "versions/GO_VERSION" | ||
pull_request: | ||
paths: | ||
- ".github/actions/docker-build/actions.yaml" | ||
- ".github/workflows/_docker-image.yaml" | ||
- ".github/workflows/dockers-readreplica-rotate.yml" | ||
- "go.mod" | ||
- "go.sum" | ||
- "internal/**" | ||
- "!internal/**/*_test.go" | ||
- "!internal/db/**" | ||
- "!internal/k8s/**" | ||
- "apis/grpc/**" | ||
- "pkg/index/job/readreplica/rotate/**" | ||
- "cmd/index/job/readreplica/rotate/**" | ||
- "dockers/index/job/readreplica/rotate/Dockerfile" | ||
- "versions/GO_VERSION" | ||
pull_request_target: | ||
paths: | ||
- ".github/actions/docker-build/actions.yaml" | ||
- ".github/workflows/_docker-image.yaml" | ||
- ".github/workflows/dockers-readreplica-rotate.yml" | ||
- "go.mod" | ||
- "go.sum" | ||
- "internal/**" | ||
- "!internal/**/*_test.go" | ||
- "!internal/db/**" | ||
- "!internal/k8s/**" | ||
- "apis/grpc/**" | ||
- "pkg/index/job/readreplica/rotate/**" | ||
- "cmd/index/job/readreplica/rotate/**" | ||
- "dockers/index/job/readreplica/rotate/Dockerfile" | ||
- "versions/GO_VERSION" | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/_docker-image.yaml | ||
with: | ||
target: readreplica-rotate | ||
secrets: inherit |
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
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
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
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
Oops, something went wrong.