carvel-dev / carvel-dev/kapp

kapp injects label in Service Selector but not StatefulSet Pod Template

Open
#753 1 comment 0 reactions 0 assignees View on GitHub
bug discussion helping with an issue
Dominant language
Go
Stars
1.1k
Forks
134
PR merge metrics
No merged PRs in 30d

Description

*Service* has its `selector` modified by kapp:

```yaml
apiVersion: v1
kind: Service
spec:
selector:
app.kubernetes.io/component: prometheus
app.kubernetes.io/instance: k8s
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: kube-prometheus
kapp.k14s.io/app: "1684079013099136212"
```

Leading to the Service not having any matching Pods.

Whereas *StatefulSet* does not have its `spec.template.metadata.labels` modified:

```yaml
spec:
template:
metadata:
labels:
app.kubernetes.io/component: prometheus
app.kubernetes.io/instance: k8s
app.kubernetes.io/managed-by: prometheus-operator
app.kubernetes.io/name: prometheus
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 2.43.0
operator.prometheus.io/name: k8s
operator.prometheus.io/shard: "0"
prometheus: k8s
```

Why is the *selector* modified at all?

**What steps did you take:**

- Define a Service
- Define a StatefulSet
- Define selectors in Service to match the Labels in the StatefulSet Pod Template.
- Deploy these two via kapp.

**What happened:**

- kapp adds label to the Service
- kapp adds label to the Service *selector*
- kapp adds label to the StatefulSet.
- kapp does NOT add labels to the StatefulSet Pod Template.

**What did you expect:**

One of:

- label to *not* be added in Service selector
- label to be added in Pod Template

**Anything else you would like to add:**

I would expect kapp to "just work" for passing something this simple throuigh it.

**Environment:**

- kapp version (use `kapp --version`): `kapp version 0.54.3`
- OS (e.g. from `/etc/os-release`): `Ubuntu 22.04.1 LTS`
- Kubernetes version (use `kubectl version`) `v1.22.17`

---
Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

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.