Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kustomize Label Additions prevent services from finding Deployments #77

Closed
runyontr opened this issue Jan 14, 2019 · 2 comments
Closed

Comments

@runyontr
Copy link
Member

runyontr commented Jan 14, 2019

Kustomize provides a feature to automatically add the labels on the service object into the selector spec. This typically provides consistency for objects created, but can cause issues for pods created from a different STEP than the service:

Consider the following:

 plans:
    deploy:
      strategy: serial
      phases:
        - name: all
          strategy: parallel
          steps:
            - name: services
              tasks:
              - services
            - name: deployment
              tasks:
              - deployment

The service object

    service.yaml: |
      apiVersion: v1
      kind: Service
      metadata:
        name: appinfo
        labels:
          app: appinfo
      spec:
        ports:
        - port: 8080
          protocol: TCP
        selector:
          app: appinfo
        type: LoadBalancer

Has the following label selectors:

$ kubectl get svc bird-appinfo -o jsonpath="{.spec.selector['step']}"
services

whereas the deployment gets created with the following label

$kubectl get deployments bird-appinfo -o jsonpath="{ .metadata.labels['step']}"
deployment

This added label for the specific step was added to be able to differentiate Jobs that need to be re-created even when they have the same name.

@runyontr
Copy link
Member Author

Blocking for #70

@alenkacz
Copy link
Contributor

we no longer put step into labels

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants