public void AddIngress(IKubernetes client, Networkingv1beta1Ingress ingress, string nspace) { string regex = ""; if (ingress.Metadata.Annotations.ContainsKey("regex")) { regex = ingress.Metadata.Annotations["regex"]; } // Adding rewrite annotation; getting associated regex value // Creating a custom path for each service. Path format is arbitrary and could be changed if needed foreach (var rule in ingress.Spec.Rules) { foreach (var path in rule.Http.Paths) { path.Path = "/" + nspace + path.Path; } } client.CreateNamespacedIngress1(ingress, nspace); }