如果在AKS上使用HTTPS Ingress时遇到无法通过HTTPS访问服务的问题,可能有以下几个原因和解决方法:
apiVersion: cert-manager.io/v1alpha2
kind: Certificate
metadata:
name: example-certificate
namespace: your-namespace
spec:
secretName: example-tls-secret
issuerRef:
name: selfsigned-issuer
kind: ClusterIssuer
dnsNames:
- example.com # 替换为你的域名
privateKeySecretRef:
name: example-tls-secret
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.44.0/deploy/static/provider/cloud/deploy.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
kubernetes.io/ingress.class: nginx # 替换为你使用的Ingress控制器
spec:
tls:
- hosts:
- example.com # 替换为你的域名
secretName: example-tls-secret
rules:
- host: example.com # 替换为你的域名
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: example-service # 替换为你的服务名称
port:
number: 80 # 替换为你的服务端口
防火墙或网络策略限制:
DNS解析问题:
kubectl get ingress -n your-namespace
命令查看分配给Ingress的IP地址。这些解决方法应帮助你解决AKS上HTTPS Ingress无法通过HTTPS访问服务的问题。请根据你的具体情况选择适用的解决方法。
上一篇:AKS上的CSS和JS无法加载。