How to create ingress in Kubernetes V1.23.1 version ?
See original GitHub issueI referred to the sample code, but it did not compile successfully. I am using Kubernetes-Client version 5.12.1
Ingress ingress = new IngressBuilder() .withNewMetadata().withName("test-ingress").addToAnnotations("nginx.ingress.kubernetes.io/rewrite-target", "/").endMetadata() .withNewSpec() .addNewRule() .withNewHttp() .addNewPath() .withPath("/testPath").withNewBackend().withServiceName("test").withServicePort(new IntOrString(80)).endBackend() .endPath() .endHttp() .endRule() .endSpec() .build(); client.network().ingress().inNamespace("default").create(ingress);
But I compiled successfully in V4.12.0 using the following methods: client.extensions().ingresses().createorreplace (ingress);
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Ingress - Kubernetes
An API object that manages external access to the services in a cluster, typically HTTP. Ingress may provide load balancing, SSL termination ...
Read more >Kubernetes 1.23: The Next Frontier
Kubernetes releases now generate provenance attestation files describing the staging and release phases of the release process.
Read more >Updating NGINX-Ingress to use the stable Ingress API
On a v1.22 Kubernetes cluster, you'll be able to access Ingress and IngressClass objects through the stable (v1) APIs, but access via their ......
Read more >Set up Ingress on Minikube with the NGINX Ingress Controller
Create an Ingress · Create example-ingress.yaml from the following file: · Verify the IP address is set: kubectl get ingress · Add the...
Read more >Installing NGINX Ingress Controller - Documentation
Install NGINX using NodePort# · Check that the Ingress controller pods have started · Check that you can see the NodePort service ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Resolved,Modify the code as follows: import io.fabric8.kubernetes.api.model.networking.v1.Ingress; import io.fabric8.kubernetes.api.model.networking.v1.IngressBuilder;
thanks!
The error message is related to PUT performed by createOrReplace. See #3896 and related issues. Fabric8 6 will have basic support for server side apply #3334 - until then you may want to use something like:
This avoids a PUT on replace and when the diff is computed for an edit the buildOrEdit function will make sure that generated fields are retained.