karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.49k stars 890 forks source link

Schedule ingress resource to clusters with different GroupVersion. #4081

Open cepaallium opened 1 year ago

cepaallium commented 1 year ago

My Karmada Controller Plane has two member clusters, but have different k8s version. the first one has an ingress resource whose GroupVersion is extensions/v1beta1, and another one is networking.k8s.io/v1, How can i spreed one Ingress Object In My Karmada to the two member?

cepaallium commented 1 year ago

@calvin0327 @RainbowMango thanks!

liangyuanpeng commented 1 year ago

@cepaallium Try to match two version resource?

  resourceSelectors:
    - apiVersion: extensions/v1beta1
      kind: XXX
      name: foo
      namespace: default
    - apiVersion: networking.k8s.io/v1
      kind: XXX
      name: foo
      namespace: default
cepaallium commented 1 year ago

@cepaallium Try to match two version resource?

  resourceSelectors:
    - apiVersion: extensions/v1beta1
      kind: XXX
      name: foo
      namespace: default
    - apiVersion: networking.k8s.io/v1
      kind: XXX
      name: foo
      namespace: default

but our karmada api-resources just support one kind ingress as follow:

[root@xxx ~]# kubectl api-resources --kubeconfig config | grep ingress
ingressclasses                                          networking.k8s.io/v1                   false        IngressClass
ingresses                                  ing          networking.k8s.io/v1                   true         Ingress
multiclusteringresses                      mci          networking.karmada.io/v1alpha1         true         MultiClusterIngress

if i create an ingress of extensions/v1beta1, the karmada will throw an error.

RainbowMango commented 1 year ago

the first one has an ingress resource whose GroupVersion is extensions/v1beta1, and another one is networking.k8s.io/v1,

It is recommended to upgrade the first cluster to a version that can support networking.k8s.io/v1.

If you insist on using the deprecated version extensions/v1beta1, you must ensure the following:

After that, you can propagate extensions/v1beta1 from the Karmada control plane.