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

[draft] Laas helm chart #221

Draft
wants to merge 32 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
26ed639
first version
reshnm Sep 14, 2023
7448a79
update
reshnm Sep 15, 2023
973b200
add helm deployer
reshnm Sep 18, 2023
8221d93
add manifest deployer
reshnm Sep 18, 2023
979f0e9
add container-deployer
reshnm Sep 18, 2023
45da2f1
add new helm charts
reshnm Sep 18, 2023
8fbb421
update deploy items
reshnm Sep 19, 2023
f8176b8
run-int-tests
reshnm Sep 19, 2023
9bf1ee5
fixes (run-int-tests)
reshnm Sep 19, 2023
82fd94f
fix chart repo (run-int-tests)
reshnm Sep 19, 2023
b687b97
fix charts name (run-int-tests)
reshnm Sep 19, 2023
e1776ba
fix imports (run-int-tests)
reshnm Sep 19, 2023
70491c5
fix (run-int-tests)
reshnm Sep 20, 2023
50d3117
fix configs (run-int-tests)
reshnm Sep 20, 2023
ce93648
create version
reshnm Sep 21, 2023
04f2141
fix config types
reshnm Sep 21, 2023
1221100
update rbac
reshnm Sep 21, 2023
4e5e614
fix roles
reshnm Sep 21, 2023
7237924
fix rbac again
reshnm Sep 21, 2023
37d17dc
configure container deployer image s correctly
reshnm Sep 21, 2023
a057c7c
update rbac
reshnm Sep 21, 2023
15a48fa
add clusterrole for container-deployer
reshnm Sep 22, 2023
7222f48
fix templating error
reshnm Sep 22, 2023
5859fea
fix
reshnm Sep 22, 2023
9a64448
fix
reshnm Sep 22, 2023
885b4c9
add namespace option
reshnm Sep 22, 2023
aca6601
updated charts
reshnm Sep 26, 2023
cb442a4
test hpa
reshnm Sep 26, 2023
409adf4
Revert "test hpa"
reshnm Sep 26, 2023
b0317b2
add render script
reshnm Sep 28, 2023
ba74987
add landscaper component reference dynamically
reshnm Sep 29, 2023
d8cb7ab
update
reshnm Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .ci/publish-helm-charts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,15 @@ ${SOURCE_PATH}/hack/update-helm-chart-version.sh
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-service
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-service-target-shoot-sidecar-server
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/sidecar-rbac

CHART_REPO="eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/resource-cluster"

$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-instance/resource-cluster/landscaper
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-instance/resource-cluster/deployer

CHART_REPO="eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/target-cluster"

$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-instance/target-cluster/landscaper
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-instance/target-cluster/helm-deployer
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-instance/target-cluster/manifest-deployer
$SOURCE_PATH/hack/create-helm-chart.sh ${CHART_REPO} charts/landscaper-instance/target-cluster/container-deployer
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ imports:
dataRef: landscaperControllerKubeconfigYaml
- name: landscaperWebhooksKubeconfigYaml
dataRef: landscaperWebhooksKubeconfigYaml
- name: landscaperDeployerKubeconfigYaml
dataRef: landscaperDeployerKubeconfigYaml
- name: registryConfig
dataRef: registryConfig
- name: landscaperConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ exports:
dataRef: landscaperWebhooksKubeconfigYaml
- name: landscaperUserKubeconfigYaml
dataRef: landscaperUserKubeconfigYaml
- name: landscaperDeployerKubeconfigYaml
dataRef: landscaperDeployerKubeconfigYaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ imports:
schema:
type: string

- name: landscaperDeployerKubeconfigYaml
required: true
type: data
schema:
type: string

- name: registryConfig
type: data
schema:
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ exports:
schema:
type: string

- name: landscaperDeployerKubeconfigYaml
type: data
schema:
type: string

exportExecutions:
- name: export-execution
file: /export-execution.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,38 @@ deployItems:
createNamespace: true

chart:
{{ $landscaperComponent := getComponent .cd "name" "landscaper" }}
{{ $resource := getResource $landscaperComponent "name" "landscaper-controller-rbac-chart" }}
{{ $resource := getResource .cd "name" "landscaper-instance-resource-cluster-landscaper" }}
ref: {{ $resource.access.imageReference }}

values:
global:
serviceAccount:
controller:
create: true
annotations: {}
name: landscaper-controller
controller:
serviceAccountName: "landscaper-controller"
clusterRoleName: "landscaper.gardener.cloud:controller"

webhooksServer:
create: true
annotations: {}
name: landscaper-webhooks
webhooksServer:
serviceAccountName: "landscaper-webhooks"
clusterRoleName: "landscaper.gardener.cloud:webhooks-server"

user:
create: true
annotations: {}
name: landscaper-user
user:
serviceAccountName: "landscaper-user"
clusterRoleName: "landscaper.gardener.cloud:user"

- name: deployer-rbac
type: landscaper.gardener.cloud/helm
target:
import: shootCluster
config:
apiVersion: helm.deployer.landscaper.gardener.cloud/v1alpha1
kind: ProviderConfiguration
updateStrategy: patch
name: deployer-rbac
namespace: {{ .imports.targetClusterNamespace }}
createNamespace: true

chart:
{{ $resource := getResource .cd "name" "landscaper-instance-resource-cluster-deployer" }}
ref: {{ $resource.access.imageReference }}

values:
serviceAccountName: "landscaper-deployer"
clusterRoleName: "landscaper.gardener.cloud:deployer"
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ exports:

landscaperUserKubeconfigYaml: |
{{- getOidcKubeconfig .imports.shootConfig.kubernetes.kubeAPIServer.oidcConfig.issuerURL .imports.shootConfig.kubernetes.kubeAPIServer.oidcConfig.clientID .imports.shootCluster | b64dec | nindent 4 }}

landscaperDeployerKubeconfigYaml: |
{{- getServiceAccountKubeconfig "landscaper-deployer" .imports.targetClusterNamespace .imports.rotationConfig.tokenExpirationSeconds .imports.shootCluster | b64dec | nindent 4 }}
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,6 @@ imports:
- user
- password

- name: subaccountId
required: false
type: data
schema:
type: string

- name: rotationConfig
type: data
schema:
Expand Down
48 changes: 48 additions & 0 deletions .landscaper/landscaper-instance/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,54 @@ access:
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/sidecar-rbac:${VERSION}
...
---
type: helm.io/chart
name: landscaper-instance-resource-cluster-landscaper
relation: local
access:
type: ociRegistry
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/resource-cluster/landscaper:${VERSION}
...
---
type: helm.io/chart
name: landscaper-instance-resource-cluster-deployer
relation: local
access:
type: ociRegistry
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/resource-cluster/deployer:${VERSION}
...
---
type: helm.io/chart
name: landscaper-instance-target-cluster-landscaper
relation: local
access:
type: ociRegistry
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/target-cluster/landscaper:${VERSION}
...
---
type: helm.io/chart
name: landscaper-instance-target-cluster-helm-deployer
relation: local
access:
type: ociRegistry
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/target-cluster/helm-deployer:${VERSION}
...
---
type: helm.io/chart
name: landscaper-instance-target-cluster-manifest-deployer
relation: local
access:
type: ociRegistry
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/target-cluster/manifest-deployer:${VERSION}
...
---
type: helm.io/chart
name: landscaper-instance-target-cluster-container-deployer
relation: local
access:
type: ociRegistry
imageReference: eu.gcr.io/gardener-project/landscaper-service/charts/landscaper-instance/target-cluster/container-deployer:${VERSION}
...
---
type: ociImage
name: ls-service-target-shoot-sidecar-image
relation: local
Expand Down
13 changes: 13 additions & 0 deletions .landscaper/landscaper-instance/test/component-descriptor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
component:
componentReferences: []
name: github.com/gardener/landscaper-service/landscaper-instance
provider: internal
repositoryContexts:
- baseUrl: eu.gcr.io/gardener-project/development
componentNameMapping: urlPath
type: ociRegistry
resources: []
sources: []
version: v0.1.0
meta:
schemaVersion: v2
49 changes: 49 additions & 0 deletions .landscaper/landscaper-instance/test/export-templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
installations:
- name: shoot
selector: .*/shoot-cluster
template: |
dataExports:
shootClusterKubeconfig: |
apiVersion: v1
kind: Config
shootClusterEndpoint: test-shoot.api.mycluster.net
targetExports:
shootCluster:
metadata:
name: shoot-cluster
namespace: default
spec:
type: landscaper.gardener.cloud/kubernetes-cluster
config:
kubeconfig: |
apiVersion: v1
kind: Config

- name: landscaper-rbac
selector: .*/landscaper-rbac
template: |
dataExports:
landscaperControllerKubeconfigYaml: |
apiVersion: v1
kind: Config
landscaperWebhooksKubeconfigYaml: |
apiVersion: v1
kind: Config
landscaperUserKubeconfigYaml: |
apiVersion: v1
kind: Config
landscaperDeployerKubeconfigYaml: |
apiVersion: v1
kind: Config
targetExports: {}

- name: sidecar-rbac
selector: .*/sidecar-rbac
template: |
dataExports:
sidecarControllerKubeconfigYaml: |
apiVersion: v1
kind: Config
targetExports: {}

deployItems: []
44 changes: 44 additions & 0 deletions .landscaper/landscaper-instance/test/render.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash

TEST_DIR="$(dirname $0)"
BASE_DIR="$(dirname $0)/.."

RENDER_TMP_DIR="$(mktemp -d)"
RESOURCES_FILE="${RENDER_TMP_DIR}/resources.yaml"
COMPONENT_DESCRIPTOR_FILE="${RENDER_TMP_DIR}/test/component-descriptor.yaml"

cp -R "${BASE_DIR}/." "${RENDER_TMP_DIR}"
export VERSION=v0.1.0
envsubst <"${BASE_DIR}/resources.yaml" >"${RESOURCES_FILE}"

LANDSCAPER_COMPONENT_REF="$(yq ./.landscaper/landscaper-instance/component-references.yaml -ojson -I=0)"
yq ".component.componentReferences += [${LANDSCAPER_COMPONENT_REF}]" "${TEST_DIR}/component-descriptor.yaml" > "${COMPONENT_DESCRIPTOR_FILE}"

# render global installation blueprint
echo "!!! render global installation blueprint !!!"
landscaper-cli blueprints render ${BASE_DIR}/blueprint/installation \
-c "${COMPONENT_DESCRIPTOR_FILE}" \
-f "${TEST_DIR}/values-global.yaml" \
-e "${TEST_DIR}/export-templates.yaml" \
-r "${RESOURCES_FILE}"

# render shoot blueprint
echo "!!! render shoot blueprint !!!"
landscaper-cli blueprints render ${BASE_DIR}/blueprint/shoot \
-c "${COMPONENT_DESCRIPTOR_FILE}" \
-f "${TEST_DIR}/values-shoot.yaml" \
-r "${RESOURCES_FILE}"

# render shoot blueprint
echo "!!! render landscaper rbac blueprint !!!"
landscaper-cli blueprints render ${BASE_DIR}/blueprint/rbac \
-c "${COMPONENT_DESCRIPTOR_FILE}" \
-f "${TEST_DIR}/values-rbac.yaml" \
-r "${RESOURCES_FILE}"

# render shoot blueprint
echo "!!! render sidecar rbac blueprint !!!"
landscaper-cli blueprints render ${BASE_DIR}/blueprint/rbac \
-c "${COMPONENT_DESCRIPTOR_FILE}" \
-f "${TEST_DIR}/values-sidecar-rbac.yaml" \
-r "${RESOURCES_FILE}"
Loading