Open RSoeborg opened 1 year ago
Just to add to this issue:
In the ingress validation step, the namespace is set but not used when listing deployments: ListDeploymentForAllNamespacesWithHttpMessagesAsync
, giving a 403 Forbidden as well
// If namespace is null, set it to default
config.Namespace ??= "default";
var kubernetes = new Kubernetes(config);
// Looking for a deployment using a standard label.
// Note: using a deployment instead of a service - minikube doesn't create a service for the controller.
try
{
var result = await kubernetes.ListDeploymentForAllNamespacesWithHttpMessagesAsync(
labelSelector: "app.kubernetes.io/name in (ingress-nginx, nginx-ingress-controller)");
if (result.Body.Items.Count > 0)
{
foreach (var service in result.Body.Items)
{
output.WriteInfoLine($"Found existing ingress controller '{service.Metadata.Name}' in namespace '{service.Metadata.NamespaceProperty}'.");
}
return;
}
}
And even with "--Force", the fetch step still occurs and fails (due to the 403) - The Force
guard should perhaps be in the top of the file?
Describe the bug
Some kubernetes providers doesn't allow you to access the "kube system". This is a problem when deploying, since the
KubectlDetector
class callskubectl cluster-info
.No matter what namespace is defined for your current context,
kubectl cluster-info
always tries to retrieve fromkube-system
unless you directly specifykubectl cluster-info --namespace=my-namespace
The issue is that even if I try to deploy with
tye deploy --namespace my-namespace
it doesn't use that namespace when it checks if kubectl is connected to a cluster inIsKubectlConnectedToClusterAsync()
- so in return I get aForbidden
error back, and since it has a non zero exit code, Tye says that kubectl is not connected to a cluster (even though it is).Further technical details
Include the output of
tye --version
0.11.0-alpha.22111.1+3edef5428949c518c078844d6438e5ba86fce600If possible rerun the command with
-v debug
and include the outputThe platform (Linux/macOS/Windows)
Linux running on WSL:
cat /etc/os-release