86 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			86 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
This chart is supposed to be a better alternative to all the GitOps helm managers out there.
 | 
						|
 | 
						|
It should follow the real helm workflow instead of trying to find some workaround.
 | 
						|
 | 
						|
The idea is that I need to create a helm release 
 | 
						|
 | 
						|
```
 | 
						|
kind: HelmRelease
 | 
						|
metadata: 
 | 
						|
  name: test
 | 
						|
spec:
 | 
						|
  repository: https://somerepo
 | 
						|
  chart: somechart
 | 
						|
  version: someversion
 | 
						|
```
 | 
						|
 | 
						|
And the controller is supposed to pull the chart and install it to the cluster
 | 
						|
 | 
						|
In order to make ic configurable, I need to add CRDs for handling values, like
 | 
						|
 | 
						|
```
 | 
						|
kind: HelmValues
 | 
						|
metadata:
 | 
						|
  name: test-values
 | 
						|
data:
 | 
						|
  image:
 | 
						|
    tag: latest
 | 
						|
```
 | 
						|
 | 
						|
These values should be added to the helm release
 | 
						|
 | 
						|
```
 | 
						|
kind: HelmRelease
 | 
						|
metadata:
 | 
						|
  name: test
 | 
						|
spec:
 | 
						|
  repository: https://somerepo
 | 
						|
  chart: somechart
 | 
						|
  version: someversion
 | 
						|
  values:
 | 
						|
    - test-values
 | 
						|
```
 | 
						|
 | 
						|
After syncing, the values hashsum should be put to the status like
 | 
						|
 | 
						|
```
 | 
						|
kind: HelmRelease
 | 
						|
status:
 | 
						|
  values:
 | 
						|
    test-values: SHA
 | 
						|
```
 | 
						|
 | 
						|
To make sure that we are updating the chart every time, values are updated
 | 
						|
 | 
						|
The next CRD that should be a part of any reliable helm workflow is the diff
 | 
						|
 | 
						|
```
 | 
						|
kind: HelmDiff
 | 
						|
metadata:
 | 
						|
  name: test
 | 
						|
spec:
 | 
						|
  release: test
 | 
						|
  context: 5
 | 
						|
  values:
 | 
						|
    - test-values-SHA # these should be added in the cluster with a different name
 | 
						|
```
 | 
						|
 | 
						|
It should provide a diff and put it to the staus in a base64 format (or maybe to secrets)
 | 
						|
 | 
						|
After this is working, the next step would be adding support for secrets via SOPS
 | 
						|
 | 
						|
```
 | 
						|
kind: HelmValues
 | 
						|
metadata
 | 
						|
  name: test
 | 
						|
spec: 
 | 
						|
  secret: true
 | 
						|
  sopsSec:
 | 
						|
    name: sops-secret
 | 
						|
    key: .sops.yaml
 | 
						|
  templating: 
 | 
						|
    enabled: false
 | 
						|
data:
 | 
						|
  # Encrypted data
 | 
						|
```
 |