GoogleContainerTools / GoogleContainerTools/skaffold

Skaffold Docs Re. Tags

Open
#6,278 5 comments 0 reactions 0 assignees View on GitHub
area/docs kind/documentation
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

I think the documentation is very unclear about the tagging process, unless I am missing something. I am happy to issue PRs for docs; I am also a technical writer. E.g. in the [quickstart](https://skaffold.dev/docs/quickstart/):

> skaffold dev watches your local source code and executes your Skaffold pipeline every time a change is detected. skaffold.yaml provides specifications of the workflow - in this example, the pipeline is

> * Building a Docker image from the source using the Dockerfile
> * Tagging the Docker image with the sha256 hash of its contents
> * Updating the Kubernetes manifest, k8s-pod.yaml, to use the image built previously
> * Deploying the Kubernetes manifest using kubectl apply -f
> * Streaming the logs back from the deployed app

If I do `$ skaffold build --tag='0.1.0'`

and then I do `docker image ls` I don't see my tagged image. I also don't see that it pushed to dockerhub.

Also, this from the docs:

> Updating the Kubernetes manifest, k8s-pod.yaml, to use the image built previously."

In my case I don't have a pod.yaml, just deployment.yaml. Should I expect skaffold to update my manifest files? In my case it doesn't. Again, I'd love to improve the docs, but I need to understand what is the expected behavior first.

Furthermore, I'm a bit unclear, even after reading the docs several times, what the workflow is like. I do `skaffold dev` in order to "hot reload" my k8s local cluster while developing...fine, but then what's the tagging for? Wouldn't I only tag when I was ready to create a new version of my app?

Here is my skaffold.yaml:

```yaml
apiVersion: skaffold/v2beta19
kind: Config
metadata:
name: hello-k8s
build:
artifacts:
- image: kahunacohen/hello-k8s
docker:
dockerfile: Dockerfile
deploy:
kubectl:
manifests:
- manifests/web-configmap.yaml
- manifests/web-service.yaml
- manifests/web-deployment.yaml
```

My web-configmap.yaml

```yaml
apiVersion: v1
data:
MY_NON_SECRET: foo
MY_OTHER_NON_SECRET: bar
kind: ConfigMap
metadata:
name: web-configmap
namespace: default
```

My web-service.yaml

```yaml
apiVersion: v1
kind: Service
metadata:
name: web-service
spec:
type: NodePort
selector:
app: web-pod
ports:
# This maps incoming traffic on port 80 to port 3000 where the containers are running on, as defined in the deployment.
- port: 80
targetPort: 3000
protocol: TCP
name: foo
```

and my web-deployment.yaml:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-deployment
spec:
replicas: 2
selector:
matchLabels:
app: web-pod
template:
metadata:
labels:
app: web-pod
spec:
containers:
- name: web
image: kahunacohen/hello-k8s
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: web-configmap
ports:
- containerPort: 3000
protocol: TCP
```

and:

```bash
$ skaffold config list
skaffold config:
kube-context: minikube
default-repo: index.docker.io
```

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.