several questions
#1080
-
hello i have a yaml like this ingress:
# ingress.enabled -- Enable ingress resource.
enabled: true
albLogs: true
# ingress.annotations -- Configures annotations for the ingress.
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/healthcheck-path: /v1/healthcheck
hosts:
# ingress.hosts[0].host -- Host name for routing traffic.
- host: whatever
http:
paths:
- path: "/*"
backend:
serviceName: whatever
servicePort: http
- host: whatever
http:
paths:
- path: "/*"
backend:
serviceName: whatever
servicePort: http and I want to convert it to something like the one below. note the differences after ingress:
# ingress.enabled -- Enable ingress resource.
enabled: true
albLogs: true
# ingress.annotations -- Configures annotations for the ingress.
annotations:
alb.ingress.kubernetes.io/scheme: internet-facing
alb.ingress.kubernetes.io/healthcheck-path: /v1/healthcheck
hosts:
# ingress.hosts[0].host -- Host name for routing traffic.
- host: whatever
http:
paths:
- path: "/*"
backend:
service:
name: whatever
port:
name: http
- host: whatever
http:
paths:
- path: "/*"
backend:
service:
name: whatever
port:
name: http any hints? |
Beta Was this translation helpful? Give feedback.
Answered by
mikefarah
Jan 24, 2022
Replies: 1 comment 1 reply
-
yq e '.ingress.hosts.[].http.paths.[].backend |= {"service": {"name": .serviceName, "port": {"name": .servicePort}}}' file.yaml
Hope that makes sense! |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
blastik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
yq e '.ingress.hosts.[].http.paths.[].backend |= {"service": {"name": .serviceName, "port": {"name": .servicePort}}}' file.yaml
|=
updates the backend node relative to itself (so on the right hand side it's set as the root context).Hope that makes sense!