Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/orange-cloudavenue/k8-env
A Kubernetes mutating webhook server that implements environnement variable injection
https://github.com/orange-cloudavenue/k8-env
Last synced: 19 days ago
JSON representation
A Kubernetes mutating webhook server that implements environnement variable injection
- Host: GitHub
- URL: https://github.com/orange-cloudavenue/k8-env
- Owner: orange-cloudavenue
- License: apache-2.0
- Created: 2024-02-12T21:22:04.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-14T09:14:39.000Z (12 months ago)
- Last Synced: 2024-11-17T13:26:16.203Z (3 months ago)
- Language: Go
- Size: 43 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# k8-env
A Kubernetes mutating webhook server that implements environnement variable injection.
## Prerequisites
A Kubernetes cluster (v1.19+) with the `admissionregistration.k8s.io/v1beta1` API enabled.
Verify that by the following command :```bash
kubectl api-versions | grep admissionregistration.k8s.io
```## How to use
### 1. Create a `namespace`
Create a `namespace` with the label `env-injection: true` :
```yaml
apiVersion: v1
kind: Namespace
metadata:
name: my-namespace
labels:
env-injection: true
```### 2. Create kustomization configuration
Change the `namespace` or create a `k8-env` namespace and create a `kustomization.yaml` file :
```bash
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: k8-env
resources:
- https://raw.githubusercontent.com/orange-cloudavenue/k8-env/v0.1.0/manifests/manifests.yamlimages:
- name: k8-env
newName: ghcr.io/orange-cloudavenue/k8-env
newTag: v0.1.0configMapGenerator:
- name: k8-env
behavior: replace
files:
- envconfig.yaml```
### 3. Create a `envconfig.yaml` file
Create a `envconfig.yaml` with the environment variables to inject :
```yaml
env:
- name: ENV_VAR_1
value: "value1"
- name: ENV_VAR_2
value: "value2"
```