Network Configuration for Access Cluster
To configure the network settings for the cluster, you need to modify the following files:
-
kube-proxy configuration file:
/etc/kubernetes/kube-proxy.conf- This file contains the configuration for the Kubernetes proxy, which handles network routing within the cluster.
-
kubelet configuration file:
/etc/kubernetes/kubelet.conf- This file contains the configuration for the Kubernetes node agent, which manages the containers and their networking on each node.
-
kube-controller-manager configuration file:
/etc/kubernetes/controller-manager.conf- This file contains the configuration for the Kubernetes controller manager, which is responsible for maintaining the desired state of the cluster.
-
kube-scheduler configuration file:
/etc/kubernetes/scheduler.conf- This file contains the configuration for the Kubernetes scheduler, which determines where to place new pods in the cluster.
In these configuration files, you can specify the network plugin to use, such as Calico or Flannel, and configure the network CIDR, service CIDR, and other network-related settings.
After making the necessary changes, you will need to restart the corresponding Kubernetes components for the changes to take effect." weight = 30 +++
Description of the scene
Before accessing the cluster, it is only ensured that the global can access the accessed cluster normally, achieving one-way communication. After accessing the cluster, in order to ensure that the accessed cluster can access the global normally and achieve two-way communication, some network configurations still need to be performed to ensure the normal use of platform functional components.
Prerequisites
Please prepare the Domains, IP addresses pointed by the domain names, and valid certificates that can be accessed by the cluster in advance.
Note:
-
The domain name is not allowed to be the same as the platform access address.
-
Ensure that the port of the domain (HTTPS port, i.e., the port of the platform access address) can forward traffic to all control nodes in the global.
Add Other Access Addresses for Platform
To ensure that platform components can access the platform properly, please refer to the Update Platform Parameters document and add the prepared domain name to other platform access addresses.
Add Annotation Info for Access Cluster
Specifically, to ensure the normal access of alert and Log Agent to the platform, you need to add annotation information to the connected cluster.
-
In the left navigation pane, click Clusters > Cluster of clusters.
-
Click on global.
-
Click Actions > Kubectl Tool, and replace the relevant parameters with the following command:
kubectl annotate --overwrite clusters.platform.tkestack.io <Cluster Name> \ cpaas.io/platform-url=<Prepared Domain Address,For example:https://www.domain.cn>Code Example:
def add(a, b):
return a + b
result = add(3, 5)
print(result)Output: 8
```shell
kubectl annotate --overwrite clusters.platform.tkestack.io cluster-imported \
cpaas.io/platform-url=https://www.domain.cn
```