Skip to content

[feat i2g]support ssl-redirect translate - #4669

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
shuqz:i2g-annotation
Apr 7, 2026
Merged

k8s-ci-robot merged 1 commit into
kubernetes-sigs:mainfrom
shuqz:i2g-annotation

Conversation

@shuqz

@shuqz shuqz commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

Description

  • add translation support for ssl-redirect

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
    ingress manifest:
# Example Ingress with ssl-redirect annotation.
# HTTP traffic on port 80 is redirected to HTTPS on port 443.
# Actual routing rules only apply on the HTTPS listener.
#
# Usage: go run ./cmd/lbc-migrate/ -f examples/migrate/ssl-redirect-ingress.yaml
---
apiVersion: v1
kind: Service
metadata:
  name: web-svc
  namespace: demo
spec:
  type: NodePort
  selector:
    app: web
  ports:
    - name: http
      port: 80
      targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: api-svc
  namespace: demo
spec:
  type: NodePort
  selector:
    app: api
  ports:
    - name: http
      port: 80
      targetPort: 8080
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: demo
  name: ssl-redirect-test
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/ssl-redirect: "443"
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-west-2:850920876970:certificate/17ed5c96-a86d-4e64-af91-d8873089c70c
spec:
  ingressClassName: alb
  rules:
    - host: app.example.com
      http:
        paths:
          - path: /api
            pathType: Prefix
            backend:
              service:
                name: api-svc
                port:
                  number: 80
          - path: /
            pathType: Prefix
            backend:
              service:
                name: web-svc
                port:
                  number: 80

translated gateway manifest

apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
  name: aws-alb
spec:
  controllerName: gateway.k8s.aws/alb
---
apiVersion: gateway.k8s.aws/v1beta1
kind: LoadBalancerConfiguration
metadata:
  name: ssl-redi-lb-confi-7fb1a0a2e1
  namespace: demo
spec:
  listenerConfigurations:
  - defaultCertificate: arn:aws:acm:us-west-2:850920876970:certificate/17ed5c96-a86d-4e64-af91-d8873089c70c
    protocolPort: HTTPS:443
  scheme: internet-facing
  tags:
    gateway.k8s.aws/migrated-from: ingress/demo/ssl-redirect-test
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: ssl-redi-gateway-5fe31229ea
  namespace: demo
spec:
  gatewayClassName: aws-alb
  infrastructure:
    parametersRef:
      group: gateway.k8s.aws
      kind: LoadBalancerConfiguration
      name: ssl-redi-lb-confi-7fb1a0a2e1
  listeners:
  - name: http-80
    port: 80
    protocol: HTTP
  - name: https-443
    port: 443
    protocol: HTTPS
    tls:
      certificateRefs:
      - name: tls-secret
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: ssl-redi-route-0cb0137559
  namespace: demo
spec:
  hostnames:
  - app.example.com
  parentRefs:
  - name: ssl-redi-gateway-5fe31229ea
    sectionName: https-443
  rules:
  - backendRefs:
    - name: api-svc
      port: 80
    matches:
    - path:
        type: PathPrefix
        value: /api
  - backendRefs:
    - name: web-svc
      port: 80
    matches:
    - path:
        type: PathPrefix
        value: /
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: ssl-redi-redirect-05ff01adb5
  namespace: demo
spec:
  parentRefs:
  - name: ssl-redi-gateway-5fe31229ea
    sectionName: http-80
  rules:
  - filters:
    - requestRedirect:
        port: 443
        scheme: https
        statusCode: 301
      type: RequestRedirect

  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 3, 2026

@shraddhabang shraddhabang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 7, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shraddhabang, shuqz, wweiwei-li

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [shraddhabang,shuqz,wweiwei-li]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot
k8s-ci-robot merged commit 7f10a8a into kubernetes-sigs:main Apr 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants