TIS0101 - Specified Namespace Cannot Be Found
The specified namespace cannot be found.
To avoid configuration errors, ensure that the namespaces specified in your Istio resources exist. Correct any typographical errors, remove non-existent namespaces, or create missing namespaces to apply policies correctly.
Examples
-
AuthorizationPolicyRefers to Non-Existent NamespaceapiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: access-policy
namespace: example-namespace
spec:
rules:
- from:
- source:
namespaces: ["non-existent-namespace"]Explanation: The
AuthorizationPolicyrefers to a source namespacenon-existent-namespacethat does not exist, making the rule ineffective for access control. -
VirtualServicewith a Host in a Non-Existent NamespaceapiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: my-virtual-service
namespace: example-namespace
spec:
hosts:
- "my-service.non-existent-namespace.svc.cluster.local"
http:
- route:
- destination:
host: my-service.non-existent-namespace.svc.cluster.localExplanation: The
VirtualServicereferences a host in thenon-existent-namespace, which does not exist, causing the routing rule to fail. -
ServiceEntryRefers to a Non-Existent NamespaceapiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:
name: external-service
namespace: example-namespace
spec:
hosts:
- "external-service.non-existent-namespace.svc.cluster.local"
ports:
- number: 80
name: http
protocol: HTTPExplanation: The
ServiceEntryspecifies a host innon-existent-namespace, which does not exist, preventing the configuration from being properly applied.
Recommendation
Remove the namespace from the list, correct any typographical errors, or create a new namespace.
-
Remove or Correct the Non-Existent Namespace
Correct the namespace to an existing one or remove it if not needed.
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: access-policy
namespace: example-namespace
spec:
rules:
- from:
- source:
namespaces: ["existing-namespace"] -
Create the Missing Namespace
If the namespace is intended to exist, create it before applying the configuration.
kubectl create namespace non-existent-namespace -
Update Hostnames in Configuration
Update the hostnames in
VirtualServiceorServiceEntryto refer to a valid namespace.apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: my-virtual-service
namespace: example-namespace
spec:
hosts:
- "my-service.existing-namespace.svc.cluster.local"
http:
- route:
- destination:
host: my-service.existing-namespace.svc.cluster.local