Giter VIP home page Giter VIP logo

helm3-repair-plugin's Introduction

Helm 3 Repair Plugin

The repair plugin repairs Helm releases whose resources have been changed outside of Helm. It performs a three-way merge to restore Helm-defined values.

Installation

go get -d https://github.com/joelanford/helm3-repair-plugin
cd $GOPATH/src/github.com/joelanford/helm3-repair-plugin
make
helm plugin install .

Example

## Create an example chart
$ helm create my-chart
Creating my-chart

## Install a release
$ helm install example my-chart
NAME: example
LAST DEPLOYED: 2019-08-23 22:12:58.621967 -0400 EDT m=+0.123583973
NAMESPACE: default
STATUS: deployed

NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods -l "app=my-chart,release=example" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80

## Check the number of replicas in the release deployment
$ kubectl get deployments.apps example-my-chart -o jsonpath={.spec.replicas}
1

## Change the number of replicas in the release deployment
$ kubectl patch deployments.apps example-my-chart -p '{"spec":{"replicas":3}}'
deployment.apps/example-my-chart patched

## Repair the release
$ helm repair example
--- apps.v1beta2.Deployment.default.example-my-chart (current)
+++ apps.v1beta2.Deployment.default.example-my-chart (target)
@@ -4,7 +4,7 @@
   annotations:
     deployment.kubernetes.io/revision: "1"
   creationTimestamp: "2019-09-04T17:56:35Z"
-  generation: 2
+  generation: 3
   labels:
     app.kubernetes.io/instance: example
     app.kubernetes.io/managed-by: Helm
@@ -13,12 +13,12 @@
     helm.sh/chart: my-chart-0.1.0
   name: example-my-chart
   namespace: default
-  resourceVersion: "1508776"
+  resourceVersion: "1508785"
   selfLink: /apis/apps/v1beta2/namespaces/default/deployments/example-my-chart
   uid: 56414197-cf3d-11e9-bdc6-049226c40916
 spec:
   progressDeadlineSeconds: 600
-  replicas: 3
+  replicas: 1
   revisionHistoryLimit: 10
   selector:
     matchLabels:

release "example" repaired

## Check that the number of replicas have been reset
$ kubectl get deployments.apps example-my-chart -o jsonpath={.spec.replicas}
1

## See that the release revision is still 1
$ helm list
NAME   	NAMESPACE	REVISION	UPDATED                             	STATUS  	CHART
example	default  	1       	2019-08-23 22:12:58.621967 -0400 EDT	deployed	my-chart-0.1.0

helm3-repair-plugin's People

Contributors

joelanford avatar

Stargazers

Konrad B avatar Tolleiv Nietsch avatar Eric Bailey avatar

Watchers

 avatar James Cloos avatar  avatar

helm3-repair-plugin's Issues

Helm Repair is not working

When i am try running helm repair command it is throwing error even after following the sequence specified in instructions Error: no revision for release "example"
Error: plugin "repair" exited with error

image
@joelanford

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.