-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support PG4K namespace-restricted installation (#140)
Signed-off-by: Leonardo Cecchi <[email protected]> Signed-off-by: Jaime Silvela <[email protected]> Signed-off-by: Jonathan Gonzalez V <[email protected]> Co-authored-by: Jaime Silvela <[email protected]> Co-authored-by: Jonathan Gonzalez V <[email protected]>
- Loading branch information
1 parent
6dfb29d
commit f0c02ad
Showing
8 changed files
with
475 additions
and
334 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 |
---|---|---|
|
@@ -102,3 +102,42 @@ jobs: | |
kubectl wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" pgdgroups/region-a | ||
kubectl wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" pgdgroups/region-b | ||
kubectl wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" pgdgroups/region-c | ||
deploy-ep4k-single-namespace: | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- change-triage | ||
if: needs.change-triage.outputs.ep4k-changed == 'true' | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Helm | ||
uses: azure/[email protected] | ||
with: | ||
version: v3.11.3 | ||
|
||
- name: Create kind cluster | ||
uses: helm/[email protected] | ||
|
||
- name: Deploy in single-namespace mode using helm chart | ||
run: | | ||
helm upgrade --install edb-pg4k --namespace single-install \ | ||
--set config.clusterWide=false \ | ||
--create-namespace charts/edb-postgres-for-kubernetes --wait | ||
- name: Install kubectl | ||
uses: azure/[email protected] | ||
|
||
- name: Deploy a cluster in the watched namespace | ||
run: | | ||
kubectl -n single-install apply -f hack/samples/ep4k-cluster.yaml | ||
PHASE="Cluster in healthy state" | ||
kubectl -n single-install wait --timeout=5m --for=jsonpath='{.status.phase}'="$PHASE" clusters/cluster-example | ||
- name: Ignore deploying a cluster in another namespace | ||
run: | | ||
kubectl create ns test-ignore | ||
kubectl -n test-ignore apply -f hack/samples/ep4k-cluster.yaml | ||
kubectl -n test-ignore get pods 2>&1 >/dev/null | grep 'No resources found' |
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
|
||
EDB Postgres for Kubernetes Operator should be installed in namespace "{{ .Release.Namespace }}". | ||
You can now create a PostgreSQL cluster with 3 nodes in the current namespace as follows: | ||
You can now create a PostgreSQL cluster with 3 nodes as follows: | ||
|
||
cat <<EOF | kubectl apply -f - | ||
# Example of PostgreSQL cluster | ||
apiVersion: postgresql.k8s.enterprisedb.io/v1 | ||
kind: Cluster | ||
metadata: | ||
name: cluster-example | ||
{{if not .Values.config.clusterWide -}} | ||
namespace: {{ .Release.Namespace }} | ||
{{- end }} | ||
spec: | ||
instances: 3 | ||
storage: | ||
size: 1Gi | ||
EOF | ||
|
||
kubectl get cluster | ||
kubectl get -A cluster | ||
|
Oops, something went wrong.