k8s-ingress-note

1、普通创建

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.0.4/deploy/static/provider/cloud/deploy.yaml

2、下载不下来的放dockerhub打包后用自己的

xxx/kube-webhook-certgen:latest

3、创建yaml

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-myservicea
spec:
  rules:
  - host: nginx2.test.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: nginx2
            port: 
              number: 80
  ingressClassName: nginx

4、源码编译

有些k8s相关依赖无法下载,先通过gitlab打包到dockerhub修改依赖再用

export REGISTRY=xxx
export BASE_IMAGE=xxx/nginx:latest
make image
make build
原文地址:https://www.cnblogs.com/it-worker365/p/15418430.html