Skip to content

Latest commit

 

History

History
77 lines (58 loc) · 2.29 KB

configure-service-targets.md

File metadata and controls

77 lines (58 loc) · 2.29 KB

Configure ServiceTargetConfigs

In this Chapter we deploy a ServiceTargetConfig manifest, which defines a kubernetes cluster into which the Landscaper as a Service could deploy Landscaper instances.

Kubeconfig Secret

To create a new ServiceTargetConfig a kubernetes secret of type Opaque needs to be created. This secret needs have a key that contains the kubeconfig of the target cluster that the ServiceTargetConfig represents. The secret can be created in any namespace. It is however recommended, to create it in a namespace that is only accessible to landscaper service administrators.

apiVersion: v1
kind: Secret
metadata:
  name: default-target
  namespace: laas-system
type: Opaque
stringData:
  kubeconfig: |
    apiVersion: v1
    kind: Config
    ...
kubectl apply -f secret.yaml

ServiceTargetConfig

The secret that was just created, is then referenced in a ServiceTargetConfig. The spec.secretRef field contains the name, the namespace of the secret and the key that contains the kubeconfig. The spec.ingressDomain field has to be set to the correct url under which the ingress controller at the referenced target cluster is available. For the ingress domain field contains only the domain name, the protocol (https://) has to be omitted.

The visibility label config.landscaper-service.gardener.cloud/visible needs to be set with the value "true".

The ServiceTargetConfig can be created in any namespace. It is however recommended, to create it in a namespace that is only accessible to landscaper service administrators.

apiVersion: landscaper-service.gardener.cloud/v1alpha1
kind: ServiceTargetConfig

metadata:
  name: default
  namespace: laas-system
  labels:
    config.landscaper-service.gardener.cloud/visible: "true"

spec:
  priority: 10

  ingressDomain: ingress.mydomain.net
  
  secretRef:
    name: default-target
    namespace: laas-system
    key: kubeconfig
kubectl apply -f servicetargetconfig.yaml
kubectl -n laas-system get servicetargetconfigs.landscaper-service.gardener.cloud

NAME      VISIBLE   PRIORITY   AGE
default   true      10         1h10m