Open wooarchi opened 1 year ago
kube-vip is used for cluster high availability. You can access the entire cluster's API-Server using this address, without worrying about which master node the API-Server is running on. In kubekey, this component is necessary. You just need to configure an available virtual IP address.
First of all thanks for your answer.
I want to define kube_vip in cluster.yml not clustertemplate.yml.
I want to define it like in the example below.
What do you think about this?
Any good ideas would be appreciated.
cluster.yml
---
...
variables:
- name: user
value: ubuntu
- name: password
value: password
- name: instances
value:
- {address: 10.10.10.11, name: "master1", roles: ["control-plane"]}
- {address: 10.10.10.31, name: "worker1" , roles: ["worker"]}
- {address: 10.10.10.32, name: "worker2", roles: ["worker"]}
- name: controlPlaneLoadBalancer
value: 10.10.10.100
- name: kube_vip
value: ${kube_vip}
The controlPlaneLoadBalancer.value
in cluster.yaml
is actually equivalent to kube_vip.address
in ClusterTemplate.yml
. When the environment variable CONTROL_PLANE_ENDPOINT_IP
is set and the clusterctl generate cluster
command is executed, this variable will automatically populate both values.
We will consider canceling kube-vip in the future. kube-vip is not a necessary option in the case of domain or single-node setups.
I used Kubekey provider from ClusterAPI. Also, Kubernetes was deployed based on ClsterClass.
Deployment was successful. However, I think there is a problem in implementing this as GitOps.
The reason is that it is difficult to declare kube-vip address among the values ββto be declared in Cluster.yaml.
Below are parts of cluster.yml and clusterTemplate.yml.
How can I define kube-vip environment variable address in ClusterTemplate.yml in Cluster.yml?
Do you have any good ideas?
Cluster.yml
ClusterTemplate.yml