-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CNPG Cluster Chart v0.0.1 Initial prototype of the cluster chart that focuses in ease-of-use and a simple disaster recovery procedure. The objective of the chart is to provide a really easy to use interface for cluster recovery and a convention over configuration approach. Closes: #178 Signed-off-by: Itay Grudev [email protected]
- Loading branch information
Showing
41 changed files
with
1,516 additions
and
83 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,10 @@ | ||
name: Deploy the CNPG Operator | ||
description: Deploys the CNPG Operator to a Kubernetes cluster | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Deploy the operator | ||
shell: bash | ||
run: | | ||
helm upgrade --install cnpg --namespace cnpg-system \ | ||
--create-namespace charts/cloudnative-pg --wait |
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,24 @@ | ||
name: Setup Kind | ||
description: Sets up a kind cluster and installs Helm and kubectl | ||
outputs: | ||
helm-path: | ||
description: The path to the Helm binary | ||
value: ${{ steps.helm.outputs.helm-path }} | ||
kubectl-path: | ||
description: The path to the kubectl binary | ||
value: ${{ steps.kubectl.outputs.kubectl-path }} | ||
runs: | ||
using: composite | ||
steps: | ||
- id: helm | ||
name: Set up Helm | ||
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | ||
with: | ||
version: v3.6.2 | ||
|
||
- id: kubectl | ||
name: Install kubectl | ||
uses: azure/setup-kubectl@901a10e89ea615cf61f57ac05cecdf23e7de06d8 # v3.2 | ||
|
||
- name: Create kind cluster | ||
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0 |
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,32 @@ | ||
name: Verifies that a CNPG cluster has a certain amount of ready instances | ||
description: Verifies that a CNPG cluster has a certain amount of ready instances | ||
inputs: | ||
cluster-name: | ||
description: The name of the cluster to verify | ||
required: true | ||
default: database-cluster | ||
ready-instances: | ||
description: The amount of ready instances to wait for | ||
required: true | ||
default: "3" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Wait for cluster to become ready | ||
shell: bash | ||
run: | | ||
ITER=0 | ||
while true; do | ||
if [[ $ITER -ge 300 ]]; then | ||
echo "Cluster not ready" | ||
exit 1 | ||
fi | ||
READY_INSTANCES=$(kubectl get cluster ${INPUT_CLUSTER_NAME} -o jsonpath='{.status.readyInstances}') | ||
if [[ "$READY_INSTANCES" == ${INPUT_READY_INSTANCES} ]]; then | ||
echo "Cluster up and running" | ||
break | ||
fi | ||
sleep 1 | ||
(( ++ITER )) | ||
done |
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
name: tests-cluster-standalone | ||
|
||
on: | ||
pull_request: | ||
branches-ignore: | ||
- 'gh-pages' | ||
|
||
jobs: | ||
test-cluster-standalone: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup kind | ||
uses: ./.github/actions/setup-kind | ||
|
||
- name: Deploy the operator | ||
uses: ./.github/actions/deploy-operator | ||
|
||
- name: Deploy a standalone cluster | ||
run: | | ||
helm upgrade --install \ | ||
--values charts/cluster/examples/basic.yaml \ | ||
--namespace database \ | ||
--create-namespace \ | ||
--wait \ | ||
database ./charts/cluster | ||
- name: Verify that the cluster is ready | ||
uses: ./.github/actions/verify-ready-instances | ||
with: | ||
cluster-name: database-cluster | ||
ready-instances: 1 |
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,41 @@ | ||
name: tests-operator | ||
|
||
on: | ||
pull_request: | ||
branches-ignore: | ||
- 'gh-pages' | ||
|
||
jobs: | ||
deploy_operator: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup kind | ||
uses: ./.github/actions/setup-kind | ||
|
||
- name: Deploy the operator | ||
uses: ./.github/actions/deploy-operator | ||
|
||
- name: Deploy a cluster | ||
run: | | ||
cat <<EOF | kubectl apply -f - | ||
# Example of PostgreSQL cluster | ||
apiVersion: postgresql.cnpg.io/v1 | ||
kind: Cluster | ||
metadata: | ||
name: cluster-example | ||
spec: | ||
instances: 3 | ||
storage: | ||
size: 1Gi | ||
EOF | ||
- name: Verify that the cluster is ready | ||
uses: ./.github/actions/verify-ready-instances | ||
with: | ||
cluster-name: cluster-example | ||
ready-instances: 3 |
Validating CODEOWNERS rules …
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
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 @@ | ||
examples/*.test.yaml |
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,23 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*.orig | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
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,31 @@ | ||
# | ||
# Copyright The CloudNativePG Contributors | ||
# | ||
# 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 | ||
# | ||
# http://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. | ||
# | ||
apiVersion: v2 | ||
name: cluster | ||
description: Deploys and manages a CloudNativePG cluster and its associated resources. | ||
icon: https://raw.githubusercontent.com/cloudnative-pg/artwork/main/cloudnativepg-logo.svg | ||
type: application | ||
version: 0.0.1 | ||
sources: | ||
- https://github.com/cloudnative-pg/charts | ||
keywords: | ||
- postgresql | ||
- postgres | ||
- database | ||
home: https://cloudnative-pg.io | ||
maintainers: | ||
- name: itay-grudev | ||
email: [email protected] |
Oops, something went wrong.