Configuring bci-profile
To enable dynamic updates to the configuration of the CCE Virtual Kubelet component (VK), BCI introduces the bci-profile functionality.
- Updating configurations does not require restarting the VK.
- For newly created BCI pods, the updated configurations take effect immediately, while for existing BCI pods, they take effect only after a rolling update is performed.
Note
When using this function, ensure that the version of VK (the cce-virtual-kubelet component) in the cluster is ≥ 1.0.1. For instructions on how to upgrade the component, see the documentation for CCE Virtual Kubelet Component.
Configuration
When creating a pod, the system reads the bci-profile configuration file (a ConfigMap named bci-profile) in the kube-system namespace, and creates the pod based on its data configuration.
You can view the YAML of bci-profile by running the command: kubectl get cm -n kube-system bci-profile -o yaml.
YAML template of bci-profile:
1apiVersion: v1
2kind: ConfigMap
3metadata:
4 name: bci-profile
5 namespace: kube-system
6data:
7 config: |
8 {
9 "region": "gz",
10 "clusterID": "example-cluster-id",
11 "subnets": [
12 {
13 "subnetID": "subnet-12345",
14 "logicalZone": "zone-a"
15 },
16 {
17 "subnetID": "subnet-67890",
18 "logicalZone": "zone-b"
19 }
20 ],
21 "securityGroupID": "sg-abcdef",
22 "enableReserveFailedPod": true,
23 "dnsConfig": {
24 "nameservers": [
25 "169.254.20.10",
26 "172.21.0.10"
27 ],
28 "searches": [
29 "default.svc.cluster.local",
30 "svc.cluster.local",
31 "cluster.local"
32 ],
33 "options": [
34 {
35 "name": "ndots",
36 "value": "3"
37 },
38 {
39 "name": "attempts",
40 "value": "2"
41 },
42 {
43 "name": "timeout",
44 "value": "1"
45 }
46 ]
47 }
48 }
Modify bci-profile
Method 1: Via the kubectl edit command
kubectl edit configmap bci-profile -n kube-system
The configuration content must comply with JSON syntax
Method II: Via the container service management console
- Log in to the container service management console.
- On the cluster page, find the target cluster and click its name.
- In the left navigation bar of the cluster management page, select Configuration Management > ConfigMaps.
- Select the namespace as kube-system.
- Find bci-profile and click Edit YAML.
Update configuration items
The config field under data stores fixed configuration items (such as subnets and security groups) in JSON format. You can update these configurations as needed, and the updated configurations take effect immediately (no VK restart required). Note: The following configurations are cluster-level settings. When creating a BCI pod, if no additional configurations are specified, the settings in bci-profile will be used by default. Supported configurable items:
| ConfigMap | Description |
| subnets | Default subnet list for BCI pods: Must include both the subnet ID and logical availability zone. Defaults to the subnet parameters used during VK component installation |
| securityGroupID | Security group for BCI pods: Defaults to the parameters used during VK component installation (e.g., "securityGroupID": "sg-abcdef") |
| enableReserveFailedPod | Auto-retain failed BCI pods: Defaults to false |
| dnsConfig | Custom DNS configuration for BCI pods: Defaults to null |
Example configurations:
1 "subnets": [
2 {
3 "subnetID": "subnet-12345",
4 "logicalZone": "zone-a"
5 },
6 {
7 "subnetID": "subnet-67890",
8 "logicalZone": "zone-b"
9 }
10 ],
dnsConfig configuration example:
1 "dnsConfig": {
2 "nameservers": [
3 "169.254.20.10",
4 "172.21.0.10"
5 ],
6 "searches": [
7 "default.svc.cluster.local",
8 "svc.cluster.local",
9 "cluster.local"
10 ],
11 "options": [
12 {
13 "name": "ndots",
14 "value": "3"
15 },
16 {
17 "name": "attempts",
18 "value": "2"
19 },
20 {
21 "name": "timeout",
22 "value": "1"
23 }
24 ]
25 }
