Using ESCWA with Kubernetes

If you are going to be running ESCWA in a pod in a Kubernetes cluster, when you start ESCWA you can specify an additional parameter to enable it to determine which other pods in the cluster are running directory servers that you want to be able to manage in ESCWA.

When using this additional parameter you specify a label. ESCWA then uses the Kubernetes API to query all pods running on the cluster and checks if they have a label that matches the label that you specified. Each pod with a label that matches the specified value is then listed in ESCWA as a directory server (provided that Micro Focus Directory Server (MFDS) is running on it).

To specify the additional parameter add it to the escwa command that you run to start ESCWA using the following format:

--K8sConfig='{"Direct":Direct-value,
              "Port":"Port-value",
              "Namespace":"Namespace-value",
              "LabelEnvironment":LabelEnv-value,
              "Label":"Label-value"}'

where the right-hand side of the parameter is a JSON object containing properties that take the following values:

Direct-value
A boolean value indicating if ESCWA should contact Kubernetes directly or via a sidecar container running kubectl proxy.
Port-value
If using a sidecar container running kubectl proxy, a string value specifying the port on which the sidecar container is exposing the Kubernetes API.
Namespace-value
A string value specifying the namespace to use for the Kubernetes API.
LabelEnv-value
A boolean value where:
  • true indicates that the Label property is to be used to specify the name of an environment variable that is set to the label to search for.
  • false indicates that the Label property is to be used to specify the label to search for.
Label-value
A string value specifying either:
  • the name of an environment variable that is set to the label to search for (if "LabelEnvironment":true is specified).
  • the label to search for (if "LabelEnvironment":false is specified).

When specifying the label to search for, you specify the key/value pair separated by "%3D". See Kubernetes: Labels and Selectors in the Kubernetes documentation for more information on Kubernetes labels.

Example

escwa --K8sConfig={"Direct":false,
                   "Port":"8001",
                   "LabelEnvironment":false,
                   "Label":"app%3Dmyapp-k8s-escwa",
                   "Namespace":"default"}' &
The above example command starts ESCWA and specifies that ESCWA will:
  • Contact Kubernetes using a sidecar container running kubectl proxy rather than directly.
  • Use port 8001 for the Kubernetes API exposed by the sidecar container.
  • Not read the value of the Label property from an environment variable.
  • Check for the label defined as "app : myapp-k8s-escwa".
  • Use the default namespace for the Kubernetes API.