{"id":16872288,"url":"https://github.com/mtrnord/cluster","last_synced_at":"2025-04-11T11:10:11.938Z","repository":{"id":157140510,"uuid":"615107345","full_name":"MTRNord/cluster","owner":"MTRNord","description":"Infrastructure files for Nordgedanken and Midnightthoughts.","archived":false,"fork":false,"pushed_at":"2025-04-09T18:22:06.000Z","size":4472,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T18:36:40.936Z","etag":null,"topics":["gitops","helm","k8s","kubernetes"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MTRNord.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-17T00:57:10.000Z","updated_at":"2025-04-09T18:21:45.000Z","dependencies_parsed_at":"2023-06-28T13:01:17.000Z","dependency_job_id":"f13c7dd2-07a4-4d81-9dc1-424294af022d","html_url":"https://github.com/MTRNord/cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTRNord%2Fcluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTRNord%2Fcluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTRNord%2Fcluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MTRNord%2Fcluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MTRNord","download_url":"https://codeload.github.com/MTRNord/cluster/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248381791,"owners_count":21094528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gitops","helm","k8s","kubernetes"],"created_at":"2024-10-13T15:14:12.958Z","updated_at":"2025-04-11T11:10:11.909Z","avatar_url":"https://github.com/MTRNord.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cluster Configs for Midnightthoughts and Nordgedanken\n\nThese are the current running setups at Midnightthoughts and Nordegedanken.\n\nThis is based on \u003chttps://github.com/fluxcd/flux2-kustomize-helm-example/tree/d54e250182ead1f4a00e9fd78b05dc9e0186246d\u003e\n\n## Prerequisites\n\nYou will need a Kubernetes cluster version 1.21 or newer.\nFor a quick local test, you can use [Kubernetes kind](https://kind.sigs.k8s.io/docs/user/quick-start/).\nAny other Kubernetes setup will work as well though.\n\nInstall the Flux CLI on MacOS or Linux using Homebrew:\n\n```sh\nbrew install fluxcd/tap/flux\n```\n\nOr install the CLI by downloading precompiled binaries using a Bash script:\n\n```sh\ncurl -s https://fluxcd.io/install.sh | sudo bash\n```\n\n## Repository structure\n\nThe Git repository contains the following top directories:\n\n- **apps** dir contains Helm releases with a custom configuration per cluster\n- **infrastructure** dir contains common infra tools such as ingress-nginx and cert-manager\n- **clusters** dir contains the Flux configuration per cluster (Note that staging isn't deployed anywhere at this time)\n\n```\n├── apps\n│   ├── base\n│   ├── production \n│   └── staging\n├── infrastructure\n│   ├── configs\n│   └── controllers\n└── clusters\n    ├── production\n    └── staging\n```\n\n### Applications\n\nThe apps configuration is structured into:\n\n- **apps/base/** dir contains namespaces and Helm release definitions\n- **apps/production/** dir contains the production Helm release values\n- **apps/staging/** dir contains the staging values\n\n```\n./apps/\n├── base\n│   └── podinfo\n│       ├── kustomization.yaml\n│       ├── namespace.yaml\n│       ├── release.yaml\n│       └── repository.yaml\n├── production\n│   ├── kustomization.yaml\n│   └── podinfo-patch.yaml\n└── staging\n    ├── kustomization.yaml\n    └── podinfo-patch.yaml\n```\n\n### Infrastructure\n\nThe infrastructure is structured into:\n\n- **infrastructure/controllers/** dir contains namespaces and Helm release definitions for Kubernetes controllers\n- **infrastructure/configs/** dir contains Kubernetes custom resources such as cert issuers and networks policies\n\n```\n./infrastructure/\n├── configs\n│   ├── cluster-issuers.yaml\n│   ├── network-policies.yaml\n│   └── kustomization.yaml\n└── controllers\n    ├── cert-manager.yaml\n    ├── ingress-nginx.yaml\n    ├── weave-gitops.yaml\n    └── kustomization.yaml\n```\n\nIn **clusters/production/infrastructure.yaml** we replace the Let's Encrypt server value to point to the production API:\n\n```yaml\napiVersion: kustomize.toolkit.fluxcd.io/v1beta2\nkind: Kustomization\nmetadata:\n  name: infra-configs\n  namespace: flux-system\nspec:\n  # ...omitted for brevity\n  dependsOn:\n    - name: infra-controllers\n  patches:\n    - patch: |\n        - op: replace\n          path: /spec/acme/server\n          value: https://acme-v02.api.letsencrypt.org/directory\n      target:\n        kind: ClusterIssuer\n        name: letsencrypt\n```\n\nNote that with `dependsOn` we tell Flux to first install or upgrade the controllers and only then the configs.\nThis ensures that the Kubernetes CRDs are registered on the cluster, before Flux applies any custom resources.\n\n\u003c!-- TODO setup bootstrap docs --\u003e\n\n## Useful things\n\nWatch for the Helm releases being installed:\n\n```console\n$ watch flux get helmreleases --all-namespaces\n\nNAMESPACE     NAME          REVISION SUSPENDED READY MESSAGE \nflux-system   weave-gitops  4.0.12    False     True  Release reconciliation succeeded\n```\n\nWatch kustomizations getting deployed:\n\n```console\n$ flux get kustomizations -w\n\nNAME            REVISION                SUSPENDED       READY   MESSAGE                              \nflux-system     main@sha1:21ebd912      False           True    Applied revision: main@sha1:21ebd912\ninfra-controllers       main@sha1:21ebd912      False   True    Applied revision: main@sha1:21ebd912\n```\n\n## Kube linter\n\n`kube-linter lint . \u003e audit.txt`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtrnord%2Fcluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmtrnord%2Fcluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmtrnord%2Fcluster/lists"}