diff --git a/helm/charts/crossplane-provider-sap-btp-environment/Chart.yaml b/helm/charts/crossplane-provider-sap-btp-environment/Chart.yaml index 57df492..f707074 100644 --- a/helm/charts/crossplane-provider-sap-btp-environment/Chart.yaml +++ b/helm/charts/crossplane-provider-sap-btp-environment/Chart.yaml @@ -17,7 +17,7 @@ icon: "https://avatars.githubusercontent.com/u/45158470?s=48&v=4" # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.15 +version: 0.0.16 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/helm/charts/crossplane-provider-sap-btp-environment/README.md b/helm/charts/crossplane-provider-sap-btp-environment/README.md index 75d4b8f..1102919 100644 --- a/helm/charts/crossplane-provider-sap-btp-environment/README.md +++ b/helm/charts/crossplane-provider-sap-btp-environment/README.md @@ -2,7 +2,7 @@ # crossplane-provider-sap-btp-environment -![Version: 0.0.15](https://img.shields.io/badge/Version-0.0.15-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square) +![Version: 0.0.16](https://img.shields.io/badge/Version-0.0.16-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square) A Helm Chart to template crossplane manifests to manage Cloud Foundry or BTP Kyma environments on BTP. @@ -21,6 +21,13 @@ A Helm Chart to template crossplane manifests to manage Cloud Foundry or BTP Kym | cloudFoundryEnvironments | list | object | cloudFoundryEnvironments contains configuration of [cloudfoundry Environments](https://pages.github.tools.sap/cloud-orchestration/browser/Providers/provider-btp-account/environment.btp.sap.crossplane.io/cloudfoundryenvironment/v1alpha1). | | cloudFoundryEnvironments[0] | object | `{"btpSapCrossplaneProviderConfigRefName":"","cloudManagementRef":{"name":"dev-eu01"},"forProvider":{"initialOrgManagers":[""],"landscape":""},"name":"","subaccountRef":{"name":"dev-eu01"},"writeConnectionSecretToRef":[]}` | btpSapCrossplaneProviderConfigRefName defines crossplane provider configuration reference name (identifier) of a ...! | | cloudFoundryEnvironments[0].writeConnectionSecretToRef | list | `[]` | *optional* - When a Crossplane Provider creates a managed resource it may generate resource-specific details, like usernames, passwords or connection details like an IP address. Crossplane stores these details in a Kubernetes Secret object specified by the `writeConnectionSecretToRef` values. Learn more about Crossplane concept [Managed Resources Fields](https://docs.crossplane.io/latest/concepts/managed-resources/#writeconnectionsecrettoref)! | +| kymaEnvironmentBindings[0].btpSapCrossplaneProviderConfigRefName | string | `""` | | +| kymaEnvironmentBindings[0].cloudManagementRef.name | string | `"dev-eu01"` | | +| kymaEnvironmentBindings[0].forProvider.rotationInterval | string | `"6h"` | | +| kymaEnvironmentBindings[0].forProvider.ttl | string | `"8h"` | | +| kymaEnvironmentBindings[0].kymaEnvironmentRef.name | string | `"my-kyma-instance"` | | +| kymaEnvironmentBindings[0].name | string | `""` | | +| kymaEnvironmentBindings[0].writeConnectionSecretToRef | object | `{"name":"demo-kyma-binding-local","namespace":"default"}` | *optional* - When a Crossplane Provider creates a managed resource it may generate resource-specific details, like usernames, passwords or connection details like an IP address. Crossplane stores these details in a Kubernetes Secret object specified by the `writeConnectionSecretToRef` values. Learn more about Crossplane concept [Managed Resources Fields](https://docs.crossplane.io/latest/concepts/managed-resources/#writeconnectionsecrettoref)! | | kymaEnvironments[0].btpSapCrossplaneProviderConfigRefName | string | `""` | | | kymaEnvironments[0].cloudManagementRef.name | string | `"dev-eu01"` | | | kymaEnvironments[0].forProvider.administrators[0] | string | `"...@sap.com"` | | diff --git a/helm/charts/crossplane-provider-sap-btp-environment/templates/kyma-enviornment-binding.yaml b/helm/charts/crossplane-provider-sap-btp-environment/templates/kyma-enviornment-binding.yaml new file mode 100644 index 0000000..4d0e924 --- /dev/null +++ b/helm/charts/crossplane-provider-sap-btp-environment/templates/kyma-enviornment-binding.yaml @@ -0,0 +1,25 @@ +{{- range $item := .Values.kymaEnvironmentBindings }} + {{- if and ($item) (ne $item.name "") }} +--- +apiVersion: environment.btp.sap.crossplane.io/v1alpha1 +kind: KymaEnvironmentBinding +metadata: + name: {{required "A valid value is required! (.Values.kymaEnvironmentBindings[].btpSapCrossplaneProviderConfigRefName)" $item.btpSapCrossplaneProviderConfigRefName | lower }}-{{required "A valid value is required! (.Values.kymaEnvironments[].name)" $item.name | lower }} + labels: + openmcp.cloud/blueprint-building-block: "{{ $.Chart.Name }}" + openmcp.cloud/blueprint-building-block-version: "{{ $.Chart.Version }}" +spec: + providerConfigRef: + name: {{required "A valid value is required! .Values.kymaEnvironments[].btpSapCrossplaneProviderConfigRefName)" $item.btpSapCrossplaneProviderConfigRefName }} + forProvider: + {{ required "A valid value is required! (.Values.kymaEnvironmentBindings[].forProvider)" $item.forProvider | toYaml | nindent 4 }} + cloudManagementRef: + {{ required "A valid value is required! (.Values.kymaEnvironmentBindings[].cloudManagementRef)" $item.cloudManagementRef | toYaml | nindent 4 }} + kymaEnvironmentRef: + name: {{required "A valid value is required! (.Values.kymaEnvironmentBindings[].kymaEnvironmentRef.name)" $item.kymaEnvironmentRef.name }} + {{- if $item.writeConnectionSecretToRef}} + writeConnectionSecretToRef: + {{- $item.writeConnectionSecretToRef | toYaml | nindent 4 }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helm/charts/crossplane-provider-sap-btp-environment/values.ci.yaml b/helm/charts/crossplane-provider-sap-btp-environment/values.ci.yaml index fd5f589..764bfb8 100644 --- a/helm/charts/crossplane-provider-sap-btp-environment/values.ci.yaml +++ b/helm/charts/crossplane-provider-sap-btp-environment/values.ci.yaml @@ -44,4 +44,17 @@ kymaEnvironments: writeConnectionSecretToRef: name: "demo-kyma-kubeconfig-local" namespace: "default" -######################################################################################################################## \ No newline at end of file +######################################################################################################################## +kymaEnvironmentBindings: + - btpSapCrossplaneProviderConfigRefName: "btpSapCrossplaneProviderConfigRefName" + name: "name" + kymaEnvironmentRef: + name: "my-kyma-instance" + forProvider: + rotationInterval: "6h" + ttl: "8h" + cloudManagementRef: + name: "dev-eu01" + writeConnectionSecretToRef: + name: "demo-kyma-binding-local" + namespace: "default" diff --git a/helm/charts/crossplane-provider-sap-btp-environment/values.yaml b/helm/charts/crossplane-provider-sap-btp-environment/values.yaml index aaf626a..13f590e 100644 --- a/helm/charts/crossplane-provider-sap-btp-environment/values.yaml +++ b/helm/charts/crossplane-provider-sap-btp-environment/values.yaml @@ -48,3 +48,18 @@ kymaEnvironments: name: "demo-kyma-kubeconfig-local" namespace: "default" ######################################################################################################################## +kymaEnvironmentBindings: + - btpSapCrossplaneProviderConfigRefName: "" + name: "" + kymaEnvironmentRef: + name: "my-kyma-instance" + forProvider: + rotationInterval: "6h" + ttl: "8h" + cloudManagementRef: + name: "dev-eu01" + # -- *optional* - When a Crossplane Provider creates a managed resource it may generate resource-specific details, like usernames, passwords or connection details like an IP address. + # Crossplane stores these details in a Kubernetes Secret object specified by the `writeConnectionSecretToRef` values. Learn more about Crossplane concept [Managed Resources Fields](https://docs.crossplane.io/latest/concepts/managed-resources/#writeconnectionsecrettoref)! + writeConnectionSecretToRef: + name: "demo-kyma-binding-local" + namespace: "default"