{"id":17888295,"url":"https://github.com/squat/kubeconeu2019","last_synced_at":"2025-07-19T03:05:52.939Z","repository":{"id":73956892,"uuid":"186906262","full_name":"squat/kubeconeu2019","owner":"squat","description":"KubeCon EU 2019 talk on building multi-cloud clusters with WireGuard","archived":false,"fork":false,"pushed_at":"2020-01-08T23:47:40.000Z","size":1144,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-01T06:03:35.122Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-05-15T21:38:46.000Z","updated_at":"2023-12-15T13:28:40.000Z","dependencies_parsed_at":"2023-03-13T20:17:29.622Z","dependency_job_id":null,"html_url":"https://github.com/squat/kubeconeu2019","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/squat/kubeconeu2019","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squat%2Fkubeconeu2019","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squat%2Fkubeconeu2019/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squat%2Fkubeconeu2019/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squat%2Fkubeconeu2019/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squat","download_url":"https://codeload.github.com/squat/kubeconeu2019/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squat%2Fkubeconeu2019/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265879400,"owners_count":23843107,"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-28T13:37:01.856Z","updated_at":"2025-07-19T03:05:52.910Z","avatar_url":"https://github.com/squat.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KubeCon EU 2019\nThis repository contains the demo code for my KubeCon EU 2019 talk about building multi-cloud clusters using WireGuard.\n\n[![youtube](https://img.youtube.com/vi/iPz_DAOOCKA/0.jpg)](https://www.youtube.com/watch?v=iPz_DAOOCKA)\n\nIn this demo we will imagine we are a company like Nest that is running object detection processes on video captured by IoT devices.\nWe will run a web-app in the cloud connected to a GPU-powered image detection and labeling service in a different public cloud provider.\nThe web-app will stream video from the IoT device over a WireGuard connection to keep the data safe.\n\nSpecifically we will:\n* create a multi-cloud cluster that spans between DigitalOcean and AWS\n* create some GPU workers in AWS\n* run the workload that captures video in a device on the edge, e.g. your host capturing video from the webcam\n* peer the workload with the cluster in the cloud\n* run a computer vision process on the video captured by the edge workload\n* accelerate the computer vision using GPUs in AWS.\n\n## Prerequisites\nYou will need:\n* DigitalOcean and AWS accounts\n* Terraform installed\n* the Kilo commandline utility `kgctl` installed\n* WireGuard installed\n\n## Getting Started\n\nModify the provided `terraform.tfvars` file to suit your project:\n\n```sh\n$EDITOR terraform.tfvars\n```\n\n## Running\n\n1. Create the infrastructure:\n```shell\nterraform init\nterraform apply --auto-approve\n```\n\n2. Annotate the GPU nodes so Kilo knows they are in their own data center:\n```shell\nfor node in $(kubectl get nodes | grep -i ip- | awk '{print $1}'); do kubectl annotate node $node kilo.squat.ai/location=\"aws\"; done\n```\n\n3. Install the manifests:\n```shell\nkubectl apply -f manifests/\n```\n\n4. Create the local WireGuard link:\n```shell\nIFACE=wg0\nsudo ip link add $IFACE type wireguard\nsudo ip a add 10.5.0.1 dev $IFACE\nsudo ip link set up dev $IFACE\n```\n\n5. Generate a key-pair for the WireGuard link:\n```shell\nwg genkey | tee privatekey | wg pubkey \u003e publickey\n```\n\n6. Create a Kilo Peer on the cluster for the local WireGuard link:\n```shell\nPEER=squat\ncat \u003c\u003cEOF | kubectl apply -f -\napiVersion: kilo.squat.ai/v1alpha1\nkind: Peer\nmetadata:\n  name: $PEER\nspec:\n  allowedIPs:\n  - 10.5.0.1/32\n  publicKey: $(cat publickey)\n  persistentKeepalive: 10\nEOF\n```\n\n7. Configure the cluster as a peer of the local WireGuard link:\n```shell\nkgctl showconf peer $PEER \u003e peer.ini\nsudo wg setconf $IFACE peer.ini\nsudo wg set $IFACE private-key privatekey\n```\n\n8. Add routes to the cluster's allowed IPs:\n```shell\nfor ip in $(kgctl showconf peer $PEER | grep AllowedIPs | cut -f 3- -d ' ' | tr -d ','); do\n\tsudo ip route add $ip dev $IFACE\ndone\n```\n\n9. Run the video capture service on the \"edge\":\n```shell\ndocker run --rm --privileged -p 8080:8080 squat/kubeconeu2019 /mjpeg --bind-addr=:8080\n```\n\n10. Check out the KubeCon application in a browser!\n```shell\n$BROWSER $(kubectl get pods -o=jsonpath='{range .items[*]}{.metadata.name}{\"\\t\"}{.status.podIP}{\"\\n\"}{end}' | grep kceu | cut -f 2):8080\n```\n\n11. Finally, clean everything up:\n```shell\nterraform destroy --auto-approve\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquat%2Fkubeconeu2019","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquat%2Fkubeconeu2019","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquat%2Fkubeconeu2019/lists"}