tilt-dev / tilt

Define your dev environment as code. For microservice apps on Kubernetes.
https://tilt.dev/
Apache License 2.0
7.68k stars 303 forks source link

group services with pods #5886

Open nicks opened 2 years ago

nicks commented 2 years ago

From sam in the tilt channel:

apiVersion: v1
kind: Pod
metadata:
  name: eureka
  labels:
    app: eureka
spec:
  containers:
  - name: eureka
    image: netflixoss/eureka:1.3.1
    ports:
      - containerPort: 8080

---
apiVersion: v1
kind: Service
metadata:
  name: eureka
  labels:
    app: eureka
spec:
  ports:
    - port: 8080
  selector:
    app: eureka

im wondering if there is any other way to flag k8s services with a label so they get grouped in tandem, like the above

Currently, Tilt will match up Services with PodTemplates (e.g., Deployments, ReplicaSets), but not with bare pods

milas commented 2 years ago

I imagine app.kubernetes.io/name / app would be reasonable labels to auto-group on by default, and we could also expose something via Tiltfile like k8s_resource_settings(auto_group_labels=['custom.example.com/app']) 🤔