On Kubernetes, Kong Mesh leverages the native Kubernetes Secret resource to store sensitive information. For more information about how Kubernetes secures your Secrets, see the Kubernetes documentation.
Kong Mesh secrets are stored in the same namespace as the control plane with type set to system.kuma.io/secret.
You can use kubectl to manage secrets like any other Kubernetes resource:
echo "apiVersion: v1
kind: Secret
metadata:
name: sample-secret
namespace: kong-mesh-system
labels:
kuma.io/mesh: default
data:
value: dGVzdAo=
type: system.kuma.io/secret" | kubectl apply -f -
kubectl get secrets -n kong-mesh-system --field-selector='type=system.kuma.io/secret'
Kubernetes secrets are identified with the combination of their name and namespace, it’s impossible to have a Secret with the same name in multiple meshes, since multiple meshes always belong to one Kong Mesh control plane that always runs in one namespace.
In order to reassign a Secret from one mesh to another, you must delete the Secret resource and create it in another mesh.
A Secret is a resource that stores specific data. You can use kumactl to manage any Secret:
echo "type: Secret
mesh: default
name: sample-secret
data: dGVzdAo=" | kumactl apply -f -