# Location: ./mcpgateway/tools/builder/templates/kubernetes/cert-secrets.yaml.j2
# Copyright 2025
# SPDX-License-Identifier: Apache-2.0
# Authors: Teryl Taylor
# mTLS Certificate Secrets
# CA Certificate (shared by all components)
apiVersion: v1
kind: Secret
metadata:
  name: mcp-ca-secret
  namespace: {{ namespace }}
type: Opaque
data:
  ca.crt: {{ ca_cert_b64 }}
---
# Gateway Client Certificate
apiVersion: v1
kind: Secret
metadata:
  name: mcp-{{ gateway_name }}-server-cert
  namespace: {{ namespace }}
type: kubernetes.io/tls
data:
  tls.crt: {{ gateway_cert_b64 }}
  tls.key: {{ gateway_key_b64 }}
{% for plugin in plugins %}
---
# Plugin {{ plugin.name }} Server Certificate
apiVersion: v1
kind: Secret
metadata:
  name: mcp-{{ plugin.name }}-server-cert
  namespace: {{ namespace }}
type: kubernetes.io/tls
data:
  tls.crt: {{ plugin.cert_b64 }}
  tls.key: {{ plugin.key_b64 }}
{% endfor %}
