I am using jkube to deploy a springboot helloworld application on my kubernetes installation. I wanted to add a resource fragment defining a Traefik ingress route but k8s:resource fails with "Unknown type 'ingressroute'".
IngressRoute has already been defined on the cluster using custom resource definition.
How do I write my fragment?
The following works when i deploy it with kubectl.
# IngresRoute --- kind: IngressRoute apiVersion: traefik.containo.us/v1alpha1 metadata: name: demo namespace: default spec: entryPoints: - web routes: - match: Host(`demo.domainname.com`) kind: Rule services: - name: demo port: 80
I'm from Eclipse JKube team. We have improved CustomResource support a lot in our recent v1.2.0 release. Now you only need to worry about how you name your CustomResource fragment and Eclipse JKube would detect the CustomResourceDefinition for specified IngressRoute.
I think you would need to name CustomResource fragments with a
*-cr.yml
at the end. This is due to distinguishing them from standard Kubernetes resources. For example I added yourIngressRoute
fragment in mysrc/main/jkube
like this:Then you should be able to see your IngressRoute generated after
k8s:resource
phase:You can then go ahead and apply these generated manifests to your Kubernetes Cluster with apply goal:
I tried all this on this reproducer project and it seemed to be working okay for me: https://github.com/r0haaaan/jkube-custom-resource-fragments