Fork me on GitHub
代码改变世界

k8s 添加ingress 暴露服务

2019-12-19 18:54  freefei  阅读(732)  评论(0编辑  收藏  举报

vim file.yaml


apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: pgadmin
  labels:
      k8s-app: pgadmin
  namespace: c7n-system
spec:
  rules:
  - host: pgadmin.ls.com
    http:
      paths:
      - path: /
        backend:
          serviceName: pgadmin
          servicePort: 80


kubectl apply -f file.yaml

即可直接暴露 

kubectl get ingress -n namespace   可查看

@ https://github.com/ranmufei

校友通微信小程序

校友通微信小程序