port-k8s-exporter
by Port Labs
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
- Chart Config
- Exporter Config
Chart
The following table lists the configuration parameters of the port-k8s-exporter chart and default values.
| Parameter | Description | Default |
|---|---|---|
resyncInterval | The interval in minutes before sending a sync event for all known objects | 0 |
stateKey | Unique state key to enable delete of stale Port entities (which not listed in config.yaml anymore) | "" (when empty, replaced by uuid) |
deleteDependents | Deprecated. 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 |
createMissingRelatedEntities | Deprecated. 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 |
verbosity | A number for the log level verbosity. Set to -1 to print less info logs. | 0 |
createDefaultResources | If true, upon installing the exporter will try to initiate default blueprints & app configuration | true |
overwriteConfigurationOnRestart | If true, the exporter will overwrite the configuration in Port with the resources provided in configMap.config during restart | false |
eventListener.type | Event listener type. currently supporting KAFKA & POLLING | KAFKA |
eventListener.brokers | Kafka event listener brokers list | Port EU kafka brokers |
eventListener.securityProtocol | Kafka event listener security protocol | SASL_SSL |
eventListener.authenticationMechanism | Kafka event listener authentication mechanism | SCRAM-SHA-512 |
eventListener.pollingRate | Interval at which the Polling event listener polls the port configuration to detect changes. | 60 |
imageOsDetectionEnabled | If true, enables container image OS detection and adds .imageOsInfo to K8s object entities. | false |
imageOsDetectionConcurrency | Maximum number of concurrent image OS detections. | 10 |
image.repository | Image repository | ghcr.io/port-labs/port-k8s-exporter |
image.pullPolicy | Image pull policy | IfNotPresent |
image.tag | Image tag | "" |
imagePullSecrets | Image pull secrets | [] |
nameOverride | Chart name override | "" |
fullnameOverride | Fully qualified app name override | "" |
secret.annotations | Annotations for Secret object | {} |
secret.name | Secret object name | "" |
secret.useExistingSecret | Enable this if you wish to create your own secret with credentials.You must provide the following secrets:PORT_CLIENT_IDPORT_CLIENT_SECRET | false |
secret.secrets.portClientId | Port Client ID - Required (irrelevant if secret.useExistingSecret=true) | "" |
secret.secrets.portClientSecret | Port Client Secret - Required (irrelevant if secret.useExistingSecret=true) | "" |
configMap.annotations | Annotations for ConfigMap object | {} |
configMap.name | ConfigMap object name | "" |
configMap.config | Port K8s Exporter config.yaml - Required | |
serviceAccount.create | If true, create and use ServiceAccount, ClusterRole & ClusterRoleBinding | true |
serviceAccount.annotations | Annotations for ServiceAccount object | {} |
serviceAccount.name | ServiceAccount object name | "" |
clusterRole.annotations | Annotations for ClusterRole object | {} |
clusterRole.name | ClusterRole object name | "" |
clusterRole.apiGroups | ClusterRole apiGroups | "{'*'}" |
clusterRole.resources | ClusterRole resources | "{'*'}" |
clusterRoleBinding.annotations | Annotations for ClusterRoleBinding object | {} |
clusterRoleBinding.name | ClusterRoleBinding object name | "" |
podAnnotations | Annotations to be added to the pod | {} |
podSecurityContext | Security context applied to the pod | {} |
securityContext | Security context applied to the container | {} |
resources | Container resource requests & limits | {} |
nodeSelector | NodeSelector applied to the pod | {} |
tolerations | Tolerations applied to the pod | [] |
affinity | Affinity applied to the pod | {} |
extraEnv | extraEnv applied to the pod | [] |
extraObjects | extraObjects applied to the namespace | [] |
extraVolumes | extraVolumes 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartport-k8s-exporter is pinned at v0.4.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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