Skip to content

Commit

Permalink
feat (jkube-kit/enricher) : Add WellKnownLabelsEnricher for adding Ku…
Browse files Browse the repository at this point in the history
…bernetes Recommended Well Known Labels

+ Add WellKnownLabelEnricher that would add these labels to `.metadata`
  of all resources (also to `selector.matchLabels` in case of controller
  resources):
  - `app.kubernetes.io/component`
  - `app.kubernetes.io/managed-by`
  - `app.kubernetes.io/name`
  - `app.kubernetes.io/part-of`
  - `app.kubernetes.io/version`

Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Jan 11, 2024
1 parent bd37d6d commit 8b9d78b
Show file tree
Hide file tree
Showing 27 changed files with 850 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
expose: "true"
app: expose
provider: jkube
Expand All @@ -23,6 +26,8 @@ items:
protocol: TCP
targetPort: 21
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -34,6 +39,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -44,6 +52,8 @@ items:
revisionHistoryLimit: 2
selector:
matchLabels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -54,6 +64,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
expose: "true"
app: expose
provider: jkube
Expand All @@ -25,6 +28,8 @@ items:
protocol: TCP
targetPort: 21
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -38,6 +43,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -47,6 +55,8 @@ items:
replicas: 1
revisionHistoryLimit: 2
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -63,6 +73,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down Expand Up @@ -104,6 +117,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
expose: "true"
app: expose
provider: jkube
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
expose: "true"
app: expose
provider: jkube
Expand All @@ -23,6 +26,8 @@ items:
protocol: TCP
targetPort: 21
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -34,6 +39,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -44,6 +52,8 @@ items:
revisionHistoryLimit: 2
selector:
matchLabels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -54,6 +64,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
expose: "true"
app: expose
provider: jkube
Expand All @@ -25,6 +28,8 @@ items:
protocol: TCP
targetPort: 21
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -38,6 +43,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -47,6 +55,8 @@ items:
replicas: 1
revisionHistoryLimit: 2
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -63,6 +73,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down Expand Up @@ -104,6 +117,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
expose: "true"
app: expose
provider: jkube
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -22,6 +25,8 @@ items:
protocol: TCP
targetPort: 21
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -33,6 +38,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -43,6 +51,8 @@ items:
revisionHistoryLimit: 2
selector:
matchLabels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -53,6 +63,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down Expand Up @@ -86,6 +99,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -24,6 +27,8 @@ items:
protocol: TCP
targetPort: 21
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -37,6 +42,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -46,6 +54,8 @@ items:
replicas: 1
revisionHistoryLimit: 2
selector:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -62,6 +72,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down Expand Up @@ -103,6 +116,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down
13 changes: 13 additions & 0 deletions gradle-plugin/it/src/it/expose/expected/ftp-port/kubernetes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ items:
provider: jkube
version: "@ignore@"
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
name: expose
spec:
ports:
Expand All @@ -25,6 +28,8 @@ items:
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
- apiVersion: apps/v1
kind: Deployment
metadata:
Expand All @@ -33,6 +38,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand All @@ -43,6 +51,8 @@ items:
revisionHistoryLimit: 2
selector:
matchLabels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app: expose
provider: jkube
group: org.eclipse.jkube.integration.tests.gradle
Expand All @@ -53,6 +63,9 @@ items:
jkube.eclipse.org/git-commit: "@ignore@"
jkube.eclipse.org/git-branch: "@ignore@"
labels:
app.kubernetes.io/managed-by: jkube
app.kubernetes.io/name: expose
app.kubernetes.io/version: "@ignore@"
app: expose
provider: jkube
version: "@ignore@"
Expand Down
Loading

0 comments on commit 8b9d78b

Please sign in to comment.