tilt-dev / tilt-dev/tilt

Virtualised microk8s registry settings not correctly inferred.

Open
#5,446 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug docs request
Dominant language
Go
Stars
10.1k
Forks
413
Avg merge
1d 10h
Merged PRs (30d)
6

Description

Expected Behavior

Tilt correctly infers both the Host and hostFromCluster values of a registry when using microk8s in a vm. The Host should probably be the address of the registry, as addressable from the host machine (i.e. the IP address of the VM) and hostFromCluster should be localhost.

Current Behavior

The Host value is hard-coded to be localhost: https://github.com/tilt-dev/tilt/blob/77ae37f8f66c4b2d6df5eb526bd71954be73ecf2/internal/k8s/registry.go#L101

Context
tilt doctor Output
$ tilt doctor
Tilt: v0.23.9, built 2022-01-27
System: darwin-arm64
---
Docker
- Host: [default]
- Server Version: 20.10.12
- API Version: 1.41
- Builder: 2
- Compose Version: v2.2.3
---
Kubernetes
- Env: microk8s
- Context: microk8s
- Cluster Name: microk8s-cluster
- Namespace: default
- Container Runtime: containerd
- Version: v1.22.5-3+2cf820a97417ce
- Cluster Local Registry: {Host:localhost:32000 hostFromCluster: SingleName:}
---
About Your Use Case

I use macos. Docker is running in a VM using Docker Desktop. microk8s is running in a different one using multipass. I have enabled microk8s local registry. In the Docker VM, localhost (the inferred registry host) is referring to the docker vm, not the host vm. default_registry (as discussed in #4125) can not be used to override the inferred registry values.

When I hack DecideRegistry to always use the default_registry value, things work, so I think my issue is only related to the inference of the registry settings for microk8s.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in internal/k8s/registry.go at DecideRegistry and the linked hard-coded Host line. Use the reported tilt doctor output and virtualized microk8s setup as the reproduction target; done means Host is reachable from the host machine while hostFromCluster is localhost.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.