查看 ingress

kubectl get ingress

输出

NAME                     CLASS    HOSTS                                               ADDRESS        PORTS     AGE
rc1                    <none>   rc1.fox.com                                             192.168.10.2   80        452d

修改 ingress 域名

 kubectl edit ingress rc1

把 显示 的 host: rc1.fox.com 修改为你想要修改的域名例如 host: rc1.foxwho.com

实际结果(修改后的)

# Please edit the object below. Lines beginning with a '#' will be ignored,                                                                                                                                             
# and an empty file will abort the edit. If an error occurs while saving this file will be                                                                                                                              
# reopened with the relevant failures.                                                                                                                                                                                  
#                                                                                                                                                                                                                       
apiVersion: networking.k8s.io/v1                                                                                                                                                                                        
kind: Ingress                                                                                                                                                                                                           
metadata:                                                                                                                                                                                                               
  annotations:                                                                                                                                                                                                          
    kubernetes.io/ingress.class: traefik                                                                                                                                                                                
  creationTimestamp: "2022-04-13T10:15:52Z"                                                                                                                                                                             
  generation: 1                                                                                                                                                                                                         
  name: rc1-saas                                                                                                                                                                                                        
  namespace: default                                                                                                                                                                                                    
  resourceVersion: "11089342"                                                                                                                                                                                           
  uid: 054d140d-7d10-4256-be4f-e6af17746d66                                                                                                                                                                             
spec:                                                                                                                                                                                                                   
  rules:                                                                                                                                                                                                                
  - host: rc1.foxwho.com                                                                                                                                                                                           
    http:                                                                                                                                                                                                               
      paths:                                                                                                                                                                                                            
      - backend:                                                                                                                                                                                                        
          service:                                                                                                                                                                                                      
            name: rc1                                                                                                                                                                                              
            port:                                                                                                                                                                                                       
              number: 80                                                                                                                                                                                                
        path: /                                                                                                                                                                                                         
        pathType: ImplementationSpecific                                                                                                                                                                                
status:                                                                                                                                                                                                                 
  loadBalancer:                                                                                                                                                                                                         
    ingress:                                                                                                                                                                                                            
    - ip: 192.168.10.2                                                                                                                                                                                                  
~                             

最后 保存
按esc 键
输入 如下 保存

:wq
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐