按照https://kubesphere.com.cn/docs/cluster-administration/cluster-wide-alerting-and-notification/notification-manager/操作:
root@node1:~/tanjunjie/kubesphere/notification# cat <<EOF | kubectl apply -f -
> apiVersion: v1
> data:
> password: NuZGdndGpabqCg==
> kind: Secret
> metadata:
> labels:
> app: notification-manager
> name: test-user-email-secret
> namespace: kubesphere-monitoring-system
> type: Opaque
>
> ---
> apiVersion: notification.kubesphere.io/v1alpha1
> kind: EmailConfig
> metadata:
> labels:
> app: notification-manager
> type: tenant
> user: test-user
> name: test-user-config
> namespace: kubesphere-monitoring-system
> spec:
> authPassword:
> key: password
> name: test-user-email-secret
> authUsername: mail@qq.com
> from: mail@qq.com
> requireTLS: true
> smartHost:
> host: smtp.qq.com
> port: "465"
>
> ---
> apiVersion: notification.kubesphere.io/v1alpha1
> kind: EmailReceiver
> metadata:
> labels:
> app: notification-manager
> type: tenant
> user: test-user
> name: test-user-receiver
> namespace: kubesphere-monitoring-system
> spec:
> emailConfigSelector:
> matchLabels:
> type: tenant
> user: test-user
> to:
> - mail@qq.com
> EOF
secret/test-user-email-secret created
unable to recognize "STDIN": no matches for kind "EmailConfig" in version "notification.kubesphere.io/v1alpha1"
unable to recognize "STDIN": no matches for kind "EmailReceiver" in version "notification.kubesphere.io/v1alpha1"