cluster-preset

command module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 11 Imported by: 0

README

ClusterPreset

ClusterPreset is a Kubernetes admission controller that injects common environment variables, volumes, and volume mounts into all pods running in the cluster. It functions similar to PodPresets except that is not limited to a single namespace. Unlike other solutions that exist, ClusterPresets do not require pods to be labeled for data injection.

Status

This is currently an alpha project. Ideally, we want to help contribute this functionality upstream. While we work with the community on driving a canonical solution forward, we've open sourced the one we're using.

GitHub Build Status Image Layers Image Version

Getting Started

The current set of Kubernetes configurations requires use of cert-manager. cert-manager is used to mint and issue TLS certificates using custom resource definitions. Installing the system is pretty easy.

$ kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v0.8.0/cert-manager.yaml

Once the system is up and running, you'll be able to spin up cluster-preset pretty quickly. First, let's apply the default configuration to get things up and running.

$ kubectl apply -f https://raw.githubusercontent.com/indeedeng/cluster-preset/master/k8s/certificate.yaml
$ kubectl apply -f https://raw.githubusercontent.com/indeedeng/cluster-preset/master/k8s/manifest.yaml
$ kubectl apply -f https://raw.githubusercontent.com/indeedeng/cluster-preset/master/k8s/webhook.yaml

Once everything is up and running, you can quickly test out the defaults:

$ kubectl run -it --rm --restart=Never alpine --image=alpine -- echo "${CLUSTER}"
us-west-1

$ kubectl run -it --rm --restart=Never alpine --image=alpine -- echo "${STAGING_LEVEL}"
production

From there, you can update the ConfigMap used by the cluster-preset.

$ cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ConfigMap
metadata:
  name: cluster-presets-config
  namespace: kube-system
  labels:
    app: cluster-presets
data:
  presets.yaml: |
    env:
    - name: YOUR_VARIABLE
      value: your_value
    - name: YOUR_VARIABLE
      value: your_value
EOF

Once you've updated the config map, it can take up to a minute for the configuration to be reloaded. This can be configured to be a smaller interval with the --reload <Duration> option.

Contributing

See our Contributing guide for how you can help contribute to this project!

Contact Us

Current project code owners:

We are working on providing a channel for communication. In the meantime, open a ticket, watch, or star the repository.

Code of Conduct

ClusterPreset is governed by the Contributor Covenant v1.4.1.

License

ClusterPreset is licensed under the wMIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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