istio-ecosystem / wasm-extensions

Contains miscellaneous Wasm extensions for Istio
Apache License 2.0
105 stars 34 forks source link

How to reference Kubernetes secrets in WasmPlugins? #84

Open PavelPikat opened 1 year ago

PavelPikat commented 1 year ago

I am new to Istio and Kubernetes

Is there a way to reference Kubernetes secret for the basic-auth plugin instead of hard-coding values in CRD object?

apiVersion: v1
kind: Secret
metadata:
  name: basic-auth-creds
type: Opaque
data:
  user: ok
  password: test
  user_password: "ok:test"
---
apiVersion: extensions.istio.io/v1alpha1
kind: WasmPlugin
metadata:
  name: basic-auth
  namespace: istio-system
spec:
  selector:
    matchLabels:
      istio: ingressgateway
  url: oci://ghcr.io/istio-ecosystem/wasm-extensions/basic_auth:1.12.0
  phase: AUTHN
  pluginConfig:
    basic_auth_rules:
      - prefix: "/productpage"
        request_methods:
          - "GET"
          - "POST"
        credentials:
          - "ok:test"
          - "YWRtaW4zOmFkbWluMw=="

Could you provide an example how to reference the basic-auth-creds secret in pluginConfig?