-
Notifications
You must be signed in to change notification settings - Fork 19
Add CRD-less kustomize variants + CRD sync to install #1444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wasaga
wants to merge
4
commits into
main
Choose a base branch
from
fix/crd-ownership-conflict
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f8b6691
config: add CRD-less kustomize variants + CRD sync to install
wasaga e45aef4
ci: sparse-checkout in CRD sync workflow
wasaga 9af90df
ci: set explicit GITHUB_TOKEN permissions on CRD sync workflow
wasaga 9f1241d
Merge branch 'main' into fix/crd-ownership-conflict
wasaga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,47 @@ | ||
| name: Sync CRDs to install | ||
|
|
||
| # Publishes the generated CRD bases to pomerium/install so the Terraform | ||
| # install module never silently lags this repo. Opens a PR against install | ||
| # whenever the CRD bases change on main (and on demand). | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths: | ||
| - "config/crd/bases/**" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| sync-crds: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout ingress-controller | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | ||
|
|
||
| - name: Checkout install | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 | ||
| with: | ||
| repository: pomerium/install | ||
| path: install | ||
| token: ${{ secrets.APPARITOR_GITHUB_TOKEN }} | ||
|
|
||
| - name: Copy CRD bases | ||
| run: | | ||
| dst="install/ingress-controller/kustomize/crd/bases" | ||
| mkdir -p "$dst" | ||
| cp config/crd/bases/ingress.pomerium.io_pomerium.yaml "$dst/" | ||
| cp config/crd/bases/gateway.pomerium.io_policyfilters.yaml "$dst/" | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 | ||
| with: | ||
| path: install | ||
| author: GitHub Actions <apparitor@users.noreply.github.com> | ||
| body: "Automated CRD sync from pomerium/ingress-controller@${{ github.sha }}." | ||
| branch: ci/sync-crds | ||
| commit-message: "ci: sync CRDs from ingress-controller" | ||
| delete-branch: true | ||
| labels: ci | ||
| title: "ci: sync CRDs from ingress-controller" | ||
| token: ${{ secrets.APPARITOR_GITHUB_TOKEN }} | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
This file contains hidden or 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,8 @@ | ||
| # CRD-less variant of clustered-databroker: the clustered StatefulSet install | ||
| # without the CRD bases, for clusters where the CRD is owned by a separate | ||
| # installer. Mirrors clustered-databroker but builds on default-no-crd. | ||
| namespace: pomerium | ||
| resources: | ||
| - ../default-no-crd | ||
| components: | ||
| - ../components/databroker-cluster |
This file contains hidden or 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,107 +1,5 @@ | ||
| namespace: pomerium | ||
| resources: | ||
| - ../default | ||
| - ./service | ||
| - ./pdb.yaml | ||
| patches: | ||
| - patch: |- | ||
| - op: replace | ||
| path: /kind | ||
| value: StatefulSet | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/args/- | ||
| value: '--databroker-cluster-node-id=$(POD_NAME)' | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/args/- | ||
| value: '--databroker-raft-bind-address=:5999' | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/args/- | ||
| value: '--databroker-auto-tls=*.pomerium-headless' | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/env/- | ||
| value: | ||
| name: POD_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/env/- | ||
| value: | ||
| name: DATABROKER_CLUSTER_NODES | ||
| value: |- | ||
| [ | ||
| { "id": "pomerium-0", "grpc_address": "https://pomerium-0.pomerium-headless:5443", "raft_address": "pomerium-0.pomerium-headless:5999" }, | ||
| { "id": "pomerium-1", "grpc_address": "https://pomerium-1.pomerium-headless:5443", "raft_address": "pomerium-1.pomerium-headless:5999" }, | ||
| { "id": "pomerium-2", "grpc_address": "https://pomerium-2.pomerium-headless:5443", "raft_address": "pomerium-2.pomerium-headless:5999" } | ||
| ] | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/ports/- | ||
| value: | ||
| name: grpc | ||
| containerPort: 5443 | ||
| protocol: TCP | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/ports/- | ||
| value: | ||
| name: raft | ||
| containerPort: 5999 | ||
| protocol: TCP | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/volumeMounts/- | ||
| value: | ||
| name: storage | ||
| mountPath: /var/pomerium/databroker | ||
| - op: add | ||
| path: /spec/replicas | ||
| value: 3 | ||
| - op: add | ||
| path: /spec/updateStrategy | ||
| value: | ||
| type: RollingUpdate | ||
| rollingUpdate: | ||
| maxUnavailable: 1 | ||
| - op: add | ||
| path: /spec/podManagementPolicy | ||
| value: Parallel | ||
| - op: add | ||
| path: /spec/persistentVolumeClaimRetentionPolicy | ||
| value: | ||
| whenDeleted: Delete | ||
| whenScaled: Delete | ||
| - op: add | ||
| path: /spec/serviceName | ||
| value: pomerium-headless | ||
| - op: add | ||
| path: /spec/volumeClaimTemplates | ||
| value: | ||
| - metadata: | ||
| name: storage | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 1Gi | ||
| - op: replace | ||
| path: /spec/template/spec/containers/0/resources/requests/cpu | ||
| value: 500m | ||
| - op: add | ||
| path: /spec/template/spec/securityContext/fsGroup | ||
| value: 65532 | ||
| - op: add | ||
| path: /spec/template/spec/securityContext/fsGroupChangePolicy | ||
| value: OnRootMismatch | ||
| - op: add | ||
| path: /spec/template/spec/affinity | ||
| value: | ||
| podAntiAffinity: | ||
| requiredDuringSchedulingIgnoredDuringExecution: | ||
| - topologyKey: kubernetes.io/hostname | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: pomerium | ||
| target: | ||
| group: apps | ||
| version: v1 | ||
| kind: Deployment | ||
| name: pomerium | ||
| components: | ||
| - ../components/databroker-cluster |
111 changes: 111 additions & 0 deletions
111
config/components/databroker-cluster/kustomization.yaml
This file contains hidden or 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,111 @@ | ||
| # Component: converts the all-in-one pomerium Deployment into a clustered, | ||
| # raft-backed StatefulSet with a 3-node databroker. Shared by the | ||
| # clustered-databroker and clustered-databroker-no-crd variants so the | ||
| # (large) patch is defined exactly once. | ||
| apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
| kind: Component | ||
| resources: | ||
| - ./service | ||
| - ./pdb.yaml | ||
| patches: | ||
| - patch: |- | ||
| - op: replace | ||
| path: /kind | ||
| value: StatefulSet | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/args/- | ||
| value: '--databroker-cluster-node-id=$(POD_NAME)' | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/args/- | ||
| value: '--databroker-raft-bind-address=:5999' | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/args/- | ||
| value: '--databroker-auto-tls=*.pomerium-headless' | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/env/- | ||
| value: | ||
| name: POD_NAME | ||
| valueFrom: | ||
| fieldRef: | ||
| fieldPath: metadata.name | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/env/- | ||
| value: | ||
| name: DATABROKER_CLUSTER_NODES | ||
| value: |- | ||
| [ | ||
| { "id": "pomerium-0", "grpc_address": "https://pomerium-0.pomerium-headless:5443", "raft_address": "pomerium-0.pomerium-headless:5999" }, | ||
| { "id": "pomerium-1", "grpc_address": "https://pomerium-1.pomerium-headless:5443", "raft_address": "pomerium-1.pomerium-headless:5999" }, | ||
| { "id": "pomerium-2", "grpc_address": "https://pomerium-2.pomerium-headless:5443", "raft_address": "pomerium-2.pomerium-headless:5999" } | ||
| ] | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/ports/- | ||
| value: | ||
| name: grpc | ||
| containerPort: 5443 | ||
| protocol: TCP | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/ports/- | ||
| value: | ||
| name: raft | ||
| containerPort: 5999 | ||
| protocol: TCP | ||
| - op: add | ||
| path: /spec/template/spec/containers/0/volumeMounts/- | ||
| value: | ||
| name: storage | ||
| mountPath: /var/pomerium/databroker | ||
| - op: add | ||
| path: /spec/replicas | ||
| value: 3 | ||
| - op: add | ||
| path: /spec/updateStrategy | ||
| value: | ||
| type: RollingUpdate | ||
| rollingUpdate: | ||
| maxUnavailable: 1 | ||
| - op: add | ||
| path: /spec/podManagementPolicy | ||
| value: Parallel | ||
| - op: add | ||
| path: /spec/persistentVolumeClaimRetentionPolicy | ||
| value: | ||
| whenDeleted: Delete | ||
| whenScaled: Delete | ||
| - op: add | ||
| path: /spec/serviceName | ||
| value: pomerium-headless | ||
| - op: add | ||
| path: /spec/volumeClaimTemplates | ||
| value: | ||
| - metadata: | ||
| name: storage | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: 1Gi | ||
| - op: replace | ||
| path: /spec/template/spec/containers/0/resources/requests/cpu | ||
| value: 500m | ||
| - op: add | ||
| path: /spec/template/spec/securityContext/fsGroup | ||
| value: 65532 | ||
| - op: add | ||
| path: /spec/template/spec/securityContext/fsGroupChangePolicy | ||
| value: OnRootMismatch | ||
| - op: add | ||
| path: /spec/template/spec/affinity | ||
| value: | ||
| podAntiAffinity: | ||
| requiredDuringSchedulingIgnoredDuringExecution: | ||
| - topologyKey: kubernetes.io/hostname | ||
| labelSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: pomerium | ||
| target: | ||
| group: apps | ||
| version: v1 | ||
| kind: Deployment | ||
| name: pomerium |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or 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,11 @@ | ||
| # Same as config/default but WITHOUT the CRD bases. Use this when the | ||
| # pomerium.ingress.pomerium.io / policyfilters.gateway.pomerium.io CRDs are | ||
| # owned by a separate installer (e.g. a dedicated ArgoCD CRD Application or a | ||
| # Terraform-managed CRD) so the controller install does not also write the | ||
| # cluster-scoped CRD object and fight over its schema. | ||
| namespace: pomerium | ||
| commonLabels: | ||
| app.kubernetes.io/name: pomerium | ||
| resources: | ||
| - ../pomerium | ||
| - ../gen_secrets |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.