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

kubectl convert doesn't do its job #5

Open
virtualistic opened this issue Feb 15, 2023 · 0 comments
Open

kubectl convert doesn't do its job #5

virtualistic opened this issue Feb 15, 2023 · 0 comments

Comments

@virtualistic
Copy link

https://github.com/jamesbuckett/ckad-questions/blob/main/05-ckad-observability-maintenance.md#05-06-convert-manifests-between-different-api-versions
The command kubectl-convert -f ~/ckad/06-04-beta-ingress.yml --output-version networking.k8s.io/v1
give us this output:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
  creationTimestamp: null
  name: my-ingress
spec:
  rules:
  - http:
      paths:
      - backend: {}
        path: /
        pathType: Prefix
status:
  loadBalancer: {}

but applying it shows an error:

The Ingress "my-ingress" is invalid: spec.rules[0].http.paths[0].backend: Invalid value: "": resource or service backend is required

So you need to copy/paste from the ingress example the service part so it looks like this:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
  creationTimestamp: null
  name: my-ingress
spec:
  rules:
  - http:
      paths:
      - path: / 
        pathType: Prefix
        backend:
          service:
            name: my-service 
            port:
              number: 8080 
status:
  loadBalancer: {}
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