본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Provider: ngrok

원문 보기 위키 갱신

External Secrets Operator는 ngrok과 연동해서 ngrok Secrets(Traffic Policy용)와 Kubernetes 시크릿을 동기화합니다. 현재는 시크릿을 밀어내는 방향(push)만 지원해요.

출처: External Secrets

본문

Kind=SecretStore에 ngrok 프로바이더가 들어 있는지 확인해 보세요. vault와 auth 프로퍼티는 필수이고, apiURL은 선택이며 기본값은 https://api.ngrok.com입니다.

apiVersion: external-secrets.io/v1
kind: SecretStore
metadata:
  name: ngrok
spec:
  provider:
    ngrok:
      # apiURL: Default https://api.ngrok.com, for enterprise ngrok instances uncomment and use your API URL.
      auth:
        apiKey:
          secretRef:
            name: ngrok-credentials
            key: api-key
      vault:
        name: my-vault # Name of the ngrok vault to use for storing secrets

Kubernetes 시크릿을 ngrok 시크릿과 동기화하려면 PushSecret을 만들어야 해요. 즉 Kind=PushSecret 리소스가 필요합니다.

PushSecret 메타데이터

ngrok 시크릿의 설명(description)과 메타데이터도 아래처럼 제어할 수 있습니다.

apiVersion: external-secrets.io/v1alpha1
kind: PushSecret
metadata:
  name: ngrok-push-secret-example
spec:
  deletionPolicy: Delete
  refreshInterval: 10m0s # Refresh interval for which push secret will reconcile
  secretStoreRefs: # A list of secret stores to push secrets to
    - name: ngrok # Must match SecretStore on the cluster
      kind: SecretStore
  selector:
    secret:
      name: SECRET_NAME # Source Kubernetes secret to be pushed
  data:
    - match:
        # The key in the Kubernetes secret to push. Leave empty to push all keys, JSON encoded.
        # secretKey: 
        secretKey: MY_K8S_SECRET_KEY
        remoteRef:
          remoteKey: MY_NGROK_SECRET_NAME # The name of the secret in the ngrok vault
      metadata:
        apiVersion: kubernetes.external-secrets.io/v1alpha1
        kind: PushSecretMetadata
        spec:
          # See https://ngrok.com/docs/api/resources/secrets/#parameters
          # We currently support customizing the description and metadata for the secret.
          description: This is a secret for the API credentials
          # Metadata for the secret in the ngrok vault. This will be merged with auto-generated metadata.
          metadata:
            environment: production
            team: devops

더 알아보기 (Learn more)