volume-watcher

command module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2021 License: MIT Imports: 6 Imported by: 0

README

Release Docker build Actions status Go Report Card License

volume-watcher

This is a Kubernetes volume watcher usable as a sidecar. The volume can be either a Secret or a ConfigMap. Once the watcher identifies a change in the volume, it sends an HTTP request to the defined endpoint.

Usage

The sidecar requires the following two environment variables to be set:

  • VOLUMEWATCHER_DIR - path to the directory where the volume is mounted
  • VOLUMEWATCHER_ENDPOINT - URL of an endpoint to call when the volume changes

The following Deployment example shows how to use it as a sidecar:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: agent
spec:
  template:
    spec:
      containers:
        # Sidecar
        - name: volume-watcher
          image: jtyr/volume-watcher:latest
          env:
            - name: VOLUMEWATCHER_DIR
              value: /etc/agent
            - name: VOLUMEWATCHER_ENDPOINT
              value: http://localhost:8080/-/reload
          volumeMounts:
            - mountPath: /etc/agent
              name: agent-config
        # Container which will be reloaded from the sidecar
        - name: agent
          ports:
            - containerPort: 8080
              name: http-metrics
          ...
          volumeMounts:
            - mountPath: /etc/agent
              name: agent-config
      volumes:
        - configMap:
            name: agent-config
          name: agent-config

License

MIT

Author

Jiri Tyr

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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