Skip to content

Commit

Permalink
Flux.
Browse files Browse the repository at this point in the history
  • Loading branch information
badri committed Dec 16, 2023
1 parent c066fb1 commit 9c59927
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
8 changes: 7 additions & 1 deletion addons.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ microk8s-addons:
supported_architectures:
- arm64
- amd64
- name: "sb-flux"
description: "Flux helm controller"
version: "1.0.0"
check_status: "deployment.apps/helm-controller"
supported_architectures:
- arm64
- amd64

#TODO: kpack
#TODO: flux
#TODO: cluster issuer, clusterstore, default regcreds
#TODO: shapeblock operator
17 changes: 17 additions & 0 deletions addons/sb-flux/disable
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python3

import click
import os
import subprocess

KUBECTL = os.path.expandvars("$SNAP/microk8s-kubectl.wrapper")
HELM = os.path.expandvars("$SNAP/microk8s-helm3.wrapper")

@click.command()
def main():
click.echo("Disabling Flux helm controller")
subprocess.run([HELM, "delete", "helm-operator", "--namespace", "flux"])
click.echo("Disabled Flux helm controller")

if __name__ == "__main__":
main()
27 changes: 27 additions & 0 deletions addons/sb-flux/enable
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3

import os
import subprocess

import click

KUBECTL = os.path.expandvars("$SNAP/microk8s-kubectl.wrapper")
HELM = os.path.expandvars("$SNAP/microk8s-helm3.wrapper")
MICROK8S_STATUS = os.path.expandvars("$SNAP/microk8s-status.wrapper")
MICROK8S_ENABLE = os.path.expandvars("$SNAP/microk8s-enable.wrapper")

@click.command()
def main():
args = []
args.extend(["--set", "imageautomationcontroller.create=false"])
args.extend(["--set", "imagereflectorcontroller.create=false"])
args.extend(["--set", "kustomizecontroller.create=false"])

subprocess.run([HELM, "repo", "add", "flux",
"https://fluxcd-community.github.io/helm-charts"])
subprocess.run([HELM, "repo", "update"])
subprocess.run([HELM, "install", "helm-operator", "flux/flux2", "--create-namespace", "--namespace", "flux", *args])
click.echo("Enabled Flux helm controller")

if __name__ == "__main__":
main()

0 comments on commit 9c59927

Please sign in to comment.