设置时区 每个节点都要操作
timedatectl set-timezone Asia/Shanghai
查看时区
timedatectl
安装环境依赖
yum install -y socat conntrack ebtables ipset
安装时间同步 每个节点都要操作
yum install chrony -y # 安装时间同步服务
systemctl enable chronyd.service # 启用时间同步服务
systemctl start chronyd.service # 开启时间同步服务
查看时区
timedatectl status
安装文件的配置 这个要使用vi工具 不要使用vim 不然会乱码
写到这个文件里 路径和名字都可以自己定义 /var/k8sc.yaml
apiVersion: kubekey.kubesphere.io/v1alpha2
kind: Cluster
metadata:
name: sample
spec: # 指定主机列表,每个主机有名称、地址、内部地址、用户名和密码等属性。
hosts:
- {name: node1, address: 192.168.40.188, internalAddress: 192.168.40.188, user: root, password: ""} # 每个主机列表中的账户密码需要与本机真实用户密码对应
- {name: node2, address: 192.168.40.138, internalAddress: 192.168.40.138, user: root, password: ""}
roleGroups: # 指定角色组
etcd: # 责存储集群的配置数据、状态信息和元数据。
- node1 # etcd 节点名称
control-plane: # 主节点名称
- node1
worker: # 工作节点名称
- node2
controlPlaneEndpoint: # 指定控制平面的终结点信息,包括域名、地址和端口号。
## Internal loadbalancer for apiservers
# internalLoadbalancer: haproxy
domain: lb.kubesphere.local
address: ""
port: 6443
kubernetes: # :指定Kubernetes的版本和集群名称等参数
version: v1.22.12
clusterName: cluster.local
autoRenewCerts: true
containerManager: docker
etcd:
type: kubekey
network: # 指定网络配置,包括网络插件和Pods和服务的CIDR等参数
plugin: calico
kubePodsCIDR: 10.233.64.0/18 # 注意,网络地址不要与真实的Ip地址冲突
kubeServiceCIDR: 10.233.0.0/18
## multus support. https://github.com/k8snetworkplumbingwg/multus-cni
multusCNI:
enabled: false
registry:
privateRegistry: ""
namespaceOverride: ""
registryMirrors: []
insecureRegistries: []
addons: []
---
apiVersion: installer.kubesphere.io/v1alpha1
kind: ClusterConfiguration
metadata:
name: ks-installer
namespace: kubesphere-system
labels:
version: v3.3.2
spec:
persistence:
storageClass: ""
authentication:
jwtSecret: ""
zone: ""
local_registry: ""
namespace_override: ""
# dev_tag: ""
etcd: # 指定Etcd的监控配置和端点信息
monitoring: false
endpointIps: localhost
port: 2379
tlsEnable: true
common: # 指定通用配置,包括核心组件、Redis、OpenLDAP等参数
core:
console:
enableMultiLogin: true
port: 30880
type: NodePort
# apiserver:
# resources: {}
# controllerManager:
# resources: {}
redis:
enabled: false
volumeSize: 2Gi
openldap:
enabled: false
volumeSize: 2Gi
minio:
volumeSize: 20Gi
monitoring: # 指定监控配置,包括Prometheus的终结点信息和GPU监控等参数
# type: external
endpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090
GPUMonitoring:
enabled: false
gpu:
kinds:
- resourceName: "nvidia.com/gpu"
resourceType: "GPU"
default: true
es:
# master:
# volumeSize: 4Gi
# replicas: 1
# resources: {}
# data:
# volumeSize: 20Gi
# replicas: 1
# resources: {}
logMaxAge: 7
elkPrefix: logstash
basicAuth:
enabled: false
username: ""
password: ""
externalElasticsearchHost: ""
externalElasticsearchPort: ""
alerting:
enabled: false
# thanosruler:
# replicas: 1
# resources: {}
auditing:
enabled: false
# operator:
# resources: {}
# webhook:
# resources: {}
devops:
enabled: false
# resources: {}
jenkinsMemoryLim: 8Gi
jenkinsMemoryReq: 4Gi
jenkinsVolumeSize: 8Gi
events:
enabled: false
# operator:
# resources: {}
# exporter:
# resources: {}
# ruler:
# enabled: true
# replicas: 2
# resources: {}
logging: # 指定日志配置,包括日志边车的副本数等参数
enabled: false
logsidecar:
enabled: true
replicas: 2
# resources: {}
metrics_server:
enabled: false
monitoring:
storageClass: ""
node_exporter:
port: 9100
# resources: {}
# kube_rbac_proxy:
# resources: {}
# kube_state_metrics:
# resources: {}
# prometheus:
# replicas: 1
# volumeSize: 20Gi
# resources: {}
# operator:
# resources: {}
# alertmanager:
# replicas: 1
# resources: {}
# notification_manager:
# resources: {}
# operator:
# resources: {}
# proxy:
# resources: {}
gpu:
nvidia_dcgm_exporter:
enabled: false
# resources: {}
multicluster:
clusterRole: none
network:
networkpolicy:
enabled: false
ippool:
type: none
topology:
type: none
openpitrix:
store:
enabled: false
servicemesh:
enabled: false
istio:
components:
ingressGateways:
- name: istio-ingressgateway
enabled: false
cni:
enabled: false
edgeruntime:
enabled: false
kubeedge:
enabled: false
cloudCore:
cloudHub:
advertiseAddress:
- ""
service:
cloudhubNodePort: "30000"
cloudhubQuicNodePort: "30001"
cloudhubHttpsNodePort: "30002"
cloudstreamNodePort: "30003"
tunnelNodePort: "30004"
# resources: {}
# hostNetWork: false
iptables-manager:
enabled: true
mode: "external"
# resources: {}
# edgeService:
# resources: {}
terminal:
timeout: 600
开始安装
标签:false,replicas,kk,enabled,volumeSize,集群,K8S,true,resources From: https://www.cnblogs.com/cfas/p/17830381.html./kk create cluster -f /var/k8sc.yaml