{"id":31702128,"url":"https://github.com/giuliopime/gport","last_synced_at":"2026-05-18T06:02:55.581Z","repository":{"id":318323280,"uuid":"1065361393","full_name":"Giuliopime/gport","owner":"Giuliopime","description":"My IaC base to create the Kubernetes cluster I use for most of my projects","archived":false,"fork":false,"pushed_at":"2026-04-03T12:07:01.000Z","size":117,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T15:51:04.340Z","etag":null,"topics":["argocd","devops","gitops","hetzner","kubernetes","terraform"],"latest_commit_sha":null,"homepage":"","language":"HCL","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/Giuliopime.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-27T15:13:32.000Z","updated_at":"2026-04-03T12:07:05.000Z","dependencies_parsed_at":"2025-10-06T15:14:29.965Z","dependency_job_id":"03cb0c5a-03cb-4eb9-b35f-fd7bfc5f7510","html_url":"https://github.com/Giuliopime/gport","commit_stats":null,"previous_names":["giuliopime/gport"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Giuliopime/gport","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giuliopime%2Fgport","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giuliopime%2Fgport/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giuliopime%2Fgport/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giuliopime%2Fgport/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Giuliopime","download_url":"https://codeload.github.com/Giuliopime/gport/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Giuliopime%2Fgport/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33167430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["argocd","devops","gitops","hetzner","kubernetes","terraform"],"created_at":"2025-10-08T21:11:58.885Z","updated_at":"2026-05-18T06:02:55.574Z","avatar_url":"https://github.com/Giuliopime.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gport\nthis is my IaC for my personal projects\n\n## Hetzner cluster\nI use Hetzner as cloud provider, I create a Kubernetes cluster using k3s hosted on non-dedicated servers.    \nthis part is managed via terraform and the [terraform-hcloud-kube-hetzner](https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner) module.  \nit lives in the `/hcloud-cluster` folder.\n\n#### usage\n1) set up terraform variables:  \n```shell\ncp hcloud_cluster/terraform.tfvars.template hcloud_cluster/terraform.tfvars\n```\nthen fill the file with your values, each variable has a comment explaining how to obtain it.  \n\n2) follow kube-hetzner module [installation instructions](https://github.com/kube-hetzner/terraform-hcloud-kube-hetzner)  \n3) run terraform apply\n```shell\nterraform apply\n```\n4) it will take a bit to create the cluster, once done you can get the kubeconfig with\n```shell\nterraform output -raw kubeconfig \u003e ./kubeconfig \n```\n\n#### what gets created\n- cloudflare records for kubernetes api and grafana dashboard\n- a control-plane node pool with 3 nodes (recommended server type at least `cpx21` because 4GB of RAM are a minimum in most cases to handle the cluster well)  \n- an agent node pool for lightweight applications and core kubernetes services (the nodes are called `agent-sailboat`)  \n- an autoscaler agent node pool for general purpose applications (called `agent-as-sailboat`)\n- 2 Hetzner load balancers, one for the control plane and one for the agent nodes\n- all nodes use [`OpenSUSE MicroOS`](https://microos.opensuse.org)\n\nkubernetes wise (installed directly via the kube-hetzner Terraform module):\n- calico as the CNI\n- nginx\n- longhorn for efficient and scalable storage management  \n  is used to have fast persistant storage for stuff like DBs.  \n  uses all the nodes nvme storage and manages them together giving you a simple StorageClass that you can use in your PVCs.  \n\n  will only use the storage of nodes with the label `node.longhorn.io/create-default-disk=true`    \n  the default StorageClass name is `longhorn`  \n- kured for automatic kernel updates\n- cluster autoscaler (bless it)\n- smb support: in the future I wanna use Hetzner Storage Boxes for hosting immich and other stuff\n\n## Kubernetes resources\nKubernetes resources are managed using ArgoCD in the `/k8s-resources` folder.  \n\n#### secrets management\nSecrets cannot be commited to git, for this reason we use [sealed secrets](https://github.com/bitnami-labs/sealed-secrets)  \n\n1) Install `kubeseal` on your local machine:\n    ```shell\n    brew install kubeseal\n    ``` \n2) Follow [installation instructions](https://github.com/bitnami-labs/sealed-secrets?tab=readme-ov-file#installation) for sealed-secrets\n    ```shell\n    kubectl apply -k ./sealed-secrets-installation\n    ```\n3) Prepare secrets:  \n   In each folder under `/k8s-resources` there can be a `/secrets` folder.  \n   Each contains a `*-secret.template.yaml` file, duplicate it and remove the `.template` part from the new file name. Then fill out the values.\n4) Seal the secrets:\n    ```shell\n    chmod +x scripts/seal-secrets.sh \u0026\u0026 scripts/seal-secrets.sh\n    ```\n   (Recommended) You can also provide a specific folder to the script, instead of sealing all secrets: `scripts/seal-secrets.sh cert-manager`\n\n5) Add argocd sync wave if necessary:\n   ```yaml\n    annotations:\n      argocd.argoproj.io/sync-wave: '-1' # make sure it gets created before anything else\n   ```\n6) Commit and push the changes\n\n\u003e devs note:  \n\u003e Argocd ignores subfolders when we choose a folder as a source.  \n\u003e Even if that's the case, I still decided to ignore `secrets` folders explicitly, 'cause you never know.\n#### argocd\n1) [install ArgoCD](https://argo-cd.readthedocs.io/en/stable/getting_started/) in the cluster:\n    ```shell\n    kubectl create namespace argocd\n    kubectl apply -k ./argocd-installation --server-side\n    ```\n\n    and on your local machine:\n    ```shell\n    brew install argocd\n    ```\n2) Configure two Nginx ingresses for HTTP/HTTPS and gRPC:\n    ```shell\n    kubectl apply -f ./argocd-installation/argocd-nginx-ingresses.yaml\n    ```\n3) Login via the cli\n    ```shell\n    argocd admin initial-password -n argocd\n    ```\n   use username: admin and the password from the previous command to login\n   ```shell\n    argocd login grpc.argocd.giuliopime.dev\n    ```\n   then change the password and delete the old one\n    ```shell\n    argocd account update-password\n    ```\n    ```shell\n    kubectl delete secret argocd-initial-admin-secret -n argocd\n    ```\n4) Access the web UI [argocd.giuliopime.dev](https://argocd.giuliopime.dev) using the credentials created at the previous step\n5) Apply the resources in the `/k8s-resources` folder:\n    ```shell\n    kubectl apply -f ./argocd/gport.yaml\n    ```\n\n\u003e If you have issues with using Helm with Kustomize, then you might have to patch argocd config maps to allow helm usage from kustomize:\n```shell\nkubectl patch configmap argocd-cm -n argocd --type merge \\\n  -p '{\"data\":{\"kustomize.buildOptions\":\"--load-restrictor LoadRestrictionsNone --enable-helm\"}}'\n```\n\u003e then restart argocd:\n```shell\nkubectl rollout restart deployment argocd-repo-server -n argocd\n```\n\u003e verify configs\n```shell\nkubectl get configmap argocd-cm -n argocd \\\n  -o jsonpath='{.data.kustomize\\.buildOptions}'\n```\n   \n#### adding a repository to ArgoCD\n[full guide](https://oneuptime.com/blog/post/2026-01-25-private-git-repositories-argocd/view)  \n1) create SSH key:\n   ```shell\n   ssh-keygen -t ed25519 -C \"argocd-myrepo\" -f myrepo-deploy-key -N \"\"\n   ```\n2) go to your GitHub repository -\u003e Settings -\u003e Deploy keys -\u003e Add deploy public key\n3) open [ArgoCD repository settings](https://argocd.giuliopime.dev/settings/repos) and add the repository URL (example `git@github.com:Giuliopime/gport.git`) and the content of the private key file\n---\n\n## suggested tools / resources\n- [Lens IDE](https://k8slens.dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiuliopime%2Fgport","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgiuliopime%2Fgport","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgiuliopime%2Fgport/lists"}