#裸金属的 install-config.yaml 参数
此页面列出了 ac 根据裸金属业务集群的 install-config.yaml 渲染的对象。有关模板及其字段,请参阅编写 install-config.yaml。
#渲染的清单
ac 将其应用于 <install-dir>/manifests/ 的对象写入文件,每个对象对应一个文件。所有对象都位于 cpaas-system 命名空间中。有关其 API 字段,请参阅 API 参考。
| 对象 | 名称 | 备注 |
|---|---|---|
Secret | <cluster-name>-encryption-provider-config | 由 BaremetalCluster 引用的加密配置。 |
Cluster | <cluster-name> | 标记为 cluster-type: ProviderBaremetal。cpaas.io/registry-address 注解包含 registry 地址。 |
BaremetalCluster | <cluster-name> | controlPlaneLoadBalancer 根据 cluster.network.loadBalancer 设置,类型写为 Internal 或 External。 |
BaremetalMachineTemplate、KubeadmControlPlane | <cluster-name>-control-plane | 模板引用控制平面池。当副本数为 3 或更多时,滚动更新策略为 rolloutStrategy.rollingUpdate.maxSurge: 0。单个副本不会设置滚动更新策略。不支持升级只有一个控制平面节点的裸金属集群。 |
BaremetalMachineTemplate、MachineDeployment | <cluster-name>-<group> | 模板引用该组的池。maxSurge: 0、maxUnavailable: 1。 |
KubeadmConfigTemplate | <cluster-name>-<group>-config |
您需要自行管理 MachineRegistration、SeedImage 和各个池。ac 不会渲染或删除这些对象。
#Worker 对象
创建集群中模板的 Worker 对象渲染如下。引导模板的 files 和 users 已缩写。
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: BaremetalMachineTemplate
metadata:
name: <cluster-name>-worker
namespace: cpaas-system
spec:
template:
spec:
machineInventoryPoolRef:
name: <cluster-name>-worker-pool
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: <cluster-name>-worker-config
namespace: cpaas-system
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
volume-plugin-dir: /opt/libexec/kubernetes/kubelet-plugins/volume/exec/
patches:
directory: /etc/kubernetes/patches
postKubeadmCommands:
- chmod 600 /var/lib/kubelet/config.yaml
# files: the kubelet configuration patch; users: the boot user with cluster.sshKeys
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: <cluster-name>-worker
namespace: cpaas-system
spec:
clusterName: <cluster-name>
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
template:
spec:
clusterName: <cluster-name>
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
name: <cluster-name>-worker-config
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: BaremetalMachineTemplate
name: <cluster-name>-worker
nodeDrainTimeout: 5m
version: <kubernetes-version>