jenkinsci / kubernetes-cd-plugin

A Jenkins plugin to deploy to Kubernetes cluster
MIT License
139 stars 70 forks source link

Details: java.io.IOException: Unknown apiVersionKind: networking.k8s.io/v1/Ingress #142

Open gutschet opened 3 years ago

gutschet commented 3 years ago

After Upgrading our kubernetes cluster to 1.19.0, we cannot use the plugin for our deployments, anymore. Up to now, our Ingress ressources used the apiVersion extensions/v1beta1 but with the new version, this is no longer supported so we migrated our Ingress resources in the yaml files to new apiVersion: networking.k8s.io/v1. When we try to use the plugin now to deploy to our cluster, we get the following error: ERROR: ERROR: java.io.IOException: ERROR: YAML file test.yaml is invalid, please check it. Details: java.io.IOException: Unknown apiVersionKind: networking.k8s.io/v1/Ingress known kinds are: {v1/ServerAddressByClientCIDRBuilder=class io.kubernetes.client.openapi.models.V1ServerAddressByClientCIDRBuilder, v1/ReplicaSetConditionFluentImpl=class io.kubernetes.client.openapi.models.V1ReplicaSetConditionF...

When I put the same yaml file to my kubemaster server and deploy with kubectl apply -f test.yaml, everything works fine.

Please advice.

Kind regards Timo

guilhermemauro commented 3 years ago

The same problem. Any solution?

cgonc commented 3 years ago

We got the same problem here.

uday-kakkar commented 3 years ago

same issue ! any solution

BronzeDeer commented 3 years ago

I am also on 1.19 (1.19.3 to be precise), but I only get a deprecation warning with the beta Ingress, I can still use it (both through kubectl and this plugin). It is understandable if you don't want to build on a deprecated version, but maybe this can help provide a temporary fix for someone else until this is fixed properly

Here's an example of what I currently deploy through the plugin (v1 version of the same Ingress left in as comments)


#v1 version left in the comments for future upgrade
#apiVersion: networking.k8s.io/v1
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: i-${DEPLOY_NAME}
  namespace: ${DEPLOY_NAMESPACE}

spec:
#  ingressClassName: traefik
  rules:
    - host: ${DEPLOY_URL_DOMAIN}
      http:
        paths:
        - path: ${DEPLOY_URL_PATH_PREFIX}
#          pathType: Prefix
          backend:
#            service:
#              - name: ${DEPLOY_NAME}
#                port: ${DEPLOY_URL_PORT}
            serviceName: s-${DEPLOY_NAME}
            servicePort: ${DEPLOY_URL_PORT}`
gutschet commented 3 years ago

The Plugin keeps an own list auf possible apiVersions. We switched to another plugin (kubernetes-cli) which works fine.

bakaibalazs commented 3 years ago

not works too

Manu10744 commented 3 years ago

Same here... still no solution?

nttoan26 commented 3 years ago

no solution

gutschet commented 3 years ago

As there is still no solution to this, we totally removed this plugin from our tech stack and replaced it by kubernetes-cli plugin. Without a solution to this issue, this plugin is useless for us.

JHBalaji commented 2 years ago

Any solution on this?