// Module included in the following assemblies:
//
// assembly-using-the-cluster-operator.adoc

[id='proc-configuring-proxy-config-cluster-operator-{context}']
= Configuring the Cluster Operator with default proxy settings

[role="_abstract"]
If you are running a Kafka cluster behind a HTTP proxy, you can still pass data in and out of the cluster.
For example, you can run Kafka Connect with connectors that push and pull data from outside the proxy.
Or you can use a proxy to connect with an authorization server.

Configure the Cluster Operator deployment to specify the proxy environment variables.
The Cluster Operator accepts standard proxy configuration (`HTTP_PROXY`, `HTTPS_PROXY` and `NO_PROXY`) as environment variables.
The proxy settings are applied to all Strimzi containers.

The format for a proxy address is _\http://IP-ADDRESS:PORT-NUMBER_.
To set up a proxy with a name and password, the format is _\http://USERNAME:PASSWORD@IP-ADDRESS:PORT-NUMBER_.

.Prerequisites

This procedure requires use of a Kubernetes user account which is able to create `CustomResourceDefinitions`, `ClusterRoles` and `ClusterRoleBindings`.
Use of Role Base Access Control (RBAC) in the Kubernetes cluster usually means that permission to create, edit,
and delete these resources is limited to Kubernetes cluster administrators, such as `system:admin`.

.Procedure

. To add proxy environment variables to the Cluster Operator, update its `Deployment` configuration (`install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml`).
+
--
.Example proxy configuration for the Cluster Operator
[source,yaml,subs="+quotes,attributes"]
----
apiVersion: apps/v1
kind: Deployment
spec:
  # ...
  template:
    spec:
      serviceAccountName: strimzi-cluster-operator
      containers:
        # ...
        env:
        # ...
        - name: "HTTP_PROXY"
          value: "http://proxy.com" <1>
        - name: "HTTPS_PROXY"
          value: "https://proxy.com" <2>
        - name: "NO_PROXY"
          value: "internal.com, other.domain.com" <3>
  # ...
----
<1> Address of the proxy server.
<2> Secure address of the proxy server.
<3> Addresses for servers that are accessed directly as exceptions to the proxy server. The URLs are comma-separated.
--
+
Alternatively, edit the `Deployment` directly:
+
[source,shell,subs=+quotes]
----
kubectl edit deployment strimzi-cluster-operator
----

. If you updated the YAML file instead of editing the `Deployment` directly, apply the changes:
+
[source,shell,subs=+quotes]
----
kubectl create -f install/cluster-operator/060-Deployment-strimzi-cluster-operator.yaml
----

[role="_additional-resources"]
.Additional resources

* xref:property-hostaliases-config-reference[Host aliases]
* link:{BookURLDeploying}#adding-users-the-strimzi-admin-role-str[Designating Strimzi administrators^]
