Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Commit

Permalink
Readme example consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
szibis committed Jul 12, 2017
1 parent da42d40 commit 6154824
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,44 +97,44 @@ Any of this command have its own help

##### Decrypt
```
$ helm secrets dec example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
Decrypting example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
$ helm secrets dec example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
Decrypting example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
```
As the output you will get example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml.dec with decrypted secrets inside
As the output you will get example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml.dec with decrypted secrets inside
```
secret_production_projectx: secret_foo_123
secret_sandbox_projectx: secret_foo_123
```
##### Encrypt
Decrypt
```
$ helm secrets dec example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
Decrypting example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
$ helm secrets dec example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
Decrypting example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
```
Now encrypt
```
$ helm secrets enc example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
Encrypting example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
Encrypted example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
$ helm secrets enc example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
Encrypting example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
Encrypted example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
```
##### View
With this option you will get decrypted file on stdout
```
$ helm secrets view example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
secret_production_projectx: secret_foo_123
$ helm secrets view example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
secret_sandbox_projectx: secret_foo_123
```
##### Edit
Currently will open vim with decrypted data from secret and on save will encrypt file with new edited data. If you quit without any modification no changes will be saved.
```
$ helm secrets edit example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml
$ helm secrets edit example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml
```
There is new feature in SOPS master that allows using $EDITOR to spcify editor used by sops but not released yet.

##### Clean

Now clean dec file after manual decrypt
```
$ helm secrets clean example/helm_vars/projectX/production/us-east-1/java-app/
example/helm_vars/projectX/production/us-east-1/java-app/secrets.yaml.dec
$ helm secrets clean example/helm_vars/projectX/sandbox/us-east-1/java-app/
example/helm_vars/projectX/sandbox/us-east-1/java-app/secrets.yaml.dec
```
If you use git there is commit hook that prevents commiting decrypted files and youo can add all *.dec files in you charts project ```.gitignore``` file.

Expand Down Expand Up @@ -211,7 +211,7 @@ Everything is described in SOPS docs - links in this project description.
Running helm to install/upgrade chart with our secret files is simple with helm-wrapper which will decrypt on-the-fly and use decrypted secret files specified by us.
Real example of helm-wrapper usage with simple java helloworld application.
```
AWS_PROFILE=production helm-secrets upgrade --install --timeout 600 --wait helloworld stable/java-app --kube-context=production --namespace=projectx --set global.app_version=bff8fc4 -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/secrets.yaml -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/values.yaml -f helm_vars/secrets.yaml -f helm_vars/values.yaml
AWS_PROFILE=sandbox helm-secrets upgrade --install --timeout 600 --wait helloworld stable/java-app --kube-context=sandbox --namespace=projectx --set global.app_version=bff8fc4 -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/secrets.yaml -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/values.yaml -f helm_vars/secrets.yaml -f helm_vars/values.yaml
>>>>>> Decrypt
Decrypting helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/secrets.yaml
>>>>>> Decrypt
Expand Down Expand Up @@ -250,7 +250,7 @@ You can see that we use global secret file and specific for this app in this pro

Even when helm failed then decrypted files are cleaned
```
AWS_PROFILE=production helm-wrapper upgrade --install --timeout 600 --wait helloworld stable/java-app --kube-context=wrongcontext --namespace=projectx --set global.app_version=bff8fc4 -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/secrets.yaml -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/values.yaml -f helm_vars/secrets.yaml -f helm_vars/values.yaml
AWS_PROFILE=sandbox helm-wrapper upgrade --install --timeout 600 --wait helloworld stable/java-app --kube-context=wrongcontext --namespace=projectx --set global.app_version=bff8fc4 -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/secrets.yaml -f helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/values.yaml -f helm_vars/secrets.yaml -f helm_vars/values.yaml
>>>>>> Decrypt
Decrypting helm_vars/projectx/sandbox/us-east-1/java-app/helloworld/secrets.yaml
>>>>>> Decrypt
Expand Down

0 comments on commit 6154824

Please sign in to comment.