diff --git a/migrator.py b/migrator.py index c569702..abdfd74 100644 --- a/migrator.py +++ b/migrator.py @@ -41,7 +41,6 @@ def load_mapping(path): with open(path) as f: return yaml.load(f) - # ----------------------------- # annotation 렌더링 # ----------------------------- @@ -57,7 +56,15 @@ def render_annotations_block(unsupported, partial, converted): if partial: for p in partial: - lines.append(f" # PARTIAL SUPPORT: {p['note']}") + note_lines = p["note"].splitlines() + if len(note_lines) == 1: + # 단일라인 note + lines.append(f" # PARTIAL SUPPORT: {note_lines[0]}") + else: + # 멀티라인 note + lines.append(" # PARTIAL SUPPORT: |") + for nl in note_lines: + lines.append(f" # {nl}") lines.append(f" {p['haproxy']}: \"{str(p['value'])}\"") lines.append("") diff --git a/yaml/configmap.yaml b/yaml/configmap.yaml index 3e67ab9..751373e 100644 --- a/yaml/configmap.yaml +++ b/yaml/configmap.yaml @@ -1,9 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ingress-migrator-mapping + name: annotation-rule data: - mapping.yaml: | + mapping.yaml: |- nginx.ingress.kubernetes.io/affinity: haproxy: haproxy.org/cookie-persistence support: partial @@ -36,22 +36,168 @@ data: support: partial note: "value 수정 필요" + nginx.ingress.kubernetes.io/connection-proxy-header: + haproxy: null + support: unsupported + note: "HAProxy 기본적으로 Proxy-Connection 헤더를 추가하지 않음" + + nginx.ingress.kubernetes.io/default-backend: + haproxy: null + support: unsupported + note: "CRD 활용 혹은 컨트롤러에 직접 적용 필요" + + nginx.ingress.kubernetes.io/custom-http-errors: + haproxy: null + support: unsupported + note: "HAProxy 지원 안함, controller에 마운트를 시켜 구성" + nginx.ingress.kubernetes.io/app-root: haproxy: haproxy.org/path-rewrite support: partial - note: "Change Value" + note: "value 수정 필요 (ex. /kor -> (.*) /kor)" - nginx.ingress.kubernetes.io/configuration-snippet: + nginx.ingress.kubernetes.io/permanent-redirect: + haproxy: haproxy.org/request-redirect + support: full + + nginx.ingress.kubernetes.io/cors-allow-credentials: + haproxy: haproxy.org/cors-allow-credentials + support: full + + nginx.ingress.kubernetes.io/cors-allow-headers: + haproxy: haproxy.org/cors-allow-headers + support: full + + nginx.ingress.kubernetes.io/cors-allow-methods: + haproxy: haproxy.org/cors-allow-methods + support: full + + nginx.ingress.kubernetes.io/cors-allow-origin: + haproxy: haproxy.org/cors-allow-origin + support: full + + nginx.ingress.kubernetes.io/enable-cors: + haproxy: haproxy.org/cors-enable + support: full + + nginx.ingress.kubernetes.io/preserve-trailing-slash: haproxy: null support: unsupported - note: "HAProxy does not support arbitrary NGINX snippets" + note: 'HAProxy에서 기본 지원, 제거가 필요할 경우 haproxy.org/path-rewrite: (.*)/$ \1' + + nginx.ingress.kubernetes.io/proxy-body-size: + haproxy: haproxy.org/backend-config-snippet + support: partial + note: |- + http-request deny status 413 if { req.body_size gt 1048576000 } 해당 형식으로 값 변경 + + nginx.ingress.kubernetes.io/proxy-buffer-size: + haproxy: null + support: unsupported + note: "지원하지 않음, configmap을 통한 지원 가능" + + nginx.ingress.kubernetes.io/proxy-buffers: + haproxy: null + support: unsupported + note: "지원하지 않음, configmap을 통한 지원 가능" + + nginx.ingress.kubernetes.io/proxy-busy-buffers-size: + haproxy: null + support: unsupported + note: "지원하지 않음, configmap을 통한 지원 가능" + + nginx.ingress.kubernetes.io/proxy-connect-timeout: + haproxy: null + support: unsupported + note: "지원하지 않음, configmap을 통한 지원 가능" + + nginx.ingress.kubernetes.io/proxy-read-timeout: + haproxy: haproxy.org/timeout-server + support: partial + note: "value 수정 필요 (ex. 600 -> 600s)" + + nginx.ingress.kubernetes.io/proxy-send-timeout: + haproxy: haproxy.org/timeout-server + support: partial + note: "value 수정 필요 (ex. 600 -> 600s)" + + nginx.ingress.kubernetes.io/rewrite-target: + haproxy: haproxy.org/path-rewrite + support: partial + note: 'value 수정 필요 (ex. ^/foo/?(.*)$ /\1 - 설명 /foo/aaa → 백엔드에 /aaa)' + + nginx.ingress.kubernetes.io/send-timeout: + haproxy: haproxy.org/timeout-server + support: partial + note: "value 수정 필요 (ex. 600 -> 600s)" + + nginx.org/websocket-services: + haproxy: null + support: unsupported + note: '이 서비스로 들어오는 요청에 대해 WebSocket Upgrade 헤더를 자동으로 처리 및 기본 제공, 추가로 haproxy.org/timeout-tunnel: "3600s" 오래 살아있는 연결을 위해 timeout만 적용' + + nginx.ingress.kubernetes.io/from-to-www-redirect: + haproxy: null + support: unsupported + note: "HAProxy does not support" + + nginx.ingress.kubernetes.io/whitelist-source-range: + haproxy: haproxy.org/whitelist + support: full + + nginx.ingress.kubernetes.io/use-regex: + haproxy: null + support: unsupported + note: "정규식 사용 불가능" + + nginx.ingress.kubernetes.io/server-snippets: + haproxy: haproxy.org/backend-config-snippet + support: partial + note: |- + value 수정 필요 (ex. | http-request set-path '%[path,regsub("/+","/",g)]') + + nginx.ingress.kubernetes.io/cors-max-age: + haproxy: haproxy.org/cors-max-age + support: partial + note: "value 수정 필요 (ex. 600 -> 600s)" + + nginx.ingress.kubernetes.io/permanent-redirect-code: + haproxy: haproxy.org/request-redirect-code + support: full + + nginx.ingress.kubernetes.io/configuration-snippet: + haproxy: haproxy.org/backend-config-snippet + support: partial + note: "변경 필요 문서 참고" + + nginx.ingress.kubernetes.io/cors-expose-headers: + haproxy: haproxy.org/response-set-header + support: partial + note: |- + Access-Control-Expose-Headers "Content-Disposition" + 이러한 형태로 수정 필요 + + nginx.ingress.kubernetes.io/forwarded-for-header: + haproxy: null + support: unsupported + note: 'X-Forwarded-For (L7 HTTP 헤더) = "ClientIP를 HTTP 요청에 적어서 전달"' + + nginx.ingress.kubernetes.io/forwarded-for-proxy-protocol-header: + haproxy: null + support: unsupported + note: 'Proxy Protocol (L4 TCP 메타데이터) = "ClientIP를 LB가 TCP 스트림에 실어서 HAProxy로 전달"' + + nginx.ingress.kubernetes.io/session-cookie-path: + haproxy: haproxy.org/backend-server-cookie + support: partial + note: "haproxy.org/backend-server-cookie: route 에서 기본값으로 제공 해당 어노테이션 사용 시 사용 안해도 됨" proxy-buffering: haproxy: null support: unsupported - note: "HAProxy does not support arbitrary NGINX snippets" + note: "HAProxy does not support" gzip-level: haproxy: null support: unsupported - note: "HAProxy does not support arbitrary NGINX snippets" + note: "HAProxy does not support" diff --git a/yaml/deploy.yaml b/yaml/deploy.yaml index 89d8712..14d43d0 100644 --- a/yaml/deploy.yaml +++ b/yaml/deploy.yaml @@ -15,7 +15,7 @@ spec: serviceAccountName: ingress-migrator containers: - name: web - image: sa8001/ngtoha:v3 + image: sa8001/ngtoha:v3.1.5 ports: - containerPort: 8080 volumeMounts: @@ -29,4 +29,4 @@ spec: emptyDir: {} - name: mapping configMap: - name: ingress-migrator-mapping + name: annotation-rule