binding

module
v0.0.0-...-750f79a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2022 License: Apache-2.0

README

Overview

Kyma Binding is a component that allows you to inject values from a Secret or ConfigMap to the resources such as Deployment, which have a Pod template underneath.

Prerequisites

  • Helm in version 3.0 or higher
  • Kubernetes in version 1.16 or higher

Installation

To install the Kyma Binding component on your cluster, run:

helm install binding ./charts/binding --wait

Walkthrough

Go through the short tutorial that presents the useage and capabilities of the component.

  1. Register a TargetKind. It's a resource that defines how and where environments can be injected.
kubectl apply -f ./examples/target-kind-deployment.yaml
  1. Check if the TargetKind is registered properly:
kubectl get targetkinds.bindings.kyma-project.io
  1. Create a Deployment into which environments will be injected:
kubectl apply -f ./examples/deployment.yaml
  1. Port-forward the Pod when it's ready:
kubectl port-forward svc/env-sample 8080:8080
  1. Check the browser on http://localhost:8080. You can see that there are no environments injected.

  2. Create a Secret:

kubectl create secret generic secret-with-credentials --from-literal=APP_PASSWORD='super_secret_password' --from-literal=APP_TOKEN='token_to_app'
  1. When the Secret is ready, create a Binding that injects data from the Secret to the Pod:
kubectl apply -f ./examples/secret-binding.yaml
  1. Check again the browser. Environments are now injected under the Password and Token keys.

  2. You can also inject environments from a ConfigMap. To check this out, create a ConfigMap and a Binding that injects parameters to our Pod:

kubectl apply -f ./examples/config-map.yaml
kubectl apply -f ./examples/config-map-binding.yaml
  1. Check the browser on http://localhost:8080. There are three environments injected.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL