port-k8s-exporter

by Port Labs

Helm chartv0.4.1App 0.8.1Verified publisher

A Helm chart for Port Kubernetes Exporter

About this chart

Port K8s Exporter

Port K8s Exporter allows to list, watch and export K8s objects to Port entities of existing blueprints.

Introduction

This chart installs the Port K8s Exporter via a Deployment resource.

Usage

Helm must be installed to use the charts. Please refer to Helm's documentation to get started.

Once Helm has been set up correctly, add the repo as follows:

helm repo add port-labs https://port-labs.github.io/helm-charts

If you had already added this repo earlier, run helm repo update to retrieve the latest versions of the packages. You can then run helm search repo port-labs to see the charts.

Next, prepare your own exporter config.yaml file, as explained below.

Then, use the config.yaml and your PORT_CLIENT_ID & PORT_CLIENT_SECRET to install the chart, with the following command:

helm install my-port-k8s-exporter port-labs/port-k8s-exporter \
    --create-namespace --namespace port-k8s-exporter \
    --set secret.secrets.portClientId=PORT_CLIENT_ID --set secret.secrets.portClientSecret=PORT_CLIENT_SECRET \
    --set-file configMap.config=config.yaml

Shortly, you should see entities reported in Port web UI and API.

To uninstall the chart use:

helm uninstall my-port-k8s-exporter --namespace port-k8s-exporter

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

  1. Chart Config
  2. Exporter Config

Chart

The following table lists the configuration parameters of the port-k8s-exporter chart and default values.

ParameterDescriptionDefault
resyncIntervalThe interval in minutes before sending a sync event for all known objects0
stateKeyUnique state key to enable delete of stale Port entities (which not listed in config.yaml anymore)"" (when empty, replaced by uuid)
deleteDependentsDeprecated. Will be used only for installation / migration from older versions, configure this from the ui. A flag to enable deletion of dependent Port Entities.false
createMissingRelatedEntitiesDeprecated. Will be used only for installation, configure this from the ui / migration from older versions. A flag to enable creation of missing related Port Entities.false
verbosityA number for the log level verbosity. Set to -1 to print less info logs.0
createDefaultResourcesIf true, upon installing the exporter will try to initiate default blueprints & app configurationtrue
overwriteConfigurationOnRestartIf true, the exporter will overwrite the configuration in Port with the resources provided in configMap.config during restartfalse
eventListener.typeEvent listener type. currently supporting KAFKA & POLLINGKAFKA
eventListener.brokersKafka event listener brokers listPort EU kafka brokers
eventListener.securityProtocolKafka event listener security protocolSASL_SSL
eventListener.authenticationMechanismKafka event listener authentication mechanismSCRAM-SHA-512
eventListener.pollingRateInterval at which the Polling event listener polls the port configuration to detect changes.60
imageOsDetectionEnabledIf true, enables container image OS detection and adds .imageOsInfo to K8s object entities.false
imageOsDetectionConcurrencyMaximum number of concurrent image OS detections.10
image.repositoryImage repositoryghcr.io/port-labs/port-k8s-exporter
image.pullPolicyImage pull policyIfNotPresent
image.tagImage tag""
imagePullSecretsImage pull secrets[]
nameOverrideChart name override""
fullnameOverrideFully qualified app name override""
secret.annotationsAnnotations for Secret object{}
secret.nameSecret object name""
secret.useExistingSecretEnable this if you wish to create your own secret with credentials.You must provide the following secrets:PORT_CLIENT_IDPORT_CLIENT_SECRETfalse
secret.secrets.portClientIdPort Client ID - Required (irrelevant if secret.useExistingSecret=true)""
secret.secrets.portClientSecretPort Client Secret - Required (irrelevant if secret.useExistingSecret=true)""
configMap.annotationsAnnotations for ConfigMap object{}
configMap.nameConfigMap object name""
configMap.configPort K8s Exporter config.yaml - Required
serviceAccount.createIf true, create and use ServiceAccount, ClusterRole & ClusterRoleBindingtrue
serviceAccount.annotationsAnnotations for ServiceAccount object{}
serviceAccount.nameServiceAccount object name""
clusterRole.annotationsAnnotations for ClusterRole object{}
clusterRole.nameClusterRole object name""
clusterRole.apiGroupsClusterRole apiGroups"{'*'}"
clusterRole.resourcesClusterRole resources"{'*'}"
clusterRoleBinding.annotationsAnnotations for ClusterRoleBinding object{}
clusterRoleBinding.nameClusterRoleBinding object name""
podAnnotationsAnnotations to be added to the pod{}
podSecurityContextSecurity context applied to the pod{}
securityContextSecurity context applied to the container{}
resourcesContainer resource requests & limits{}
nodeSelectorNodeSelector applied to the pod{}
tolerationsTolerations applied to the pod[]
affinityAffinity applied to the pod{}
extraEnvextraEnv applied to the pod[]
extraObjectsextraObjects applied to the namespace[]
extraVolumesextraVolumes applied to the pod

Deploy port-k8s-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has port-k8s-exporter on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartport-k8s-exporter is pinned at v0.4.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply