kubernetes-sigs / ingress2gateway

Convert Ingress resources to Gateway API resources
Apache License 2.0
323 stars 52 forks source link

Add support for GCE ingress class/provider #87

Open bokjo opened 8 months ago

bokjo commented 8 months ago

What would you like to be added: support for the GCE ingress provider

Why this is needed: to convert existing GCE ingress to the new GW API

Error while executing

ingress2gateway print
I1026 10:58:24.119436   48466 request.go:682] Waited for 1.049636692s due to client-side throttling, not priority and fairness, request: GET:https://XX.XX.XX.XX/apis/elasticsearch.k8s.elastic.co/v1beta1?timeout=32s
Error:

# Encountered 2 errors # spec.rules[0].http.paths[0].pathType: Invalid value: "ImplementationSpecific": unsupported path match type: ImplementationSpecific # spec.rules[0].http.paths[0].pathType: Invalid value: "ImplementationSpecific": unsupported path match type: ImplementationSpecific
Usage:
  ingress2gateway print [flags]

Flags:
  -A, --all-namespaces      If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even
                            if specified with --namespace.
  -h, --help                help for print
      --input_file string   Path to the manifest file. When set, the tool will read ingresses from the file instead of reading from the cluster. Supported files are yaml and json
  -n, --namespace string    If present, the namespace scope for this CLI request
  -o, --output string       Output format. One of: (json, yaml) (default "yaml")
      --providers strings   If present, the tool will try to convert only resources related to the specified providers, supported values are [ingress-nginx kong] (default [ingress-nginx,kong])

the current ingress has the following YAML (Redacted info)

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    ingress.gcp.kubernetes.io/pre-shared-cert: mcrt-XXX,mcrt-YYY,mcrt-ZZZ
    ingress.kubernetes.io/backends: '{"k8s1-XXX":"HEALTHY"}'
    ingress.kubernetes.io/forwarding-rule: k8s2-fr-XXX
    ingress.kubernetes.io/https-forwarding-rule: k8s2-fs-XXX
    ingress.kubernetes.io/https-target-proxy: k8s2-ts-XXX
    ingress.kubernetes.io/redirect-url-map: k8s2-rm-XXX
    ingress.kubernetes.io/ssl-cert: mcrt-XXX,mcrt-YYY,mcrt-ZZZ
    ingress.kubernetes.io/target-proxy: k8s2-tp-XXX
    ingress.kubernetes.io/url-map: k8s2-um-XXX
    kubernetes.io/ingress.allow-http: "true"
    kubernetes.io/ingress.class: gce
    kubernetes.io/ingress.global-static-ip-name: ingress-gw-public-XXX
    networking.gke.io/managed-certificates: XXX,YYY,ZZZ
    networking.gke.io/v1beta1.FrontendConfig: default-frontend-config-XXX
  labels:
    app.kubernetes.io/managed-by: pulumi
  name: gke-ingress-XXX
spec:
  defaultBackend:
    service:
      name: istio-XXX
      port:
        number: 443
  rules:
  - host: '*.example.com'
    http:
      paths:
      - backend:
          service:
            name: istio-XXX
            port:
              number: 443
        path: /*
        pathType: ImplementationSpecific
  tls:
  - hosts:
    - XXX.example.com
    secretName: secret-XXX
  - hosts:
    - YYY.example.com
    secretName: secret-YYY
  - hosts:
    - ZZZ.example.com
    secretName: secret-ZZZ
status:
  loadBalancer:
    ingress:
    - ip: XX.XX.XX.XX
LiorLieberman commented 7 months ago

@spencerhance & @robscott can you relate to this issue? What it takes to support this, maybe one of the members from the community can pick it up?

spencerhance commented 7 months ago

Some initial thoughts...

The following GCP-specific stuff can be implemented fairly easily (not an exhaustive list):

The other features require converting the FrontendConfig and BackendConfig CRDs to ServicePolicies. FC/BC are located in Ingress-gce and can be imported here. The ServicePolicy YAMLs are exported in gateway-api/config/servicepolicies/crd but we would have to export the go types as well so we can use the controller runtime client here.

I can definitely assist here (especially with the ServicePolicies).

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

sawsa307 commented 3 months ago

Hi @LiorLieberman I've talked to Rob, and I would like to work on this.

/assign

sawsa307 commented 3 months ago

/remove-lifecycle rotten

LiorLieberman commented 3 months ago

Hey @sawsa307, thats awesome! Let me know if I can help with anything!

k8s-triage-robot commented 6 days ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

LiorLieberman commented 4 days ago

/remove-lifecycle stale