Skip to content

Allow settings tunnel spec from configmap/secret #318

@Jellyfrog

Description

@Jellyfrog

Crossplane (and many others) have the ability to publish connection details into configmaps/secrets, therefor it would be convenient if ktunnels could read these directly, this would allow a more "dynamic" approach there we don't need to know the host/port beforehand.

I imagine the CRD could be extended with something like:

hostFrom:
  - configMapRef:
      name: <configmap name>
      key: <key in configmap>
  - secretRef:
      name: <secret name>
      key: <key in secret>
portFrom:
  - configMapRef:
      name: <configmap name>
      key: <key in configmap>
  - secretRef:
      name: <secret name>
      key: <key in secret>

Example usage would then be:

apiVersion: rds.aws.upbound.io/v1beta1
kind: Cluster
metadata:
  name: example
spec:
  ...
  publishConnectionDetailsTo:
    ...
    name: my-connection-details
apiVersion: ktunnels.int128.github.io/v1
kind: Tunnel
metadata:
  name: backend-db
spec:
  hostFrom: 
    - secretRef:
        name: my-connection-details
        key: host
  portFrom: 
    - secretRef:
        name: my-connection-details
        key: port
  proxy:
    name: default

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions