{"id":15685314,"url":"https://github.com/flavio/salt-kubernetes-demo","last_synced_at":"2025-05-07T16:55:18.157Z","repository":{"id":66493662,"uuid":"82578138","full_name":"flavio/salt-kubernetes-demo","owner":"flavio","description":"Demo of kubernetes-salt integration","archived":false,"fork":false,"pushed_at":"2017-08-10T06:57:00.000Z","size":15,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-31T12:05:00.130Z","etag":null,"topics":["kubernetes","salt","saltstack"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flavio.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":"2017-02-20T16:22:55.000Z","updated_at":"2018-01-11T02:07:52.000Z","dependencies_parsed_at":"2023-02-21T12:46:23.458Z","dependency_job_id":null,"html_url":"https://github.com/flavio/salt-kubernetes-demo","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/flavio%2Fsalt-kubernetes-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavio%2Fsalt-kubernetes-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavio%2Fsalt-kubernetes-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flavio%2Fsalt-kubernetes-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flavio","download_url":"https://codeload.github.com/flavio/salt-kubernetes-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252921953,"owners_count":21825632,"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":["kubernetes","salt","saltstack"],"created_at":"2024-10-03T17:24:45.873Z","updated_at":"2025-05-07T16:55:18.137Z","avatar_url":"https://github.com/flavio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"This is a demo playground of the salt-kubernetes module.\n\n## Requirements\n\n### Getting the Kubernetes up and running\n\nDownload k8s all-in-one libvirt machine from [here](https://filr.attachmategroup.com/ssf/s/readFile/share/88236/4263111497095896051/publicLink/kubernetes-101.qcow2.xz).\nThis is a openSUSE VM that has all the kubernetes bits and pieces already\nconfigured.\n\nRight now it's not possible to use minikube images because they don't have python\ninstalled. I'm currently working on a minikube image based on openSUSE that\nhas all the required pieces.\n\nOnce you download the image extract it to a storage location known by your libvirtd\ndaemon and edit the `kubernetes.xml` file shipped inside of this repo by putting\nthe location of the VM into the `FIXME` field.\n\nThen execute the following command:\n\n```\nsudo virsh define kubernetes.xml\nsudo virsh start kubernetes\n```\n\nThe VMs credentials are:\n\n  * username `root`: password `linux`\n  * username `geeko`: password `linux`\n\n### Install Kubernetes python client\n\nThe Kubernetes salt module relies on the\n[official python client](https://github.com/kubernetes-incubator/client-python)\nto be installed inside of the VM.\n\nYou can do that by ssh-ing into the machine and then doing:\n\n```\nsudo zypper in python-pip\nsudo pip install kubernetes\n```\n\n### Checkout the kubernetes module (optional)\n\nRight now the code defining the kubernetes modules lives inside of\n[this public repository](https://github.com/flavio/salt/tree/kubernetes-modules)\n\nFor convenience reasons this repository has a copy of the kubernetes\nmodule and state files. These files are going to be **out of sync** with the\ncontents of the original PR.\n\nYou can clone the repository holding the official source code of the kubernetes\nmodule and then replace the following files with hard links:\n\n  * `srv/salt/_modules/kubernetes.py`\n  * `srv/salt/_states/kubernetes.py`\n\n\n### Configure salt-ssh\n\nMake sure `salt-ssh` is installed on your host.\n\nOnce the VM is up and running you can obtain its IP address by doing:\n\n```\nsudo virsh domifaddr kubernetes\n```\n\nThen edit the `etc/salt/roster` file shipped inside of this repo and put\nthe right IP address of the kubernetes VM inside of it.\n\nNow you can test everything is working properly by doing:\n\n```\n$ salt-ssh 'kubernetes' kubernetes.ping\nkubernetes:\n    True\n```\n\n## Playing with Kubernetes\n\n\n### Managing deployments\n\nThis salt module can be used to create kubernetes deployments:\n\n[![asciicast](https://asciinema.org/a/103881.png)](https://asciinema.org/a/103881)\n\nor to remove them:\n\n[![asciicast](https://asciinema.org/a/103881.png)](https://asciinema.org/a/103881)\n\n### Managing deployments and services\n\nIt's also possible to deploy the complete [guestbook 101 application](https://github.com/kubernetes/kubernetes/tree/master/examples/guestbook) using salt:\n\nDeploying the full stack:\n\n[![asciicast](https://asciinema.org/a/103883.png)](https://asciinema.org/a/103883)\n\nRemoving the entire stack:\n\n[![asciicast](https://asciinema.org/a/103884.png)](https://asciinema.org/a/103884)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflavio%2Fsalt-kubernetes-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflavio%2Fsalt-kubernetes-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflavio%2Fsalt-kubernetes-demo/lists"}