Package: cdk8s-flux
cdk8s-fluxManage your kubernetes cluster in a GitOps fashion withFlux, construct library forcdk8s project🚀Overviewcdk8s-fluxis acdk8slibrary which allows you to deploy define a installation of a Flux daemon in your kubernetes cluster with just a few lines of code.
This could be used as an alternative to theFlux Helm Chartor thefluxctl installcommand.# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826Flux(self,"flux",ns="flux",name="flux",image="fluxcd/flux",tag="1.19.0",replicas=1,arguments=["--memcached-service=","--ssh-keygen-dir=/etc/fluxd/keygen","--git-url=git@github.com:rafaribe/cdk8s-k3s-gitops.git","--git-branch=master","--git-path=cluster","--git-label=flux","--git-user=flux","--git-email=flux@rafaribe.com","--git-poll-interval=5m","--sync-garbage-collection"])flux.k8s.yamlapiVersion:v1kind:Namespacemetadata:labels:name:fluxname:flux---apiVersion:v1kind:ServiceAccountmetadata:labels:name:fluxname:fluxnamespace:flux---apiVersion:rbac.authorization.k8s.io/v1kind:ClusterRolemetadata:labels:name:fluxname:fluxrules:-apiGroups:-"*"resources:-"*"verbs:-"*"-nonResourceURLs:-"*"verbs:-"*"---apiVersion:rbac.authorization.k8s.io/v1kind:ClusterRoleBindingmetadata:labels:name:fluxname:fluxroleRef:apiGroup:rbac.authorization.k8s.iokind:ClusterRolename:fluxsubjects:-kind:ServiceAccountname:fluxnamespace:flux---apiVersion:v1kind:Secretmetadata:name:flux-git-deploynamespace:fluxtype:Opaque---apiVersion:apps/v1kind:Deploymentmetadata:name:fluxnamespace:fluxspec:replicas:1selector:matchLabels:name:fluxstrategy:type:Recreatetemplate:metadata:labels:name:fluxspec:containers:-args:---memcached-service=---ssh-keygen-dir=/etc/fluxd/keygen---git-url=git@github.com:rafaribe/cdk8s-k3s-gitops.git---git-branch=master---git-path=cluster---git-label=flux---git-user=flux---git-email=flux@rafaribe.com---git-poll-interval=5m---sync-garbage-collectionimage:raspbernetes/flux:1.19.0imagePullPolicy:IfNotPresentlivenessProbe:httpGet:path:api/flux/v6/identity.pubport:3030initialDelaySeconds:5timeoutSeconds:5name:fluxports:-containerPort:3030readinessProbe:httpGet:path:api/flux/v6/identity.pubport:3030initialDelaySeconds:5timeoutSeconds:5resources:limits:cpu:150mmemory:256MivolumeMounts:-mountPath:/etc/fluxd/sshname:git-keyreadOnly:true-mountPath:/etc/fluxd/keygenname:git-keygenserviceAccountName:fluxvolumes:-name:git-keysecret:defaultMode:256secretName:flux-git-deploy-emptyDir:medium:Memoryname:git-keygen---apiVersion:apps/v1kind:Deploymentmetadata:name:memcachednamespace:fluxspec:replicas:1selector:matchLabels:name:memcachedtemplate:metadata:labels:name:memcachedspec:containers:-args:--m 512--I 5m--p 11211image:memcached:1.5.20name:memcachedports:-containerPort:11211name:clientssecurityContext:allowPrivilegeEscalation:falserunAsGroup:11211runAsUser:11211---apiVersion:v1kind:Servicemetadata:name:memcachednamespace:fluxspec:ports:-name:memcachedport:11211selector:name:memcachedInstallationcdk8ssupports TypeScript and Python at this point, so as cdk8s-flux.We'd recommend to walk through thecdk8s Getting Started guidebefore using this library, if you're very new to cdk8s world.TypeScriptUsenpmoryarnto install.$npminstall-scdk8s-fluxor$yarnaddcdk8s-fluxPython$pipinstallcdk8s-fluxContributionFork (https://github.com/rafaribe/cdk8s-flux/fork)Bootstrap the repo:yarninstall# installs dependenciesDevelopment scripts:CommandDescriptionyarn compileCompiles jsiiyarn watchWatch & compileyarn testRuns the jest unit testsyarn test -uUpdates jest snapshotsyarn run packageOutputs thejsiigenerated packages in TS and Pythonyarn buildCompile + Test + Packageyarn bumpBumps versionyarn releaseBump + push to masteryarn rmistDeletes node_modules and runs installs dependenciesyarn lintLint with eslinteryarn prettierRuns prettier and updates the files in placeyarn run importcdk8s imports k8s and crds into theimportsdirectoryCreate a feature branchCommit your changesRebase your local changes against the master branchCreate a new Pull Request (useconventional commitsfor the title please)LicenseApache License, Version 2.0AuthorRafael RibeiroThank you:Thank you to thedevsof the following projects, from where I got some inspiration to create this library:cdk8s-rediscdk8s-deborejsii-library-templatecdk8s