预防高原反应吃什么药| 刚怀孕吃什么水果对胎儿好| 舌根苔白厚腻是什么原因| 拔牙后能吃什么东西| 隙是什么意思| 受割礼是什么意思| 月经期间不能吃什么| 什么学步成语| 创伤性湿肺是什么意思| 丙肝病毒抗体阴性是什么意思| rinnai是什么品牌| 头晕是什么情况| 8月13号什么星座| 抗组胺药是什么意思| 鱼油有什么作用| 肌酐偏高是什么意思| 肚脐眼臭是什么原因| 雨五行属什么| 与什么有关| 斯沃琪手表什么档次| 牙周炎吃什么药最有效| 欺人太甚什么意思| 捡帽子有什么说法吗| 海蛎子是什么| 什么原因| 谶语是什么意思| 反常是什么意思| 吃什么补眼睛| 当归不能和什么一起吃| 舌头有裂纹是什么原因| toryburch什么牌子| 马提尼是什么酒| 阴虚吃什么好| 上火喝什么药| 什么饮料可以解酒| 七六年属什么生肖| 单核细胞高是什么感染| 吃什么对脾胃有好处| 尖酸刻薄什么意思| 痰湿是什么意思| 属相是什么意思| 三百年前是什么朝代| 齿加禹念什么| 装牙套有什么坏处| 绍兴有什么大学| 扒灰什么意思| 网线长什么样| 乙肝小三阳是什么意思| 什么牌子的氨糖好| 胃酸是什么颜色的| 什么是pp材质| rh因子阳性是什么意思| 省公安厅厅长是什么级别| 七月是什么季节| 绛紫色是什么颜色| 腹泻肚子疼吃什么药| 噩梦是什么意思| 直博生是什么意思| 山楂什么季节成熟| 证件照一般是什么底色| 腰不好挂什么科| 市盈率是什么意思| 6月3号什么星座| 保鲜袋什么材质好| 产厄是什么意思| 嬴政为什么要杀吕不韦| 心脏病有什么症状表现| 为什么超市大米不生虫| 垂体催乳素高是什么原因| 牛肉补什么| 什么的足球| 2000年龙是什么命| 草莓印是什么| 优生优育是什么意思| 塑料水杯什么材质好| 10万个为什么| 煜这个字读什么| 阿司匹林治什么病| 奇亚籽有什么功效| 凌晨6点是什么时辰| 111是什么意思| 随诊什么意思| 督察是什么意思| 早泄什么症状| 蜜蜡和琥珀有什么区别| 1998年属虎的是什么命| 灵芝对身体有什么好处| 肺气不足有什么症状| 左边是心脏右边是什么| 手掌心经常出汗是什么原因| 颠鸾倒凤什么意思| 腺样体增生是什么意思| 清华大学前身叫什么| i是什么| 1964年出生属什么| 九霄云外是什么生肖| 青津果的功效是什么| 银杏叶片治什么病| 鸡蛋白是什么| 临床什么意思| 梦见山体滑坡是什么意思| 数字1代表什么意思| 中暑了吃什么| 体检需要注意什么| 蚊子为什么咬人| 智齿是什么牙| 什么药消肿最快最有效| 八月十三什么星座| 明天什么考试| 做绝育手术对女人有什么影响| 皮肤长小肉粒是什么原因| 芭乐什么味道| 普通门诊和专家门诊有什么区别| 阳虚吃什么中药| 止咳吃什么药| 负罪感是什么意思| 什么叫精神分裂症| 手臂发麻是什么原因引起的| 女人体检都查什么项目| 盆底脱垂有什么症状| 铅超标有什么症状| 揽件是什么意思| 什么样的人不能献血| 阿司匹林和阿莫西林有什么区别| 鬼蝴蝶为什么不能抓| 吃黄精有什么好处| 名存实亡是什么意思| 头大脸大适合什么发型| 维生素B3叫什么名字| 水烧开后有白色沉淀物是什么| 2月17日是什么星座| 胆固醇偏高是什么原因| 匹夫是什么意思| beaf什么意思| 后厨打荷是干什么的| 心肌炎是什么症状| 尿隐血是什么原因引起的| 百香果是什么季节的| 打呼噜的原因是什么| 按摩手推是什么意思| 肛门瘙痒涂什么药膏| 杏花是什么生肖| 为什么南极比北极冷| 什么东西可以代替阴茎| 南方元旦吃什么| yy是什么意思| 冬至要注意什么| 血栓吃什么药化得快| 和平是什么意思| 30是什么意思| 胃气不通什么症状| 腰肌劳损是什么原因引起的| 心悸心慌吃什么药| 腥是什么意思| 正常龟头什么样子| 蜻蜓点水是什么生肖| 潘多拉魔盒是什么意思| 四维彩超是检查什么| 兆上面是什么单位| 纵隔淋巴结转移是什么意思| 乇是什么意思| 红参有什么作用| 青城之恋是什么生肖| 什么是肽| 奔富红酒属于什么档次| 红牛什么时候喝效果好| 属牛的婚配什么属相最好| 唏嘘什么意思| 男人喜欢什么罩杯| 肺五行属什么| 世界上有什么| ori是什么意思| 小腿浮肿是什么原因| 梦见自己流产了是什么征兆| 6月4号什么星座| 榻榻米床垫什么材质的好| 花生不能和什么食物一起吃| 农历10月24日是什么星座| 办健康证需要检查什么| 什么水果对皮肤好祛痘| 黑加出念什么| 为什么会有荨麻疹| 汗血宝马什么意思| 维c吃多了有什么副作用| 美国为什么不敢打伊朗| 怀孕梦到老公出轨预示什么| 做梦梦到自己拉屎是什么意思| 吃什么补脾| 孕妇羊水少吃什么补的快| 6月15日是什么日子| 女人左眼皮跳是什么预兆| 狗打针打什么部位| 烧腊是什么| 截根疗法是什么| 便秘有什么症状| 手指尖发麻是什么原因| 以色列是什么人种| 葡萄糖高是什么原因| 中医把脉能看出什么病| 酸麻胀痛痒各代表什么| 指南针为什么不叫指北针| 番茄酱和番茄沙司有什么区别| 早上起床有眼屎是什么原因| 发难是什么意思| 为什么有白头发| 麦冬什么时候种植| 奇异果是什么| 食品科学与工程学什么| 医院为什么不推荐腹膜透析| 囟门闭合早有什么影响| 子宫大是什么原因| 甲亢是什么原因| 惜字如金是什么意思| 精明是什么意思| 属鼠的守护神是什么菩萨| 鸡血藤有什么作用| 淹死是什么感觉| 咽炎吃什么| 梦见穿新衣服是什么意思| 对线是什么意思| 禄神是什么意思| 桑葚酒有什么功效| 为什么有的人晒不黑| 感冒吃什么药| 高密度脂蛋白胆固醇高是什么意思| 先什么后什么| caring什么意思| ic50是什么意思| 斤加一笔是什么字| chanel是什么牌子| 螨虫长什么样子图片| 连长相当于地方什么官| 蚝油可以用什么代替| MR医学上是什么意思| 胆囊炎属于什么科| 宫外孕有什么症状| 入职体检挂什么科| 猪利是什么| 上焦中焦下焦是什么| 鲁字五行属什么| 母猪上树是什么生肖| 4月27日是什么星座| 幺妹是什么意思| 1972年是什么年| VH是什么品牌| 看对眼是什么意思| 原始心管搏动是什么意思| 狗血是什么意思| 万力什么字| 什么的梨花| 淋巴细胞是什么| 六个点是什么意思| 肌钙蛋白高说明什么| 什么是隐血| 甲状腺结节挂什么科| 调戏是什么意思| oce是什么牌子| 什么原因导致性功能减退| 糖类抗原是什么| 一什么骆驼| 喉咙沙哑吃什么药| 薏米是什么米| 个体户是什么职业| 什么是蝴蝶宝宝| 百度
Skip to content

Enable enthusiasts and administrators alike to easily provision highly available and production-ready Kubernetes clusters on Proxmox VE.

License

Notifications You must be signed in to change notification settings

zimmertr/TJs-Kubernetes-Service

Repository files navigation

TJ's Kubernetes Service


Summary

TJ's Kubernetes Service, or TKS, is an IaC project that is used to deliver Kubernetes to Proxmox. Across the years, it has evolved many times and has used a multitude of different technologies. Nowadays, it is a relatively simple collection of Terraform manifests thanks to the work of BPG and Sidero Labs.


Requirements

Requirement Description
terraform Used for creating the cluster
kubectl Used for upgrading the Talos nodes to install QEMU Guest Agent and removing nodes from the cluster
talosctl Used for upgrading the Talos nodes to install QEMU Guest Agent and removing nodes from the cluster
ssh-agent Used for connecting to the Proxmox server to bootstrap the Talos image
Proxmox You already know
DNS Resolver Used for configuring DHCP reservation during cluster creation and DNS resolution within the cluster

Instructions

  1. Configure SSH access with a private key to your Proxmox server. This is needed to provision the installation image and also for certain API actions executed by the Terraform provider.

  2. Create an API token on Proxmox. I use my create_user Ansible role to create mine.

  3. Add your SSH key to ssh-agent:

    eval "$(ssh-agent -s)"
    ssh-add --apple-use-keychain ~/.ssh/sol.Milkyway
  4. Set the environment variables required to authenticate to your Proxmox server according to the provider docs. I personally use an API Token and define them in vars/config.env. Source them into your shell.

    source vars/config.env
  5. Review variables.tf and set any overrides according to your environment in a new tfvars file.

  6. Create DNS records and DHCP reservations for your nodes according to your configured Hostname, MAC address, and IP Address prefixes. Here is how mine is configured for two clusters:

    Hostname MAC Address IP Address
    k8s-vip N/A 192.168.40.10
    k8s-cp-1 00:00:00:00:00:11 192.168.40.11
    k8s-cp-2 00:00:00:00:00:12 192.168.40.12
    k8s-cp-3 00:00:00:00:00:13 192.168.40.13
    k8s-node-1 00:00:00:00:00:21 192.168.40.21
    k8s-node-2 00:00:00:00:00:22 192.168.40.22
    k8s-node-3 00:00:00:00:00:23 192.168.40.23
    test-k8s-vip N/A 192.168.40.50
    test-k8s-cp-1 00:00:00:00:00:51 192.168.40.51
    test-k8s-cp-2 00:00:00:00:00:52 192.168.40.52
    test-k8s-cp-3 00:00:00:00:00:53 192.168.40.53
    test-k8s-node-1 00:00:00:00:00:61 192.168.40.61
    test-k8s-node-2 00:00:00:00:00:62 192.168.40.62
    test-k8s-node-3 00:00:00:00:00:63 192.168.40.63
  7. Initialize Terraform and create a workspace for your Terraform state. Or configure a different backend accordingly.

    terraform init
    terraform workspace new test
  8. Create the cluster

    terraform apply --var-file="vars/test.tfvars"
  9. Retrieve the Kubernetes and Talos configuration files. Be sure not to overwrite any existing configs you wish to preserve. I use kubecm to add/merge configs and kubectx to change contexts.

    mkdir -p ~/.{kube,talos}
    touch ~/.kube/config
    
    terraform output -raw talosconfig > ~/.talos/config-test
    terraform output -raw kubeconfig > ~/.kube/config-test
    
    kubecm add -f ~/.kube/config-test
    kubectx admin@test
  10. Confirm Kubernetes is bootstrapped and that all of the nodes have joined the cluster. The Controlplane nodes might take a moment to respond. You can confirm the status of each Talos node using talosctl or by reviewing the VM consoles in Proxmox.

    watch kubectl get nodes,all -A

Post Install

Installing QEMU Guest Agent

Talos installs the QEMU Guest Agent, but it won't be enabled until the nodes are upgraded. Once everything in the cluster has become Ready, upgrade the nodes using talosctl or the manage_nodes script. If you opted to disable Flannel, you need to install a CNI before this will work.

NODES=$(kubectl get nodes --no-headers=true | awk '{print $1}' | tr '\n' ',')
./bin/manage_nodes upgrade $NODES

Installing A Different CNI

By default, Talos uses Flannel. To use a different CNI make sure that var.talos_disable_flannel is set to true during provisioning. The cluster will not be functional and you will not be able to upgrade the nodes to install QEMU Guest Agent until a CNI is enabled. Cilium can be installed using my project found here. You will also likely want to install Kubelet CSR Approver to automatically. accept the required certificate signing requests. Alternatively, after installing you can accept them manually:

kubectl get csr
kubectl certificate approve $CSR

Scaling the Cluster

The Terraform provider makes it quite easy to scale in, out, up, or down. Simply adjust the variables for resources or desired number of nodes and run terraform plan again. If the plan looks good, apply it.

In the event you scale down a node, terraform will execute a local-provisioner that runs manage_nodes to remove the node from the cluster for you as well:

./bin/manage_nodes remove $NODE

Considerations:

  • As QEMU Guest Agent's installation is not managed by Terraform, be sure to run ./bin/manage_nodes upgrade $NODE against any new nodes that are added to enable it. Otherwise, Terraform will have issues interacting with it through the Proxmox API.
  • At this time I don't think it's possible to choose a specific node to remove. You must scale up and down the last node.
  • Due to the way I configure IP Addressing using DHCP reservations, there is a limit of both 9 controlplanes and 9 workernodes.

Installing Other Apps

You can find my personal collection of manifests here.


Troubleshooting

Terraform is Stuck Deleting

Proxmox won't be able to issue a shutdown signal to the virtual machines unless QEMU Guest Agent is enabled. This can lead to Terraform trying to destroy nodes unsuccessfully until the API times out the command. In the event this occurs, you can work connect to Proxmox manually and remove the VMs, then proceed with terraform destroy as usual. For example:

ssh -i ~/.ssh/sol.milkyway root@earth.sol.milkyway "rm /var/lock/qemu-server/lock-*; qm list | grep 40 | awk '{print \$1}' | xargs -L1 qm stop && sleep 5 && qm list | grep 40 | awk '{print \$1}' | xargs -L1 qm destroy"

About

Enable enthusiasts and administrators alike to easily provision highly available and production-ready Kubernetes clusters on Proxmox VE.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 5

2月8日什么星座 胃病烧心吃什么药好 小孩缺锌吃什么补的快 养神经吃什么食物最好 唉什么意思
弱冠是什么意思 男性左下腹痛是什么原因 月经期吃什么水果好 梵高属于什么画派 八面玲珑是什么意思
肛周水泡是什么病 抑郁症去医院挂什么科 社会科学院是干什么的 什么是激素类药物 腰扭伤吃什么药
反酸是什么症状 下贱是什么意思 细菌性感染吃什么药 高血压用什么药 夏天白鸽煲什么汤最好
咳嗽咳出血是什么原因hcv9jop6ns4r.cn 乳粉是什么hcv8jop9ns7r.cn 吃什么菜对肝好怎么养肝hcv9jop6ns3r.cn 合掌是什么意思hcv8jop8ns5r.cn 为什么肚子老是胀气hcv8jop8ns3r.cn
pending是什么意思啊hcv8jop6ns9r.cn k14是什么金hcv8jop2ns4r.cn 反流性食管炎能吃什么水果hcv7jop5ns4r.cn 风湿三项检查是什么hcv7jop6ns1r.cn 血糖高是什么原因引起hcv7jop6ns1r.cn
白头翁是什么生肖hcv8jop3ns8r.cn 高血压可以喝什么饮料hcv9jop3ns8r.cn 太阳绕着什么转hcv9jop7ns5r.cn 冲菜是什么菜hcv9jop5ns4r.cn 女人梦见鱼是什么意思hcv8jop9ns7r.cn
金银花主治什么hcv8jop5ns9r.cn 认识是什么意思hcv8jop8ns9r.cn 肝肾不足证是什么意思hcv9jop7ns0r.cn 三花聚顶是什么修为hcv9jop1ns2r.cn 抗结剂对人有什么伤害hcv8jop1ns2r.cn
百度