Skip to content

Latest commit

 

History

History
76 lines (45 loc) · 2.65 KB

DEVELOP.md

File metadata and controls

76 lines (45 loc) · 2.65 KB

example branch parameter License

Contributing

Code contributions are always welcome.

  • Open an issue in the repo with defect/enhancements
  • We can also be reached @ https://gitter.im/expedia-haystack/Lobby
  • Fork, make the changes, build and test it locally
  • Issue a PR- watch the PR build in deploy
  • Once merged to main, GitHub Actions will build and release the container with latest tag

Dependencies

Build and run using an IDE (JetBrains)

Run the included [go build kubernetes-sidecar-injector](.run/go build kubernetes-sidecar-injector.run.xml) Go Build job.

Build and deploy in Kubernetes

Deploy using Kubectl

To deploy and test this in kind

  • run the command
make kind-install

(To understand the command above - check the README file)

After deployment, one can check the service running by

kubectl get pods -n sidecar-injector

NAME                                           READY   STATUS    RESTARTS   AGE
kubernetes-sidecar-injector-78648d458b-7cv7l   1/1     Running   0          32m

Test the webhook

Run the following command to deploy a sample echo-server. Note, this deployment spec carries an annotation sidecar-injector.expedia.com/inject: "haystack-agent" that triggers injection of haystack-agent sidecar defined in sidecar-configmap.yaml file.

make install-sample-container

One can then run the following command to confirm the sidecar has been injected

kubectl get pod -n sample

NAME                                                        READY     STATUS             RESTARTS   AGE
echo-server-deployment-849b87649d-9x95k                     2/2       Running            0          4m

Note the 2 containers in the echo-server pod instead of one.

Clean up webhook

Run the following commands to delete and cleanup the deployed webhook

helm delete -n sidecar-injector kubernetes-sidecar-injector
helm delete -n sample sample-echo-server-sidecar-injector