{"id":16826842,"url":"https://github.com/retocode/local-cluster-setup","last_synced_at":"2025-03-17T19:45:13.144Z","repository":{"id":154107306,"uuid":"590812328","full_name":"ReToCode/local-cluster-setup","owner":"ReToCode","description":"This repository sets up a kind cluster on MacOS with Load Balancers provided by metal an routing from MacOS to Podman","archived":false,"fork":false,"pushed_at":"2024-03-27T08:06:58.000Z","size":178,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T07:08:16.654Z","etag":null,"topics":[],"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/ReToCode.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-01-19T09:14:22.000Z","updated_at":"2023-12-13T15:46:00.000Z","dependencies_parsed_at":"2024-03-27T09:27:25.468Z","dependency_job_id":"d5efe576-0e5b-4152-834f-2f801c52f431","html_url":"https://github.com/ReToCode/local-cluster-setup","commit_stats":null,"previous_names":["retocode/local-cluster-setup"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReToCode%2Flocal-cluster-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReToCode%2Flocal-cluster-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReToCode%2Flocal-cluster-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ReToCode%2Flocal-cluster-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ReToCode","download_url":"https://codeload.github.com/ReToCode/local-cluster-setup/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244102039,"owners_count":20398379,"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":[],"created_at":"2024-10-13T11:18:37.414Z","updated_at":"2025-03-17T19:45:13.115Z","avatar_url":"https://github.com/ReToCode.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Set up a local docker env on macOS with service type LoadBalancer working\n\n## Colima\n\nColima with the VZ driver is the best solution for now, it has the least CPU/memory overhead and runs super stable. \n\n```bash\ncolima start --cpu 4 --memory 16 --disk 100 --kubernetes --vm-type=vz\n\n./install_colima_cluster.sh\n\n# get ssh port for forwarding from:\ncolima ssh-config\n```\n\nYou can also use Coretunnel to open a permanent SSH tunnel to forward ports 80/443 to the local IP.\n\n\n## Minikube as K8s and docker environment\n\n```bash\nbrew install minikube\n\nminikube start --driver qemu --network qemu --cpus 8 --memory 16g\neval $(minikube docker-env)\nexport KO_DOCKER_REPO=ko.local\n```\n\nUse Core Tunnel to permanently forward 80 -\u003e 8080 \u0026 443 -\u003e 8443 to MacOS\n\n![coretunnel](./img/coretunnel.png)\n\nUse nginx to remap ports 8080 -\u003e 80 \u0026 8443 -\u003e 443 to avoid adding ports to URLs:\n\n```bash\nbrew install nginx\nsudo cp nginx/nginx.conf /opt/homebrew/etc/nginx/nginx.conf\nsudo brew services start nginx\n```\n\n## Podman\n\n### Prerequisites\n\nCreate a podman VM\n\n```bash\npodman machine init --cpus 8 --memory=16000 --rootful\nexport DOCKER_HOST='unix:///Users/rlehmann/.local/share/containers/podman/machine/podman-machine-default/podman.sock'\n```\n\nUpdate ulimits in podman VM with\n\n```bash\npodman machine ssh --username root -- sysctl -w fs.inotify.max_user_instances=100000\npodman machine ssh --username root -- sysctl -w fs.inotify.max_user_watches=100000\n```\n\nIf the time in the podman VM is off (happens when the host-os is in in hibernation), update it with\n```bash\npodman machine ssh --username root -- sed -i 's/^makestep\\ .*$/makestep\\ 1\\ -1/' /etc/chrony.conf\npodman machine ssh --username root -- systemctl restart chronyd\n```\n\n### Create a kind environment with MetalLB\n\n```bash\n# Create a kind cluster\n./create_cluster.sh\n```\n\nYou can now deploy something that exposes a service with type `LoadBalancer` and reach it from macOS directly:\n\n```bash\nk get svc -n kourier-system\nNAME               TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE\nkourier            LoadBalancer   10.96.23.149    10.89.0.200   80:30067/TCP,443:30550/TCP   25m\nkourier-internal   ClusterIP      10.96.234.152   \u003cnone\u003e        80/TCP,443/TCP               25m\n\ncurl  -iv 10.89.0.200:80\n*   Trying 10.89.0.200:80...\n* Connected to 10.89.0.200 (10.89.0.200) port 80 (#0)\n\u003e GET / HTTP/1.1\n\u003e Host: 10.89.0.200\n\u003e User-Agent: curl/7.86.0\n\u003e Accept: */*\n\u003e\n* Mark bundle as not supporting multiuse\n\u003c HTTP/1.1 404 Not Found\nHTTP/1.1 404 Not Found\n\u003c date: Mon, 13 Feb 2023 10:29:25 GMT\ndate: Mon, 13 Feb 2023 10:29:25 GMT\n\u003c server: envoy\nserver: envoy\n\u003c content-length: 0\ncontent-length: 0\n\n\u003c\n* Connection #0 to host 10.89.0.200 left intact\n```\n\n### Install Knative Serving\n```bash\n# Option with kourier\n./install_serving_kourier.sh\n\n# Install Istio + net-istio\n./install_istio_and_net_istio.sh\n```\n\n\n### Install Knative Eventing\n```bash\n./install_eventing_kafka.sh\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretocode%2Flocal-cluster-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fretocode%2Flocal-cluster-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fretocode%2Flocal-cluster-setup/lists"}