GithubHelp home page GithubHelp logo

isabella232 / trait-injector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oam-dev/trait-injector

0.0 0.0 0.0 395 KB

Injector trait as a webhook to inject data into Workload.

License: Apache License 2.0

Shell 11.22% Go 78.98% Makefile 5.53% Smarty 2.67% Dockerfile 1.60%

trait-injector's Introduction

Trait Injector

Trait injector is a k8s admission webhook to inject data into workload.

How it works with AppConfig controller:

alt text

Build

make generate
make manifests
make

Test

make test

SSL

the ssl/ dir contains a script to create a self-signed certificate, not sure this will even work when running in k8s but that's part of figuring this out I guess

NOTE: the app expects the cert/key to be in ssl/ dir relative to where the app is running/started and currently is hardcoded to mutateme.{key,pem}

pushd ssl/
make
popd

Docker

make docker-build

Quickstart

Gererate SSL certs if haven't done yet:

pushd ssl/
make
popd

Replace caBundle field value in example/manager.yaml with the data from below:

kubectl config view --raw --minify --flatten -o jsonpath='{.clusters[].cluster.certificate-authority-data}'

Deploy to Minikube:

make minikube

Inject Deployment

Create ServiceBinding:

kubectl create -f ./example/servicebinding.yaml

Create the Deployment whose env to inject secret to, and also the Secret:

kubectl create -f ./example/test-deploy.yaml

Verify the envFrom field of the Deployment updated:

kubectl get deploy busybox1 -o json | jq -r '.spec.template.spec.containers[0]'

alt text

Inject StatefulSet

Create ServiceBinding for StatefulSet example:

kubectl create -f ./example/statefulSet/binding.yaml

Create the StatefulSet whose env to inject secret to, and also the Secret:

kubectl create -f ./example/statefulSet/statefulset.yaml

Verify the envFrom field of the Deployment updated:

kubectl get statefulset busybox1 -o json | jq -r '.spec.template.spec.containers[0]'

trait-injector's People

Contributors

hongchaodeng avatar wonderflow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.