k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.13k stars 353 forks source link

Manifest deployer tries to create ingress resource before ingress controller is ready #4104

Open enp opened 4 months ago

enp commented 4 months ago

k0s started via docker with two manifests mounted to /var/lib/k0s/manifests:

No any ingress resource was deployed after k0s completely up and running, but ingress will appear on manual kubectl apply the same manifest

Looks like manifest deployer tries to create ingress resource before nginx ingress controller is ready - so how create ingress resource only after ingress controller via manifest deployer?

github-actions[bot] commented 3 months ago

The issue is marked as stale since no activity has been recorded in 30 days

github-actions[bot] commented 2 months ago

The issue is marked as stale since no activity has been recorded in 30 days

jnummelin commented 2 months ago

@enp Is this a standard Ingress resource you are referring to? If yes, it should not matter as the ingress controller will pick those up once it starts.

Or is this some custom CRD based ingress?

github-actions[bot] commented 1 month ago

The issue is marked as stale since no activity has been recorded in 30 days

twz123 commented 1 month ago

k0s started via docker with two manifests mounted to /var/lib/k0s/manifests

How do you mount them? Can you provide an example? Note that manifest files below /var/lib/k0s/manifests need to be organized in folders, so you need to put them into, say /var/lib/k0s/manifests/nginx-ingress/*.yaml.

enp commented 1 month ago

Run (with mount) example:

docker run --name k0s --hostname k0s --rm --privileged -v k0s:/var/lib/k0s \
  -v $(pwd)/manifests:/var/lib/k0s/manifests \
  -p 6443:6443 -p 80:80 docker.io/k0sproject/k0s k0s controller --single

Manifest files in folders per files solves problem, thank you! But what is the reason for this limitation?

twz123 commented 1 month ago

Manifest files in folders per files solves problem, thank you! But what is the reason for this limitation?

K0s will add a "stack" label to all resources that are created via the manifest folder. This is used for automatic pruning (think: kubectl apply --prune -f ...). The folder name is used as the stack's name. Without a folder, it's not clear which stack name to choose.

enp commented 1 month ago

File name can be also used for stack name, why no? But idea is clear, thank you!

github-actions[bot] commented 2 days ago

The issue is marked as stale since no activity has been recorded in 30 days