Hi All , me trying to add multiple path rule in ingress resource through kubectl . . .

sudhi:
Hi All , me trying to add multiple path rule in ingress resource through kubectl create ingress command

root@controlplane:~# oc create ingress ingress-wear-watch -n app-space --rule=/wear=wear-service:8080,/watch=video-service=8080 --dry-run=client -o yaml > ingress.yml

But its picking up only one rule , how to add multiple rule using kubectl create ingress …

Contents of ingress.yml after execution of above command shows as below

root@controlplane:~# cat ingress.yml
apiVersion: <http://networking.k8s.io/v1|networking.k8s.io/v1>
kind: Ingress
metadata:
creationTimestamp: null
name: ingress-wear-watch
namespace: app-space
spec:
rules:
- http:
paths:
- backend:
service:
name: wear-service
port:
number: 8080
path: /wear
pathType: Exact
tls:
- secretName: video-service
status:
loadBalancer: {}

sudhi:
pls ignore it, found a way to add multiple rules using kubectl create ingress

Ankit Kumar:
@sudhi can you paste that command as well here?

sudhi:
kubectl create ingress ingress-wear-watch -n app-space --rule=/wear=wear-service:8080 --rule=/watch=video-service:8080 --dry-run=client -o yaml > in.yml

sudhi:
this link https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#-em-ingress-em- is usefull for all who are inclined to do in command ways