diff --git a/.github/workflows/validate-deployments.yaml b/.github/workflows/validate-deployments.yaml new file mode 100644 index 00000000..6555a838 --- /dev/null +++ b/.github/workflows/validate-deployments.yaml @@ -0,0 +1,44 @@ +name: Validate Deployment methods + +on: + push: + branches: + - master + paths: + - "charts/ext-postgres-operator/**" + - "config/**" + pull_request: + branches: + - master + paths: + - "charts/ext-postgres-operator/**" + - "config/**" + +jobs: + validate-helm: + name: Validate Helm Chart + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Helm + uses: azure/setup-helm@v3 + with: + version: "latest" + + - name: Lint Helm chart + run: helm lint ./charts/ext-postgres-operator + + - name: Template Helm chart + run: helm template ext-postgres-operator ./charts/ext-postgres-operator > /dev/null + + validate-kustomize: + name: Validate Kustomize Configuration + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Validate Kustomize configuration + run: kustomize build ./config/default > /dev/null diff --git a/README.md b/README.md index e580268a..a2413834 100644 --- a/README.md +++ b/README.md @@ -118,19 +118,9 @@ data: To install the operator using Kustomize, follow these steps: -1. Configure Postgres credentials for the operator in `config/secret.yaml`. +1. Configure Postgres credentials for the operator in `config/default/secret.yaml`. -2. Create the namespace if needed: - ```bash - kubectl apply -f config/namespace.yaml - ``` - -3. Apply the secret: - ```bash - kubectl apply -f deploy/secret.yaml - ``` - -4. Deploy the operator: +2. Deploy the operator: ```bash kubectl kustomize config/default/ | kubectl apply -f - ``` diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index cd836034..776f2c8c 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -2,6 +2,7 @@ namespace: operators resources: - namespace.yaml + - secret.yaml - ../crd - ../rbac - ../manager diff --git a/config/secret.yaml b/config/default/secret.yaml similarity index 68% rename from config/secret.yaml rename to config/default/secret.yaml index 090c3e78..6d1d33b5 100644 --- a/config/secret.yaml +++ b/config/default/secret.yaml @@ -4,7 +4,7 @@ metadata: name: ext-postgres-operator type: Opaque data: - POSTGRES_HOST: cG9zdGdyZXMuZGF0YWJhc2Vz + POSTGRES_HOST: cG9zdGdyZXNxbA== POSTGRES_USER: cG9zdGdyZXM= - POSTGRES_PASS: YWRtaW4xMjM= + POSTGRES_PASS: cG9zdGdyZXM= POSTGRES_URI_ARGS: c3NsbW9kZT1kaXNhYmxl