linux怎么查看本机内存大小
478
2022-10-25
rancher 集群高可用 2 - 使用rancher RKE 创建k8s集群
架构图,3个节点都是worker并且包含etcd
使用rke config 生成配置文件
rke config --name cluster.yml rke config --print
回答问题,该程序写错要重来,别问我跑了几次
最终会生成一个cluster.yml的文件
# If you intened to deploy Kubernetes in an air-gapped environment, # please consult the documentation on how to configure custom RKE images. nodes: - address: 172.17.3.164 port: "22" internal_address: "" role: - controlplane - worker - etcd hostname_override: rke-001 user: rancher docker_socket: /var/run/docker.sock ssh_key: "" ssh_key_path: ~/.ssh/id_rsa ssh_cert: "" ssh_cert_path: "" labels: {} taints: [] - address: 172.17.3.168 port: "22" internal_address: "" role: - controlplane - worker - etcd hostname_override: rke-002 user: rancher docker_socket: /var/run/docker.sock ssh_key: "" ssh_key_path: ~/.ssh/id_rsa ssh_cert: "" ssh_cert_path: "" labels: {} taints: [] - address: 172.17.3.169 port: "22" internal_address: "" role: - controlplane - worker - etcd hostname_override: rke-003 user: rancher docker_socket: /var/run/docker.sock ssh_key: "" ssh_key_path: ~/.ssh/id_rsa ssh_cert: "" ssh_cert_path: "" labels: {} taints: [] services: etcd: image: "" extra_args: {} extra_binds: [] extra_env: [] win_extra_args: {} win_extra_binds: [] win_extra_env: [] external_urls: [] ca_cert: "" cert: "" key: "" path: "" uid: 0 gid: 0 snapshot: null retention: "" creation: "" backup_config: null kube-api: image: "" extra_args: {} extra_binds: [] extra_env: [] win_extra_args: {} win_extra_binds: [] win_extra_env: [] service_cluster_ip_range: 10.43.0.0/16 service_node_port_range: "" pod_security_policy: false always_pull_images: false secrets_encryption_config: null audit_log: null admission_configuration: null event_rate_limit: null kube-controller: image: "" extra_args: {} extra_binds: [] extra_env: [] win_extra_args: {} win_extra_binds: [] win_extra_env: [] cluster_cidr: 10.42.0.0/16 service_cluster_ip_range: 10.43.0.0/16 scheduler: image: "" extra_args: {} extra_binds: [] extra_env: [] win_extra_args: {} win_extra_binds: [] win_extra_env: [] kubelet: image: "" extra_args: {} extra_binds: [] extra_env: [] win_extra_args: {} win_extra_binds: [] win_extra_env: [] cluster_domain: cluster.local infra_container_image: "" cluster_dns_server: 10.43.0.10 fail_swap_on: false generate_serving_certificate: false kubeproxy: image: "" extra_args: {} extra_binds: [] extra_env: [] win_extra_args: {} win_extra_binds: [] win_extra_env: [] network: plugin: canal options: {} mtu: 0 node_selector: {} update_strategy: null tolerations: [] authentication: strategy: x509 sans: [] webhook: null addons: "" addons_include: [] system_images: etcd: rancher/mirrored-coreos-etcd:v3.4.15-rancher1 alpine: rancher/rke-tools:v0.1.74 nginx_proxy: rancher/rke-tools:v0.1.74 cert_downloader: rancher/rke-tools:v0.1.74 kubernetes_services_sidecar: rancher/rke-tools:v0.1.74 kubedns: rancher/mirrored-k8s-dns-kube-dns:1.15.10 dnsmasq: rancher/mirrored-k8s-dns-dnsmasq-nanny:1.15.10 kubedns_sidecar: rancher/mirrored-k8s-dns-sidecar:1.15.10 kubedns_autoscaler: rancher/mirrored-cluster-proportional-autoscaler:1.8.1 coredns: rancher/mirrored-coredns-coredns:1.8.0 coredns_autoscaler: rancher/mirrored-cluster-proportional-autoscaler:1.8.1 nodelocal: rancher/mirrored-k8s-dns-node-cache:1.15.13 kubernetes: rancher/hyperkube:v1.20.6-rancher1 flannel: rancher/coreos-flannel:v0.13.0-rancher1 flannel_cni: rancher/flannel-cni:v0.3.0-rancher6 calico_node: rancher/mirrored-calico-node:v3.17.2 calico_cni: rancher/mirrored-calico-cni:v3.17.2 calico_controllers: rancher/mirrored-calico-kube-controllers:v3.17.2 calico_ctl: rancher/mirrored-calico-ctl:v3.17.2 calico_flexvol: rancher/mirrored-calico-pod2daemon-flexvol:v3.17.2 canal_node: rancher/mirrored-calico-node:v3.17.2 canal_cni: rancher/mirrored-calico-cni:v3.17.2 canal_controllers: rancher/mirrored-calico-kube-controllers:v3.17.2 canal_flannel: rancher/coreos-flannel:v0.13.0-rancher1 canal_flexvol: rancher/mirrored-calico-pod2daemon-flexvol:v3.17.2 weave_node: weaveworks/weave-kube:2.8.1 weave_cni: weaveworks/weave-npc:2.8.1 pod_infra_container: rancher/mirrored-pause:3.2 ingress: rancher/nginx-ingress-controller:nginx-0.43.0-rancher3 ingress_backend: rancher/mirrored-nginx-ingress-controller-defaultbackend:1.5-rancher1 metrics_server: rancher/mirrored-metrics-server:v0.4.1 windows_pod_infra_container: rancher/kubelet-pause:v0.1.6 aci_cni_deploy_container: noiro/cnideploy:5.1.1.0.1ae238a aci_host_container: noiro/aci-containers-host:5.1.1.0.1ae238a aci_opflex_container: noiro/opflex:5.1.1.0.1ae238a aci_mcast_container: noiro/opflex:5.1.1.0.1ae238a aci_ovs_container: noiro/openvswitch:5.1.1.0.1ae238a aci_controller_container: noiro/aci-containers-controller:5.1.1.0.1ae238a aci_gbp_server_container: noiro/gbp-server:5.1.1.0.1ae238a aci_opflex_server_container: noiro/opflex-server:5.1.1.0.1ae238a ssh_key_path: ~/.ssh/id_rsa ssh_cert_path: "" ssh_agent_auth: false authorization: mode: rbac options: {} ignore_docker_version: null kubernetes_version: "" private_registries: [] ingress: provider: "" options: {} node_selector: {} extra_args: {} dns_policy: "" extra_envs: [] extra_volumes: [] extra_volume_mounts: [] update_strategy: null 0 0 network_mode: "" tolerations: [] default_backend: null default_"" nginx_ingress_controller_priority_class_name: "" cluster_name: "" cloud_provider: name: "" prefix_path: "" win_prefix_path: "" addon_job_timeout: 0 bastion_host: address: "" port: "" user: "" ssh_key: "" ssh_key_path: "" ssh_cert: "" ssh_cert_path: "" monitoring: provider: "" options: {} node_selector: {} update_strategy: null replicas: null tolerations: [] metrics_server_priority_class_name: "" restore: restore: false snapshot_name: "" rotate_encryption_key: false dns: null
rke up起cluster,公司的网络pull image你懂得,容我天台兜一圈
回来之后还是卡在pulling image,容我再兜一圈
终于好了,花费半个多小时
看下跑的怎么样
把生成的cluster yml复制到k8s目录
cp kube_config_cluster.yml /etc/kubernetes/admin.conf
看下node,都起来了
3个文件存一下
cluster.yml:
The RKE cluster configuration file.
kube_config_cluster.yml:
The Kubeconfig file for the cluster, this file contains credentials for full access to the cluster.
cluster.rkestate:
The Kubernetes Cluster State file, this file contains credentials for full access to the cluster.
添加删除节点
更新cluster.yml,然后
rke up
如果只是添加worker节点
rke up --update-only cluster.yml
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~