https://github.com/abhishektiwari/k8s-bare-metal-microk8s
Bare metal Kubernetes using microk8s
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.9%) to scientific vocabulary
Keywords
Repository
Bare metal Kubernetes using microk8s
Basic Info
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
- Releases: 0
Topics
Metadata Files
README.md
Bare metal Kubernetes using microk8s
Instead of virtual machines (VMs), deploy mini production-grade Kubernetes cluster (ideally 3-4 nodes) directly on bare metal servers. We will use microk8s as it is a lightweight Kubernetes distribution and probably easiest and fastest way to get Kubernetes up and running.
Caution ⚠️⚠️⚠️
* microk8s may not be right choice for large clusters. Use kubeadm or other Kubernetes provisioning tools.
* snap updates are disabled for microk8s to avoid automated refresh and breaking your production cluster.
Minimum node requirements: * CPU: 4c/8t or more * RAM: 16GB or more * Disk: 256GB SSD/NVMe or more
For high-available setup: * Minimum 3 or more nodes * Network connectivity between nodes
Network connectivity between nodes can be private or public although private connectivity is recommended.
Step-by-step
Add files into data folder
See example files for your reference.
authorized_keys[Required] - Public keys of the user for ssh. Each key on a new line.ssh.users[Required] - List of users to enabled for SSH on node. Each user on a new line.channel[Required] - Kubernetes version. Current stable is1.29.cluster-ips.txt[Optional] - List of IPs formicrok8scluster nodes. Each IP on a new line.cf_token.txt[Optional]- Cloudflare token to setting up tunnelca.pub[Optional]- Cloudflare short-lived certificate public key for SSH via native terminal and/or browser-rendered terminal.
You can use Cloudflare tunnels to: (1) Connect cluster nodes with SSH. (2) Expose a Kubernetes app/service to the internet.
Setup also includes a Kubernetes manifest file to deploy httpbin service so you can test everything is working as expected.
Generate user data file
In output.sh comment out any scripts you want to exclude from generated init.sh file. Execute following,
bash output.sh
Use init.sh file when provisioning Kubernetes cluster nodes. Depending on your provider, either copy paste the file content or upload it to a secure location and use the URL as part of cloud-init (when creating node) or post installation script (after creating node).
Access nodes from native terminal
First configure your native terminal for SSH via Cloudflare tunnel. For macOS please run following,
bash macos.sh
Enable HA
On master node execute following,
microk8s add-node
This will return some joining instructions which should be executed on the other microK8s nodes that you wish to join to the cluster.
For more information on clustering see
Test scripts using Multipass
bash test.sh
Notes
microk8swas installed using Ubuntusnap. Automatedsnaprefresh formicrok8sis disabled. If you want to update then you will need to run following command on each host
snap refresh
Owner
- Name: Abhishek Tiwari
- Login: abhishektiwari
- Kind: user
- Location: NY
- Company: Amazon
- Website: https://www.abhishek-tiwari.com/
- Twitter: abhishektiwari
- Repositories: 35
- Profile: https://github.com/abhishektiwari
Tech Savant, Servant Leade.
GitHub Events
Total
- Watch event: 3
Last Year
- Watch event: 3
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Abhishek Tiwari | a****k@a****m | 26 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- click >=8.1
- paramiko >=3.4.0
- PyNaCl ==1.5.0
- bcrypt ==4.1.2
- cffi ==1.16.0
- click ==8.1.7
- cryptography ==41.0.7
- paramiko ==3.4.0
- pycparser ==2.21