You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: master/reference/policy-controller/configuration.md
+22-44
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Configuring the Calico policy controller
3
3
---
4
4
5
-
The policy controller is primarily configured through environment variables. When running
5
+
The policy controller is primarily configured through environment variables. When running
6
6
the policy controller as a Kubernetes pod, this is accomplished through the pod manifest `env`
7
7
section.
8
8
@@ -13,57 +13,35 @@ section.
13
13
The policy controller supports the following environment variables to configure
14
14
etcd access:
15
15
16
-
*`ETCD_ENDPOINTS`: The list of etcd nodes in your cluster. e.g `http://10.0.0.1:2379,http://10.0.0.2:2379`
17
-
*`ETCD_CA_CERT_FILE`: The full path to the CA certificate file for the Certificate Authority that signed the etcd server key/certificate pair.
18
-
*`ETCD_CERT_FILE`: The full path to the client certificate file for accessing the etcd cluster.
19
-
*`ETCD_KEY_FILE`: The full path to the client key file for accessing the etcd cluster.
16
+
| Environment | Description | Schema |
17
+
| ------------- | ----------- | ------ |
18
+
| `ETCD_ENDPOINTS` | The list of etcd nodes in your cluster. e.g `http://10.0.0.1:2379,http://10.0.0.2:2379`
19
+
| `ETCD_CA_CERT_FILE` | The full path to the CA certificate file for the Certificate Authority that signed the etcd server key/certificate pair. | path
20
+
| `ETCD_CERT_FILE` | The full path to the client certificate file for accessing the etcd cluster. | path
21
+
| `ETCD_KEY_FILE` | The full path to the client key file for accessing the etcd cluster. | path
20
22
21
-
> **Note**: When running etcd with TLS enabled, the addresses in
22
-
> `ETCD_ENDPOINTS` must be hostname values such as `etcd-host:2379`,
23
-
> NOT IP addresses.
24
-
{: .alert .alert-info}
23
+
The `*_FILE` variables are _paths_ to the corresponding certificates/keys. As such, when the policy controller is running as a Kubernetes pod, you
24
+
must ensure that the files exist within the pod. This is usually done in one of two ways:
25
25
26
-
The `*_FILE` variables are _paths_ to the corresponding certificates / keys. As such, when the policy controller is running as a Kubernetes pod, you
27
-
must ensure that the files exist within the pod. This is usually done in one of two ways:
28
-
29
-
* Mount the certificates from the host. This requires that the certs be present on the host that the policy controller is scheduled to / running on.
26
+
* Mount the certificates from the host. This requires that the certs be present on the host running the policy controller.
30
27
* Use Kubernetes [Secrets](http://kubernetes.io/docs/user-guide/secrets/) to mount the certificates into the Pod as files.
31
28
32
29
### Configuring Kubernetes API access
33
30
34
-
The policy controller must access the Kubernetes API in order to learn about NetworkPolicy, Pod, and Namespace events.
35
-
36
-
The following environment variables are useful for configuring API access:
37
-
38
-
*`K8S_API`: The location of the Kubernetes API, including transport and port. e.g `https://kubernetes.default:443`
39
-
*`CONFIGURE_ETC_HOSTS`: Whether or not the policy controller should configure its /etc/hosts file to resolve the Kubernetes Service clusterIP. When "true", the policy controller will resolve `kubernetes.default` to the configured clusterIP of the Kubernetes API.
40
-
41
-
It is recommended to use the following configuration for API access:
42
-
43
-
```
44
-
- name: K8S_API
45
-
value: "https://kubernetes.default:443"
46
-
- name: CONFIGURE_ETC_HOSTS
47
-
value: "true"
48
-
```
49
-
50
-
## The leader election container
31
+
The policy controller must have read access to the Kubernetes API in order to monitor NetworkPolicy, Pod, and Namespace events.
51
32
52
-
The leader election container is an optional sidecar container which performs leader election using the Kubernetes API.
53
-
This ensures that only a single instance of the policy controller is ever active.
54
-
55
-
The leader election container is only recommended when running the policy controller as a static pod in a multi-master deployment.
56
-
57
-
However, it is instead recommended to use a `ReplicaSet` with a single replica to ensure that one instance
58
-
will always be running without need for leader election.
59
-
60
-
### Kubernetes API access
61
-
62
-
The leader election container also needs Kubernetes API access, which can be configured through a `kubeconfig` file placed in
63
-
the root directory of the container. This can be done by mounting a file from the host, or using Kubernetes [ConfigMap resources](http://kubernetes.io/docs/user-guide/configmap/).
33
+
When running the policy controller as a self-hosted Kubernetes Pod, Kubernetes API access is [configured automatically][in-cluster-config] and
34
+
no additional configuration is required. However, the controller also supports an explicit [kubeconfig][kubeconfig] file override to
35
+
configure API access if needed.
64
36
65
37
### Other configuration
66
38
67
-
*`LOG_LEVEL`: Supports the standard Python log levels. e.g. `LOG_LEVEL=debug`, defaults to `info`
39
+
The following environment variables can be used to configure the policy controller.
40
+
41
+
| Environment | Description | Schema |
42
+
| ------------- | ----------- | ------ |
43
+
|`LOG_LEVEL`| Minimum log level to be displayed. | debug, info, warning, error |
44
+
|`KUBECONFIG`| Path to a kubeconfig file for kubernetes API access | path |
68
45
69
-
More information on leader election can be found in the [kubernetes/contrib](https://github.com/kubernetes/contrib/tree/master/election#simple-leader-election-with-kubernetes-and-docker) repository.
0 commit comments