manifest-capturer

command module
v0.0.0-...-0163430 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

README

manifest-capturer

test

Why to use manifest-capturer

If you use managed kubernetes service such as EKS/GKE/AKE, you will find that your worker nodes have some managed resources such as coredns.

Most people manage all of their resources as IaC declaretive manifests, but to extend such managed resources, you need to edit these resources directly through the Kubernetes API.

The main motivation for manifest-capturer is to manage managed resources independently from an IaC perspective.

You can specify a target managed resource in the Capturer CR, and manifest-capturer will capture changes for that resource.

The captured change will be delivered to the destination specified in the Output CR (typically GitHub), and kept as a snapshot.

If the managed resource change has an unintended effect, you can use snapshots to investigate and recover from the failure.

Quickstart

$ minikube start

# register CRD on schema
$ make install

# deploy sample CRs on your cluster (ConfigMap)
## capturer
$ kubectl apply -f config/samples/capturer_v1alpha1_output/configmap_capturer.yaml -n kube-system

## output for github
$ YOURNAME=yourname
$ REPONAME=reponame
$ YOUREMAIL=youremail@example.com
$ eval echo "\"$(cat <<$EOF
$(<config/samples/capturer_v1alpha1_output/configmap_github_output.yaml)
$EOF
)\"" > configmap_github_output.yaml
$ kubectl apply -f configmap_github_output.yaml -n kube-system

## output for slack
$ SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxxxx/yyyyy
$ eval echo "\"$(cat <<$EOF
$(<config/samples/capturer_v1alpha1_output/configmap_slack_output.yaml)
$EOF
)\"" > configmap_slack_output.yaml
$ kubectl apply -f configmap_slack_output.yaml -n kube-system

# need github output authentication
$ export GITHUB_ACCESS_TOKEN=xxxxx

# run manifest-capturer controller
$ make run ENABLE_WEBHOOKS=false

# edit ConfigMap
$ kubectl edit cm coredns -n kube-system

Supported

Resource to be captured
  • ClusterRole
  • ClusterRoleBinding
  • ConfigMap
  • Deployment
  • Secret
  • Service
  • ServiceAccount
Destination to be published
  • GitHub
  • Slack

Examples

Check out the config/sample directory to see some examples

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
apis
capturer/v1alpha1
Package v1alpha1 contains API Schema definitions for the capturer v1alpha1 API group +kubebuilder:object:generate=true +groupName=capturer.stable.example.com
Package v1alpha1 contains API Schema definitions for the capturer v1alpha1 API group +kubebuilder:object:generate=true +groupName=capturer.stable.example.com

Jump to

Keyboard shortcuts

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