prevent kapp from altering the selector of our services

This makes it so that our service selector will match exactly the
YAML we specify instead of including an extra "kapp.k14s.io/app" key.
This will take us closer to the standard kubectl behavior which is
desirable since we want to avoid future bugs that only manifest when
kapp is not used.

Signed-off-by: Monis Khan <mok@vmware.com>
This commit is contained in:
Monis Khan 2021-09-15 16:08:49 -04:00
parent 316e6171d4
commit efaca05999
No known key found for this signature in database
GPG Key ID: 52C90ADA01B269B8
3 changed files with 18 additions and 0 deletions

View File

@ -242,6 +242,9 @@ metadata:
name: #@ defaultResourceNameWithSuffix("api") name: #@ defaultResourceNameWithSuffix("api")
namespace: #@ namespace() namespace: #@ namespace()
labels: #@ labels() labels: #@ labels()
#! prevent kapp from altering the selector of our services to match kubectl behavior
annotations:
kapp.k14s.io/disable-default-label-scoping-rules: ""
spec: spec:
type: ClusterIP type: ClusterIP
selector: #@ deploymentPodLabel() selector: #@ deploymentPodLabel()
@ -256,6 +259,9 @@ metadata:
name: #@ defaultResourceNameWithSuffix("proxy") name: #@ defaultResourceNameWithSuffix("proxy")
namespace: #@ namespace() namespace: #@ namespace()
labels: #@ labels() labels: #@ labels()
#! prevent kapp from altering the selector of our services to match kubectl behavior
annotations:
kapp.k14s.io/disable-default-label-scoping-rules: ""
spec: spec:
type: ClusterIP type: ClusterIP
selector: #@ deploymentPodLabel() selector: #@ deploymentPodLabel()

View File

@ -73,6 +73,9 @@ metadata:
namespace: local-user-authenticator namespace: local-user-authenticator
labels: labels:
app: local-user-authenticator app: local-user-authenticator
#! prevent kapp from altering the selector of our services to match kubectl behavior
annotations:
kapp.k14s.io/disable-default-label-scoping-rules: ""
spec: spec:
type: ClusterIP type: ClusterIP
selector: selector:

View File

@ -12,6 +12,9 @@ metadata:
name: #@ defaultResourceNameWithSuffix("nodeport") name: #@ defaultResourceNameWithSuffix("nodeport")
namespace: #@ namespace() namespace: #@ namespace()
labels: #@ labels() labels: #@ labels()
#! prevent kapp from altering the selector of our services to match kubectl behavior
annotations:
kapp.k14s.io/disable-default-label-scoping-rules: ""
spec: spec:
type: NodePort type: NodePort
selector: #@ deploymentPodLabel() selector: #@ deploymentPodLabel()
@ -44,6 +47,9 @@ metadata:
name: #@ defaultResourceNameWithSuffix("clusterip") name: #@ defaultResourceNameWithSuffix("clusterip")
namespace: #@ namespace() namespace: #@ namespace()
labels: #@ labels() labels: #@ labels()
#! prevent kapp from altering the selector of our services to match kubectl behavior
annotations:
kapp.k14s.io/disable-default-label-scoping-rules: ""
spec: spec:
type: ClusterIP type: ClusterIP
selector: #@ deploymentPodLabel() selector: #@ deploymentPodLabel()
@ -70,6 +76,9 @@ metadata:
name: #@ defaultResourceNameWithSuffix("loadbalancer") name: #@ defaultResourceNameWithSuffix("loadbalancer")
namespace: #@ namespace() namespace: #@ namespace()
labels: #@ labels() labels: #@ labels()
#! prevent kapp from altering the selector of our services to match kubectl behavior
annotations:
kapp.k14s.io/disable-default-label-scoping-rules: ""
spec: spec:
type: LoadBalancer type: LoadBalancer
selector: #@ deploymentPodLabel() selector: #@ deploymentPodLabel()