|
| 1 | +--- |
| 2 | +sidebar_position: 4 |
| 3 | +--- |
| 4 | + |
| 5 | +# Working with Helm and Flux |
| 6 | + |
| 7 | +On this page, you'll find some useful information on how to work with the commandline interfaces for [helm](https://helm.sh/) and [flux](https://fluxcd.io/) in the context of your YAKE-based Gardener installation. |
| 8 | + |
| 9 | +## Useful Helm Commands |
| 10 | + |
| 11 | +First things first. As already introduced in the [architecture description](./architecture.md), most of the YAKE helm charts stem from a helm repository hosted at `gardener.community.github.io/gardener-charts`. Consider adding this helm repository to your local repository cache by |
| 12 | + |
| 13 | +```sh |
| 14 | +helm repo add gardener-charts https://gardener-community.github.io/gardener-charts |
| 15 | +helm repo update |
| 16 | +``` |
| 17 | + |
| 18 | +Afterwards you can use get further information about the charts using the helm cli. |
| 19 | + |
| 20 | +### Show upstream chart info |
| 21 | + |
| 22 | +E.g., for the `cloudprofiles` chart: |
| 23 | + |
| 24 | +```sh |
| 25 | +helm show chart gardener-charts/cloudprofiles |
| 26 | +``` |
| 27 | + |
| 28 | +### Show upstream helm default values |
| 29 | + |
| 30 | +E.g., for the `cloudprofiles` chart: |
| 31 | + |
| 32 | +```sh |
| 33 | +helm show values gardener-charts/cloudprofiles |
| 34 | +``` |
| 35 | + |
| 36 | +## Useful Flux Commands |
| 37 | + |
| 38 | +### Check flux versions |
| 39 | + |
| 40 | +The flux controllers running in the basecluster are maintained by YAKE itself, i.e. the flux controllers will be updated with YAKE updates. You can check the state of your cli version and the version of the cluster side components by |
| 41 | + |
| 42 | +```sh |
| 43 | +flux version |
| 44 | +``` |
| 45 | + |
| 46 | +If you feel like your cli version is outdated. Go ahead and download a recent version from [the Github release page](https://github.com/fluxcd/flux2/releases). If you feel like your in-cluster components are outdated, think about updating YAKE. |
| 47 | + |
| 48 | +### Reconcile of a resource |
| 49 | + |
| 50 | +If you want to get fast feedback in your GitOps workflow you can trigger the reconciliation of resources manually using the `flux reconcile command`. If you want a `helmrelease` to be reconciled immediately, you can achieve this by the following command: |
| 51 | + |
| 52 | +```sh |
| 53 | +flux reconcile helmrelease <NAME_OF_HELMRELEASE> |
| 54 | +``` |
| 55 | + |
| 56 | +### Suspend/Resume Reconciliation of a resource |
| 57 | + |
| 58 | +Maybe you want to get your hands dirty and do some manual (i.e. not GitOps driven) configuration changes. For instance, this could be useful in staging environments for rapid prototyping. In this case, you need to make sure that flux does not revert your "dirty" changes and suspend the reconciliation of the affected resources. Checkout the help for `flux suspend` to get further information |
| 59 | + |
| 60 | +```sh |
| 61 | +flux suspend -h |
| 62 | +``` |
| 63 | + |
| 64 | +E.g., a helmrelease can be suspended by |
| 65 | + |
| 66 | +```sh |
| 67 | +flux suspend helmrelease <NAME_OF_HELMRELEASE> |
| 68 | +``` |
| 69 | + |
| 70 | +Don't forget to resume the reconciliation, when you are done with your experiments so that flux will take over the control of your deployed resources again: |
| 71 | + |
| 72 | +```sh |
| 73 | +flux resume helmrelease <NAME_OF_HELMRELEASE> |
| 74 | +``` |
| 75 | + |
| 76 | +:::note |
| 77 | +Sometimes you will need to `suspend` and `resume` resources in order to trigger an update of the deployed resources. If have the impression that the state in the cluster does not match your definitions in the git repository, try to `suspend` and `resume` the corresponding resources, wait for reconciliation, and see that the state matches the git repository again. |
| 78 | +::: |
0 commit comments