cat k8s-test-secret.yaml

apiVersion: v1
kind: Secret
metadata:
  name: k8s-test-secret
  namespace: k8s-test
type: Opaque
stringData:
  redis_host: "127.0.0.1"
  redis_password: "123456"
  redis_port: "6579"


部署

kubectl apply -f k8s-test-secret.yaml