Class BowireKubernetesCatalogueOptions

Namespace
Kuestenlogik.Bowire.Catalogue.Kubernetes
Assembly
Kuestenlogik.Bowire.Catalogue.Kubernetes.dll

Options for KubernetesCatalogueProvider (#305 Phase D). Bound from Bowire:Discovery:Catalogue:Kubernetes.

public sealed class BowireKubernetesCatalogueOptions
Inheritance
BowireKubernetesCatalogueOptions
Inherited Members

Remarks

Three sources of API-server coordinates are tried in order:

  1. Explicit ApiServerUrl + Token from this options block — useful for tests, sidecars, or any host that already has a bearer token in hand.
  2. In-cluster service account: /var/run/secrets/kubernetes.io/serviceaccount/{token,ca.crt,namespace} paired with the well-known KUBERNETES_SERVICE_HOST / KUBERNETES_SERVICE_PORT env-vars. Picked up automatically when Bowire runs inside a pod.
  3. Mounted kubeconfig at KubeconfigPath (or the standard $KUBECONFIG / ~/.kube/config fallback). Only the current-context's cluster.server + user.token are read — full kubeconfig parsing (exec plugins, client-cert auth, multiple contexts) is out of scope for v1; operators that need that path stand up a relay or supply an explicit token.

TLS verification against the cluster's CA is on by default. Set SkipTlsVerification to true only for local kind / k3d / minikube test clusters with self-signed certs.

Constructors

BowireKubernetesCatalogueOptions()

public BowireKubernetesCatalogueOptions()

Properties

ApiServerUrl

Explicit API-server URL — e.g. "https://kubernetes.default.svc" or "https://10.0.0.1:6443". When null the provider derives the URL from in-cluster env-vars or the kubeconfig current-context, in that order.

public string? ApiServerUrl { get; set; }

Property Value

string

CaCertificatePem

PEM-encoded CA bundle used to verify the API server's TLS certificate. When null the provider falls back to /var/run/secrets/kubernetes.io/serviceaccount/ca.crt (in-cluster path) and finally to the OS trust store.

public string? CaCertificatePem { get; set; }

Property Value

string

KubeconfigPath

Path to a kubeconfig file. When null the provider falls back to the KUBECONFIG env-var, then to ~/.kube/config. Only consulted when neither ApiServerUrl nor the in-cluster service-account path resolves.

public string? KubeconfigPath { get; set; }

Property Value

string

LabelSelector

Optional label selector — the standard k8s comma-separated key=value,key2=value2 syntax. Forwarded verbatim as the labelSelector query parameter. Useful for scoping the catalogue to services tagged for Bowire discovery (e.g. "bowire/discoverable=true").

public string? LabelSelector { get; set; }

Property Value

string

Namespace

Namespace to query. Defaults to "default" when running outside a pod; when running in-cluster the provider falls back to the pod's namespace from /var/run/secrets/kubernetes.io/serviceaccount/namespace if this is null.

public string? Namespace { get; set; }

Property Value

string

Scheme

URL scheme to use when materialising the per-service URL. Defaults to "http" — k8s Services don't carry the scheme intrinsically. Set to "https" for TLS-fronted in-cluster services.

public string Scheme { get; set; }

Property Value

string

SkipTlsVerification

Skip TLS verification against the cluster CA. Defaults to false. ONLY enable for local test clusters with self-signed certs — production clusters should always verify.

public bool SkipTlsVerification { get; set; }

Property Value

bool

Timeout

Per-fetch timeout. Defaults to 10 s, mirroring the http / consul providers in core.

public TimeSpan Timeout { get; set; }

Property Value

TimeSpan

Token

Bearer token sent in the Authorization header. When null the provider falls back to the in-cluster service-account token file or the kubeconfig user token.

public string? Token { get; set; }

Property Value

string