Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ch15 Error on ingress deployment #66

Open
rpjeff opened this issue May 19, 2023 · 0 comments
Open

Ch15 Error on ingress deployment #66

rpjeff opened this issue May 19, 2023 · 0 comments

Comments

@rpjeff
Copy link

rpjeff commented May 19, 2023

Chapter 15 command produces and error on later API versions,

# kubectl apply -f hello-kiamol/ingress/localhost.yaml 
Error from server (BadRequest): error when creating "hello-kiamol/ingress/localhost.yaml": Ingress in version "v1" cannot be handled as a Ingress: strict decoding error: unknown field "spec.rules[0].http.paths[0].backend.serviceName", unknown field "spec.rules[0].http.paths[0].backend.servicePort"

The fix is to upgrade from the v1beta1 API to v1 API , thus,

diff --git a/ch15/hello-kiamol/ingress/localhost.yaml b/ch15/hello-kiamol/ingress/localhost.yaml
index 83e95a1..d2f5732 100644
--- a/ch15/hello-kiamol/ingress/localhost.yaml
+++ b/ch15/hello-kiamol/ingress/localhost.yaml
@@ -1,4 +1,4 @@
-apiVersion: networking.k8s.io/v1beta1 
+apiVersion: networking.k8s.io/v1
 kind: Ingress
 metadata:
   name: hello-kiamol
@@ -8,7 +8,10 @@ spec:
   rules:
   - http:
       paths:
-      - path: /
-        backend:
-          serviceName: hello-kiamol
-          servicePort: 80
\ No newline at end of file
+        - pathType: Prefix
+          path: /
+          backend:
+            service:
+              name: hello-kiamol
+              port:
+                number: 80

The rest of the examples in the chapter which use "kind: ingress" also suffer from this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant