在AWS EC2上设置Kubernetes(1.18版)集群 [英] Setup Kubernetes (version 1.18) cluster on AWS EC2

查看:218
本文介绍了在AWS EC2上设置Kubernetes(1.18版)集群的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在AWS EC2上设置Kubernetes,这个网站上有一些很棒的报道

I am trying to setup Kubernetes on AWS EC2 there are writeups from this website which is wonderful

https://itnext.io/kubernetes-part-2-a-cluster-set-up-on-aws-with-aws-cloud-provider-and-aws-loadbalancer-f02c3509f2c2

我将以下配置文件用于"kubeadm init"

I used the following config file for "kubeadm init"

apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
apiServer:
  extraArgs:
    cloud-provider: "aws"
controllerManager:
  extraArgs:
    cloud-provider: "aws"

我收到一条错误消息,说aws已被贬值

I got an error message saying that aws has been depreciated

我使用了相同的文件,但云提供商更改为"openstack"

I used the same file with the cloud-provider changed to "openstack"

仍然出现错误;看起来像新版本的Kubernetes,我需要使用另一个具有配置的参数"cloud-config"

Still I am getting errors; looks like the new version of Kubernetes I need to use another parameter "cloud-config" which has the configuration

任何人都可以帮助我完成此工作以及如何使用EC2成功配置k8集群.

Can anyone help me on how this needs to be done and how I can successfully configure a k8 cluster using EC2.

推荐答案

Referring from here You can use below config for AWS.

apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
nodeRegistration:
  kubeletExtraArgs:
    cloud-provider: "openstack"
    cloud-config: "/etc/kubernetes/cloud.conf"
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
kubernetesVersion: v1.13.0
apiServer:
  extraArgs:
    cloud-provider: "openstack"
    cloud-config: "/etc/kubernetes/cloud.conf"
  extraVolumes:
  - name: cloud
    hostPath: "/etc/kubernetes/cloud.conf"
    mountPath: "/etc/kubernetes/cloud.conf"
controllerManager:
  extraArgs:
    cloud-provider: "openstack"
    cloud-config: "/etc/kubernetes/cloud.conf"
  extraVolumes:
  - name: cloud
    hostPath: "/etc/kubernetes/cloud.conf"
    mountPath: "/etc/kubernetes/cloud.conf

然后您可以执行kubeadm init --config=kubeadm-config.yml

https://kubernetes.io/blog/2020/02/07/deploying-external-openstack-cloud-provider-with-kubeadm/

如果您只是使用 Kops 在AWS上安装kubernetes,则可以避免所有这些情况.

You could avoid all of these if you just used Kops to install kubernetes on AWS.

这篇关于在AWS EC2上设置Kubernetes(1.18版)集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆