Skip to content

Commit 1e1d3c5

Browse files
committed
PR feedback
On-behalf-of: @SAP christoph.mewes@sap.com
1 parent 0734a58 commit 1e1d3c5

File tree

8 files changed

+37
-23
lines changed

8 files changed

+37
-23
lines changed

charts/init-agent/templates/configcluster/crds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.configCluster.crds.create }}
1+
{{- if and (has "configcluster" .Values.targets) .Values.configCluster.crds.create }}
22
apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:

charts/init-agent/templates/configcluster/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if eq .Values.target "configcluster" }}
1+
{{- if has "configcluster" .Values.targets }}
22
{{- if .Values.leaderElection.enabled }}
33
apiVersion: rbac.authorization.k8s.io/v1
44
kind: Role

charts/init-agent/templates/host/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if eq .Values.target "" }}
1+
{{- if or (not .Values.targets) (has "host" .Values.targets) }}
22
apiVersion: v1
33
kind: ServiceAccount
44
metadata:

charts/init-agent/templates/wstcluster/rbac.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if eq .Values.target "wstcluster" }}
1+
{{- if has "wstcluster" .Values.targets }}
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRole
44
metadata:
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kcpKubeconfig: kcp-kubeconfig
2+
configWorkspace: root:init-agent
3+
targets:
4+
- host
5+
- configcluster
6+
- wstcluster
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
kcpKubeconfig: kcp-kubeconfig
22
configWorkspace: root:init-agent
3-
target: configcluster
3+
targets:
4+
- configcluster
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
kcpKubeconfig: kcp-kubeconfig
22
configWorkspace: root:init-agent
3-
target: wstcluster
3+
targets:
4+
- wstcluster

charts/init-agent/values.yaml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
#
22
# Welcome to the kcp Init Agent!
33
#
4-
# This Helm chart can be rendered in 3 different variations:
4+
# This Helm chart can be rendered in 3 different variations, controlled by the
5+
# "targets" list:
56
#
6-
# * By default, it will output a Deployment and necessary auxiliary resources
7-
# to *run* the init-agent in Kubernetes. Use this to "install" the agent.
8-
# For this, configure Helm with a kubeconfig that points to the hosting
9-
# Kubernetes cluster.
10-
# * By setting "target=configcluster", the chart will output the Init Agent
11-
# CRDs, suitable to bootstrap a kcp workspace to create InitTargets and
12-
# InitTemplates in kcp, plus the necessary RBAC for it.
7+
# * By default (targets is empty) or by including "host" in targets, it will
8+
# output a Deployment and necessary auxiliary resources to *run* the
9+
# init-agent in Kubernetes. Use this to "install" the agent. For this,
10+
# configure Helm with a kubeconfig that points to the hosting Kubernetes
11+
# cluster.
12+
# * By including "configcluster" in targets, the chart will output the Init
13+
# Agent CRDs, suitable to bootstrap a kcp workspace to create InitTargets
14+
# and InitTemplates in kcp, plus the necessary RBAC for it.
1315
# For this, Helm needs to be configured with a kubeconfig that points to
1416
# the desired config workspace.
15-
# * By setting "target=wstcluster", the chart will only output the necessary
16-
# RBAC to allow the agent to access WorkspaceTypes and to initialize them
17-
# in a single workspace. This variation has to be installed in each workspace
18-
# for which InitTargets are configured in the configWorkspace.
19-
# For this, Helm needs to be configured with a kubeconfig that points to
20-
# the desired workspace.
17+
# * By including "wstcluster" in targets, the chart will only output the
18+
# necessary RBAC to allow the agent to access WorkspaceTypes and to
19+
# initialize them in a single workspace. This variation has to be installed
20+
# in each workspace for which InitTargets are configured in the
21+
# configWorkspace. For this, Helm needs to be configured with a kubeconfig
22+
# that points to the desired workspace.
23+
#
24+
# Multiple targets can be combined (e.g. ["configcluster", "wstcluster"]) to
25+
# output manifests for several targets at once.
2126
#
2227
# All three modes must be installed for the init-agent to function correctly.
2328
#
@@ -28,9 +33,10 @@ leaderElection:
2833
enabled: true
2934
namespace: kcp-init-agent
3035

31-
# Required: set to "" (default, hosting cluster), "configcluster" or "wstcluster"
32-
# (see comment above) to output the correct manifests for each Kubernetes endpoint.
33-
target: ""
36+
# Set to one or more of "host", "configcluster" and "wstcluster" (see comment
37+
# above) to output the correct manifests for each Kubernetes endpoint. Leave
38+
# empty (default) to output the hosting cluster manifests (Deployment etc.).
39+
targets: []
3440

3541
# Configuration exclusively for all the clusters (workspaces) in which the
3642
# init-agent is meant to read and initialize WorkspaceTypes in. The chart needs

0 commit comments

Comments
 (0)