Skip to main content

Kubernetes Proxy Pulumi Provider

A Pulumi provider that proxies a port on the host to a port on a pod in the cluster during provisioning.

Warning: The way this fits into the Pulumi architecture is sketchy. It might break in future Pulumi releases. Use at your own risk!

This can be useful to use Pulumi to provision services that run within the cluster that are not publicly accessible, like a database.

Usage example

To provision a PostgreSQL database running in Kubernetes:

import pulumi_kubernetes_proxy as k8s_proxy

# Hardcode a port that is likely to be free. This needs to be stable (i.e., we
# can't just let the kernel allocate a free port) so that Pulumi doesn't
# perpetually show a diff in the PostgreSQL provider.
PORT = 32123

eks_cluster = eks.Cluster(...)

k8s_proxy.Provider(
    "postgresql-proxy",
    kubeconfig=eks_cluster.kubeconfig,
    host_port=PORT,
    remote_port=5432,   # Target the PostgreSQL port.
    namespace="default",
    pod_selector="workload=postgresql",
)

provider = postgresql.Provider(
    base_name,
    host="localhost",
    port=PORT,
    connect_timeout=10,
    database="db",
    username="user",
    password="pass",
    opts=pulumi.ResourceOptions(depends_on=[rds_proxy_provider]),
)

Release files for pulumi-kubernetes-proxy 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pulumi-kubernetes-proxy 0.1.3
File Size Uploaded
pulumi_kubernetes_proxy-0.1.3.tar.gz 5.3 kB Details

Release files / pulumi_kubernetes_proxy-0.1.3.tar.gz

Download URL pulumi_kubernetes_proxy-0.1.3.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
008d626370025e63dc0e1429c081729907fe61a4c8671868ab8c5b6711d4ee4c
BLAKE2b-256 checksum
How to use checksums
32c2c2719dd90c01bc5140187a4dbd8987e21ff80e8a14dde9a37fb3954eef1e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page