Skip to main content

Advanced

The K8s exporter supports additional flags and the option to provide additional configuration sources, making it easier to configure its behavior to your liking.

Required configuration

The following parameters are required with every K8s exporter installation/upgrade:

ParameterDescription
secret.secrets.portClientIdPort Client ID
secret.secrets.portClientSecretPort Client Secret

Advanced installation parameters

The following advanced configuration parameters are available:

The resyncInterval parameter specifies the interval in minutes to send a repeated sync event for all known existing objects (in addition to new cluster events).

  • Default value: 0 (re-sync disabled)
  • Use case: Re-sync every X minutes. This parameter is useful when reporting entities with relations inside your cluster in instances where an entity is reported before its related target has been created in Port. The initial sync will fail, but later when the target entity is available, the entity creation will succeed.

Security Configuration

The following security parameters can be modified to give the K8s exporter more granular access to your cluster:

ParameterDescriptionDefault
clusterRole.apiGroupsThe API groups that the K8s Exporter can access. Make sure to grant access to the relevant API groups, with respect to the resources that you've configured in the resource mapping{'*'}
clusterRole.resourcesThe resources that the K8s Exporter can access. Make sure to grant access to the relevant resources, with respect to the resources that you've configured in the resource mapping{'*'}
serviceAccount.createWhether to create the default ServiceAccount, ClusterRole and ClusterRoleBinding resources.true
serviceAccount.nameThe name of the custom ServiceAccount resource to use, relevant only when serviceAccount.create is set to false

Overriding configurations

When installing the K8s exporter, it is possible to override default values in the helm upgrade command:

By using the --set flag, you can override specific exporter configuration parameters during exporter installation/upgrade:

helm upgrade --install k8s-exporter port-labs/port-k8s-exporter \
--create-namespace --namespace port-k8s-exporter \
--set secret.secrets.portClientId="YOUR_PORT_CLIENT_ID" \
--set secret.secrets.portClientSecret="YOUR_PORT_CLIENT_SECRET" \
--set stateKey="k8s-exporter" \
--set eventListenerType="KAFKA" \
--set extraEnv=[{"name":"CLUSTER_NAME","value":"my-cluster"}]

For example, to set the parameters from the security configuration section:

--set clusterRole.apiGroups="{argoproj.io,'',apps}" \
--set clusterRole.resources="{rollouts,pods,replicasets}"

All configuration parameters

  • A complete list of configuration parameters available when using the helm chart is available here;
  • An example skeleton values.yml file is available here.

Extra environment variables

To pass extra environment variables to the exporter's runtime, you can use the Helm chart provided with the installation. You can do this in one of two ways:

  1. Using Helm's --set flag:
helm upgrade --install <MY_INSTALLATION_NAME> port-labs/port-k8s-exporter \
# Standard installation flags
# ...
--set "extraEnv[0].name"=HTTP_PROXY \
--set "extraEnv[0].value"=http://my-proxy.com:1111
  1. The Helm values.yaml file:
# The rest of the configuration
# ...
extraEnvs:
- name: HTTP_PROXY
value: http://my-proxy.com:1111

Proxy Configuration

HTTP_PROXY & HTTPS_PROXY

HTTP_PROXY and HTTPS_PROXY are environment variables used to specify a proxy server for handling HTTP or HTTPS, respectively. The values assigned to these settings should be the URL of the proxy server.

For example:

HTTP_PROXY=http://my-proxy.com:1111
HTTPS_PROXY=http://my-proxy.com:2222

NO_PROXY

NO_PROXY allows blacklisting certain addresses from being handled through a proxy. This vairable accepts a comma-seperated list of hostnames or urls.

For example:

NO_PROXY=http://127.0.0.1,google.com

Advanced resource mapping configuration

The deleteDependents parameter is used to enable deletion of dependent Port entities. This is useful when you have two blueprints with a required relation, and the target entity in the relation should be deleted. In this scenario, the delete operation will fail if this flag is set to false if the flag is set to true, the source entity will be deleted as well.

  • Default: false (disabled)
  • Use case: Deletion of dependent Port entities. Must be enabled if you want to delete a target entity (and its source entities) when the entity's blueprint has required relations.