标签:metadata role ini image rbac web epo extension rbo
背景:kubernetes集群traefik ingress实现同一命名空间不同微服务模块的访问kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: traefik-ingress-controller
rules:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
kind: Deployment
apiVersion: apps/v1beta1
metadata:
name: traefik-ingress-controller
namespace: c7n-system
labels:
k8s-app: traefik-ingress-lb
spec:
replicas: 1
selector:
matchLabels:
k8s-app: traefik-ingress-lb
template:
metadata:
labels:
k8s-app: traefik-ingress-lb
name: traefik-ingress-lb
spec:
serviceAccountName: traefik-ingress-controller
terminationGracePeriodSeconds: 60
containers:
kind: Service
apiVersion: v1
metadata:
name: traefik-ingress-service
namespace: c7n-system
spec:
selector:
k8s-app: traefik-ingress-lb
ports:
port: 80
nodePort: 23456
name: web
port: 8080
name: admin
type: NodePort
EOF
2.查看k8s集群配置微服务svc
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: choerodon-xiongxj
namespace: c7n-system
spec:
rules:
5.访问
kubernetes集群traefik ingress实现同一命名空间不同微服务模块的访问
标签:metadata role ini image rbac web epo extension rbo
原文地址:https://blog.51cto.com/whitehat/2382365