Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4d8b8b9
Improved version of CNOE AWS Reference Implementation (#52)
punkwalker Jul 25, 2025
d82c672
feat(refactor): add taskfile and helmfile to replace shell scripts + …
nusnewob Sep 9, 2025
be8e596
fix: bitnami images 👎🏿
nusnewob Sep 29, 2025
0f53f2b
refactor: improve initial and component install
nusnewob Sep 29, 2025
4719886
docs: update docs
nusnewob Sep 29, 2025
ff8864d
chore: improve uninstall
nusnewob Oct 2, 2025
d321e73
refactor: suggested changes for PR
nusnewob Oct 17, 2025
df92e22
Update README.md
punkwalker Oct 17, 2025
6ee028e
refactor(feat): deploying cnoe apps to aks from local kind argocd
nusnewob Oct 8, 2025
d317dbc
feat: sync crossplane and external dns workload identity from local k…
nusnewob Oct 9, 2025
1ef7c47
refactor: consolidate eso service account, cleanup taskfile, fixing s…
nusnewob Oct 13, 2025
59b4ed4
refactor: cleanup argocd annotations & taskfile + update config templ…
nusnewob Oct 17, 2025
06d4fe4
chore: add validation to local azure credential file + cleanup
nusnewob Oct 20, 2025
61ff562
docs: update docs for v2.1
nusnewob Oct 20, 2025
7594203
chore: remove legacy code
nusnewob Oct 23, 2025
179c184
chore: add missing commits from cherry pick
nusnewob Oct 23, 2025
296e6ce
refactor: refactor taskfile and configs for GCP
nusnewob Nov 5, 2025
28f27de
refactor: fix external secret to parse remote cnoe cluster info + cro…
nusnewob Nov 6, 2025
413a45c
fix: fix local kind connection to gke
nusnewob Nov 7, 2025
615acbf
refactor: fix argocd sync + rewrite keycloak setup job + other improv…
nusnewob Nov 7, 2025
176a208
refactor: reorg resources to improve argocd sync speed
nusnewob Nov 12, 2025
f7e5327
docs: update docs for GCP implementation
nusnewob Nov 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ override.tf.json
terraform.rc

/private/
config.yaml
.task/
2 changes: 2 additions & 0 deletions .taskrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
experiments:
ENV_PRECEDENCE: 1
521 changes: 285 additions & 236 deletions README.md

Large diffs are not rendered by default.

52 changes: 0 additions & 52 deletions TROUBLESHOOTING.md

This file was deleted.

19 changes: 19 additions & 0 deletions Taskfile.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# https://taskfile.dev
version: "3"

tasks:
test:gke:create:
deps:
- task: gcp:init
env:
KUBECONFIG:
sh: echo ${HOME}/.kube/config
cmds:
- gcloud container clusters create-auto "$(yq '.cluster_name' {{.CONFIG_FILE}})" --enable-dns-access
- gcloud container clusters get-credentials "$(yq '.cluster_name' {{.CONFIG_FILE}})"

test:gke:destroy:
deps:
- task: gcp:init
cmds:
- gcloud container clusters delete "$(yq '.cluster_name' {{.CONFIG_FILE}})" --quiet
141 changes: 141 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# https://taskfile.dev
version: "3"
set: [errexit, nounset, pipefail]

env:
KUBECONFIG: "{{.ROOT_DIR}}/private/kubeconfig"
REPO_ROOT: "{{.ROOT_DIR}}"

vars:
CONFIG_FILE: "{{.ROOT_DIR}}/config.yaml"
REQUIRED_CLIS: [gcloud, kubectl, kubelogin, yq, helm, helmfile, yamale]

includes:
test:
taskfile: ./Taskfile.test.yml
flatten: true
optional: true

tasks:
init:
deps:
- task: config:lint
cmds:
- cmd: bash command -V {{.ITEM}}
for:
var: REQUIRED_CLIS
- task: helmfile:init
- task: helmfile:lint
- task: helmfile:build

install:
cmds:
- task: kind:create
- task: apply

apply:
deps:
- task: config:lint
cmds:
- task: kubeconfig:set-context:kind
- task: helmfile:apply

diff:
deps:
- task: config:lint
- task: kubeconfig:set-context:kind
cmds:
- task: helmfile:diff

sync:
deps:
- task: config:lint
- task: kubeconfig:set-context:kind
cmds:
- task: helmfile:sync

config:lint:
silent: true
cmds:
- cmd: yamale -s "{{.ROOT_DIR}}/config.schema.yaml" "{{.CONFIG_FILE}}"
- defer: rm -f "{{.ROOT_DIR}}/private/gcp-credentials.yaml"
- cmd: test -f "{{.ROOT_DIR}}/private/gcp-credentials.json" || (echo ERROR\:\ private/gcp-credentials.json not found && exit 1)
- cmd: yq -o=yaml "{{.ROOT_DIR}}/private/gcp-credentials.json" > "{{.ROOT_DIR}}/private/gcp-credentials.yaml"
- cmd: yamale -s "{{.ROOT_DIR}}/private/gcp-credentials.schema.yaml" "{{.ROOT_DIR}}/private/gcp-credentials.yaml"

get:urls:
deps:
- task: kubeconfig:set-context:gke
cmd: >-
kubectl get ingress -A -o yaml | yq '.items[] | {(.metadata.name): ((select(.spec.tls != null) | "https://" // "http://") + .spec.rules[].host + .spec.rules[].http.paths[].path)}'

kubeconfig:set-context:gke:
deps:
- task: kubeconfig:update:gke
cmd: kubectl config set-context "$(yq '.cluster_name' {{.CONFIG_FILE}})"

kubeconfig:set-context:kind:
deps:
- task: kubeconfig:update:kind
cmd: kubectl config set-context $(yq '.name' "{{.ROOT_DIR}}/kind.yaml")

kubeconfig:update:gke:
deps:
- task: gcp:init
cmd: gcloud container clusters get-credentials "$(yq '.cluster_name' {{.CONFIG_FILE}})"

kubeconfig:update:kind:
cmd: kind export kubeconfig --quiet --name $(yq '.name' "{{.ROOT_DIR}}/kind.yaml")

gcp:init:
deps:
- task: config:lint
silent: true
cmds:
- cmd: gcloud config set project "$(yq '.project' {{.CONFIG_FILE}})"
- cmd: gcloud config set compute/region "$(yq '.region' {{.CONFIG_FILE}})"

uninstall:
deps:
- task: gcp:init
ignore_error: true
cmds:
- defer: rm -f "{{.KUBECONFIG}}"
- task: kubeconfig:set-context:gke
- cmd: kubectl delete workloadidentities.gcp.livewyer.io -A --all --interactive=false --now && sleep 60
- cmd: gcloud iam service-accounts delete crossplane
- cmd: kubectl delete pkg.crossplane.io -A --all --interactive=false --now
- cmd: kubectl -n argocd delete appset $(yq '. | keys - ["argocd"] | .[]' ${REPO_ROOT}/packages/addons/values.yaml) --interactive=false --now
- cmd: kubectl -n argocd delete app $(kubectl -n argocd get app -o yaml | yq '.items[] | select(.metadata.labels.addonName!="argocd").metadata.name') --interactive=false --now
- task: kubeconfig:set-context:kind
- cmd: kubectl -n argocd delete appset cnoe argocd --interactive=false --now && sleep 300
- task: helmfile:destroy
- task: kind:delete

kind:create:
cmd: kind create cluster --config "{{.ROOT_DIR}}/kind.yaml"
kind:delete:
cmd: kind delete cluster --name $(yq '.name' "{{.ROOT_DIR}}/kind.yaml")

helmfile:init:
cmd: helmfile init {{.CLI_ARGS}}
helmfile:lint:
cmd: helmfile lint {{.CLI_ARGS}}
helmfile:diff:
cmd: helmfile diff {{.CLI_ARGS}}
helmfile:build:
cmd: helmfile build {{.CLI_ARGS}}
helmfile:apply:
cmd: helmfile apply {{.CLI_ARGS}}
helmfile:list:
cmd: helmfile list {{.CLI_ARGS}}
helmfile:status:
cmd: helmfile status {{.CLI_ARGS}}
helmfile:template:
cmd: helmfile template {{.CLI_ARGS}}
helmfile:deps:
cmd: helmfile deps {{.CLI_ARGS}}
helmfile:sync:
cmd: helmfile sync {{.CLI_ARGS}}
helmfile:destroy:
cmd: helmfile destroy {{.CLI_ARGS}}
24 changes: 24 additions & 0 deletions config.schema.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# YAML Schema for config.yaml

repo:
url: str()
revision: str()
basepath: str()
cluster_name: str()
project: str()
region: str()
dns_zone: str()
dns_domain: str()
secret_manager: str()
path_routing: bool()
github:
appId: regex('^[0-9]+$')
installationId: regex('^[0-9]+$')
orgURL: regex('^http(s?)://.*$')
clientId: regex('^[a-zA-Z0-9]+$')
clientSecret: regex('^[a-zA-Z0-9]{32,}')
webhookUrl: regex('^http(s?)://.*$')
webhookSecret: str()
privateKey: str(multiline=True)
letsencrypt_env: enum('prod', 'staging')
tags: map(str(), key=str())
52 changes: 52 additions & 0 deletions config.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
### Config for CNOE GCP Reference Implementation ###
# Source: "https://github.com/livewyer-ops/reference-implementation-google"

# Details of your repository hosting the reference azure implementation code
repo:
url: "https://github.com/<REPLACE_ME_your_org>/reference-implementation-google"
revision: "main" # Branch or Tag which should be used for Argo CD Apps
basepath: "packages" # Directory in which configuration of addons is stored

# The name of the GKE cluster you are installing the reference implementation on.
cluster_name: "cnoe-ref-impl"
# GCP Region of the GKE cluster and cnoe-reference-implementation-google config secret
project: cnoe-idp
region: us-east1

# Base Domain name used for exposing services. It should be a subdomain or main domain of the DNS zone.
dns_zone: <REPLACE_ME_cnoe-dns>
dns_domain: <REPLACE_ME_example.com>

# GCP Secret Manager to use to store config secrets and certs
secret_manager: cnoe-ref-impl

# Set this to "true" if you want to enable path routing othewise "false" for domain based routing.
# When enabled, the exposed addons will be accessible at https://<domain_name>/<addon-name>
# When disabled, the exposed addons will be accessible at https://<addon-name>.<domain_name>
# !!! Note: This is a string value as it is passed on to the Argo CD cluster secret as label
path_routing: false

github:
appId: "<REPLACE_ME_12345678>"
installationId: "<REPLACE_ME_12345678>"
orgURL: https://github.com/<REPLACE_ME_your_org>
clientId: <REPLACE_ME_clientId>
clientSecret: <REPLACE_ME_clientSecret>
webhookUrl: <REPLACE_ME_webhookUrl>
webhookSecret: <REPLACE_ME_webhookSecret>
privateKey: |
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----

letsencrypt_env: prod

# Tags for GCP resources
tags:
githubRepo: "github.com/<REPLACE_ME_your_org>/reference-implementation-azure"
env: "dev"
project: "cnoe"

crossplane_workload_identity:
clientId: <REPLACE_ME_00000000-0000-0000-0000-000000000000>
tenantId: <REPLACE_ME_00000000-0000-0000-0000-000000000000>
Loading