This commit is contained in:
wwweww
2026-02-23 20:36:21 +08:00
parent 4898aecd3b
commit fdbcde13b2
52 changed files with 11263 additions and 194 deletions
+68
View File
@@ -0,0 +1,68 @@
apiVersion: v1
kind: Secret
metadata:
name: jwt-secret
namespace: juwan
type: Opaque
data:
# base64 encoded: your-secret-jwt-key-change-this-in-production
secret-key: MGUyMWE3ZDhjMTQ5ZDg1MWViOWU0MGM3OTE2NWVkYTBlOTE5ZWRkZDU1YjYzOGJjOWRiNzM0NTc4NDIyMjlkZQ==
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: user-rpc
namespace: juwan
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: envoy-gateway
namespace: juwan
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: jwt-secret-reader
namespace: juwan
rules:
# JWT Secret 读取权限
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["jwt-secret"]
verbs: ["get"]
# 服务发现权限 (go-zero 框架需要)
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "list", "watch"]
- apiGroups: ["discovery.k8s.io"]
resources: ["endpointslices"]
verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: user-rpc-jwt-secret-reader
namespace: juwan
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jwt-secret-reader
subjects:
- kind: ServiceAccount
name: user-rpc
namespace: juwan
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: envoy-gateway-jwt-secret-reader
namespace: juwan
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: jwt-secret-reader
subjects:
- kind: ServiceAccount
name: envoy-gateway
namespace: juwan