I am trying to deploy an application on kubernetes using rancher using the inbuilt pipeline. I am using a gateway + virtual service to expose the endpoints. My application gets deployed but gateway creation fails with "Forbidden" error. Is this a privileges issue? How can I fix it
YAML File (works perfectly with kubectl command but fails with pipeline)
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: sampleapi-gateway
namespace: default
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- '*'
Error
+ kube-apply
perform env var substitution
Error from server (Forbidden): error when retrieving current configuration of:
Resource: "networking.istio.io/v1alpha3, Resource=gatewaies", GroupVersionKind: "networking.istio.io/v1alpha3, Kind=Gateway"
Name: "sampleapi-gateway", Namespace: "default"
Object: &{map["kind":"Gateway" "metadata":map["name":"sampleapi-gateway" "namespace":"default" "annotations":map["kubectl.kubernetes.io/last-applied-configuration":""]] "spec":map["selector":map["istio":"ingressgateway"] "servers":[map["port":map["name":"http" "number":'P' "protocol":"HTTP"] "hosts":["*"]]]] "apiVersion":"networking.istio.io/v1alpha3"]}
from server for: "services/sampleapi/rancher-conf/gateway.yaml": gatewaies.networking.istio.io "sampleapi-gateway" is forbidden: User "system:serviceaccount:p-9flp2-pipeline:jenkins" cannot get resource "gatewaies" in API group "networking.istio.io" in the namespace "default"