# 다음과 같은 흐름으로 https 를 연결 할 수 있다.
ingress https-> service 443:443 -> pod(:443)
# 설정예시
# deployment or pod 설정 생략...
---
apiVersion: v1
kind: Service
metadata:
namespace: ysoftman
name: ysoftman-service
spec:
ports:
- name: ysoftman-https
port: 443
targetPort: 443
- name: ysoftman-http
port: 8060
targetPort: 8060
selector:
app: ysoftman-deployment
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
namespace: ysoftman
name: ysoftman-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
# 명시하지 않으면 디폴트로 HTTP 를 사용한다.
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
spec:
rules:
- host: ysoftman-api.abc.abc
http:
paths:
- path: /(.*)
backend:
serviceName: ysoftman-service
servicePort: 443
tls:
- hosts:
- ysoftman-api.abc.abc
secretName: abc-abc
# 참고
comments:
댓글 쓰기