GoogleContainerTools / GoogleContainerTools/skaffold

Support KEP 1755 to allow artifact with different registry hostnames

Open
#3,461 10 comments 4 reactions 1 assignee Claimed by @azhao155 View on GitHub
area/registry help wanted kind/bug priority/p3
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

### Expected behavior

I am building a container image using Maven, Jib, and I am using MicroK8S / Multipass as my local testing environment.

I would expect logs to appear when running `skaffold dev --tail --port-forward`.

### Actual behavior

This is not the case because I have to use different hostnames for the registry, so Skaffold does not detect the dependency between an artifact to build and its usage in a Kubernetes resource file.

### Information

- Skaffold version: 1.1.0
- Operating system: macOS Catalina
- Contents of skaffold.yaml:

```yaml
apiVersion: skaffold/v1
kind: Config
metadata:
name: rain-and-umbrella
build:
artifacts:
- image: microk8s:32000/rain-service
jib: {}
context: rain-service
- image: microk8s:32000/do-i-need-my-umbrella-service
jib: {}
context: do-i-need-my-umbrella-service
insecureRegistries:
- microk8s:32000
deploy:
kubectl:
manifests:
- "**/k8s/*.yaml"
```

The issue appears because the MicroK8s registry needs to be accessed from `localhost` from inside the cluster, as shown in this resources definition:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: rain-service
name: rain-service
spec:
selector:
matchLabels:
app: rain-service
template:
metadata:
labels:
app: rain-service
spec:
containers:
- image: localhost:32000/rain-service
name: rain-service
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 3
periodSeconds: 5
---
apiVersion: v1
kind: Service
metadata:
labels:
app: rain-service
name: rain-service
spec:
ports:
- protocol: TCP
port: 8080
selector:
app: rain-service
type: LoadBalancer
```

We can see the following warnings in Skaffold logs:

```
WARN[0007] image [microk8s:32000/do-i-need-my-umbrella-service] is not used by the deployment
WARN[0007] image [microk8s:32000/rain-service] is not used by the deployment
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.