{"id":19615285,"url":"https://github.com/gbih/kubernetes-study-notes","last_synced_at":"2026-05-02T22:32:10.327Z","repository":{"id":176745286,"uuid":"299289031","full_name":"gbih/Kubernetes-study-notes","owner":"gbih","description":"\"Kubernetes in Action\" study notes","archived":false,"fork":false,"pushed_at":"2022-08-28T09:04:49.000Z","size":38024,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T10:35:01.486Z","etag":null,"topics":["go","kubernetes","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/gbih.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":"2020-09-28T11:38:09.000Z","updated_at":"2022-08-28T09:03:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"8b70cfc1-da19-4ad7-bae6-aac7d796360a","html_url":"https://github.com/gbih/Kubernetes-study-notes","commit_stats":null,"previous_names":["gbih/kubernetes-study-notes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FKubernetes-study-notes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FKubernetes-study-notes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FKubernetes-study-notes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbih%2FKubernetes-study-notes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbih","download_url":"https://codeload.github.com/gbih/Kubernetes-study-notes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240907161,"owners_count":19876684,"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":["go","kubernetes","shell"],"created_at":"2024-11-11T10:56:06.546Z","updated_at":"2026-05-02T22:32:05.306Z","avatar_url":"https://github.com/gbih.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Study Notes for Kubernetes In Action, v1\n\n1. Use multipass on OSX with microk8s\n2. As much as possible, build Go demo programs (instead of Node.js)\n3. Update any outdated or deprecated APIs\n4. Eventually translate to Japanese\n\n* Original source at:\n[Kubernetes In Action, v1](https://www.manning.com/books/kubernetes-in-action)\n\n------------\n\n## Multipass installation and Ubuntu VM setup\n\n* [Download Multipass installler](https://multipass.run)\n\n* Install Ubuntu virtual instance via Multipass. Defaults include:\n--cpus 1\n--disk 5G\n--mem 1G\n\n```shell\nmultipass launch --name actionbook-vm --disk 50G\n```\n\n* Check VM info\n```shell\nmultipass info actionbook-vm\n```\n\n## MicroK8s installation\n\n* Log into multipass shell\n```shell\nmultipass shell actionbook-vm\n```\n\n* Install MicroK8s\n\n```shell\nsudo snap install microk8s --classic --channel=1.19/stable\n```\n\n\n* We want to explore etcdctl later. Even though Microk8s 1.19 now uses dqlite as the default, we can revert to etcd by disabling ha-cluster:\n```shell\nmicrok8s.disable ha-cluster\nsudo snap install etcd\n```\n\n\n* Add the user ubuntu to the 'microk8s' group:\n```shell\nsudo usermod -a -G microk8s ubuntu\nsudo chown -f -R ubuntu ~/.kube\n```\n\nThen logout and login.\n\n* Check the status while Kubernetes starts\n```shell\nmicrok8s status --wait-ready\nmicrok8s config \u003e microk8s.yaml\n```\n\n* Create alias\n```shell\nsudo snap alias microk8s.kubectl kubectl\n```\n\n* Turn on the services you want\n```shell\nmicrok8s enable dns storage ingress metallb\nmicrok8s status\n```\n\n* Confirm running services\n```\nmicrok8s.inspect\n```\n\n-----------------------\n\n## Docker installation\n\n```shell\nsudo apt-get update\nsudo apt install docker.io\nsudo docker version\nsudo docker login --username **** --password ****\n```\n\nIf you don't want to preface the docker command with sudo, create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group.\nTo create the docker group and add your user:\n\nCreate the docker group.\n`sudo groupadd docker`\n\nAdd your user to the docker group.\n`sudo usermod -aG docker $USER`\n\nLog out and log in\n\n\n`docker info`\n\n* Test\n`docker run busybox echo \"Hello world\"`\n\n-----------------------\n\n## Terminal setup\n\n1. Shorten bash shell:\n\nAdd to ~/.bashrc\n\n`vi ~/.bashrc`\n`PS1='\\W\\$ '`\n\n\n```shell\nexport PROMPT_DIRTRIM=1\nPS1='\\u:\\W\\$ '\n```\n\n????\n\n\nReload these scripts:\n`source ~/.bashrc`\n`source ~/.bash_profile`\n\n\n2. Install resize\n\n```shell\nsudo apt-get update\nsudo apt-get install xterm\nsudo apt-get install rename\n```\n\n\n\n\n-----------------------\n\n## Backup script\n\n* Backup from multipass instance to host computer\n\nAssuming you keep your work files on instance 'actionbook-vm' in the directory /home/ubuntu/src, create a tar.gz file and transfer it to a local host.\n\n```shell\nmultipass exec actionbook-vm -- tar -cvzf /home/ubuntu/src.tar.gz /home/ubuntu/src \u0026\u0026 multipass transfer actionbook-vm:/home/ubuntu/src.tar.gz /Users/username/K8s-in-Action-Book/src\n```\n\n\n* Restore from host to multipass instance\n\n```shell\n\nmultipass transfer /Users/username/Desktop/K8s-in-Action-Book/src.tar.gz actionbook-vm:/home/ubuntu/src/src.tar.gz\n```\n\nNote that multipass transfer requires the destination to be a file.\n\n\nTo extract a tar.gz file, use the --extract (-x) operator and specify the archive file name after the f option:\n`tar -xvf src.tar.gz`\n\n\ncd into install directory\n`mv /home/ubuntu/install/home/ubuntu/src /home/ubuntu/src`\n\n-----------------------\n\n## Check Initial install:\n\nConfirm file system layout and available disk space:\n\n`df`\n\n```shell\nFilesystem     1K-blocks    Used Available Use% Mounted on\nudev             5103820       0   5103820   0% /dev\ntmpfs            1023320    1092   1022228   1% /run\n/dev/sda1       40470732 4272660  36181688  11% /\ntmpfs            5116580       0   5116580   0% /dev/shm\ntmpfs               5120       0      5120   0% /run/lock\ntmpfs            5116580       0   5116580   0% /sys/fs/cgroup\n/dev/sda15        106858    3668    103190   4% /boot/efi\n/dev/loop0         93568   93568         0 100% /snap/core/8689\n/dev/loop1        196608  196608         0 100% /snap/microk8s/1293\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbih%2Fkubernetes-study-notes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbih%2Fkubernetes-study-notes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbih%2Fkubernetes-study-notes/lists"}