: flux-system
    spec:
      interval: 15m
      path: podinfo
      prune: true # remove any elements later removed from the above path
      timeout: 2m # if not set, this defaults to interval duration, which is 1h
      sourceRef:
        kind: GitRepository
        name: flux-system
      validation: server
      healthChecks:
        - apiVersion: apps/v1
          kind: Deployment
          name: podinfo
          namespace: podinfo
    ```

### Create HelmRelease

Now create a HelmRelease for the chart - the HelmRelease defines how the (generic) chart from the HelmRepository will be installed into our cluster. Here's my [podinfo/helmrelease-podinfo.yaml](https://github.com/geek-cookbook/template-flux/blob/main/podinfo/helmrelease-podinfo.yaml).

??? example "Here's an example HelmRelease..."

    ```yaml
    apiVersion: helm.toolkit.fluxcd.io/v2beta1
    kind: HelmRelease
    metadata:
      name: podinfo
      namespace: podinfo
    spec:
      chart:
        spec:
          chart: podinfo # Must be the same as the upstream chart name
          version: 10.x # Pin to semver major versions to avoid breaking changes but still get bugfixes/updates
          sourceRef:
            kind: HelmRepository
            name: podinfo # References the HelmRepository you created earlier
            namespace: flux-system # All HelmRepositories exist in the flux-system namespace
      interval: 15m
      timeout: 5m
      releaseName: podinfo # _may_ be different from the upstream chart name, but could cause confusion
      valuesFrom:
      - kind: ConfigMap
        name: podinfo-helm-chart-value-overrides # Align with the name of the ConfigMap containing all values
        valuesKey: values.yaml # This is the default, but best to be explicit for clarity
    ```

### Create ConfigMap

Finally, create a ConfigMap to be used to pass helm chart values to the chart. Note that it is **possible** to pass values directly in the HelmRelease, but.. it's messy. I find it easier to let the HelmRelease **describe** the release, and to let the configmap **configure** the release. It also makes tracking changes more straightforward.

As a second note, it's strictly only necessary to include in the ConfigMap the values you want to **change** from the chart's defaults. I find this to be too confusing as charts are continually updated by their developers, and this can obsucre valuable options over time. So I place in my ConfigMaps the **entire** contents of the chart's `values.yaml` file, and then I explicitly overwrite the values I want to change.

!!! tip "Making chart updates simpl(er)"
    This also makes updating my values for an upstream chart refactor a simple process - I duplicate the ConfigMap, paste-overwrite with the values.yaml for the refactored/updated chart, and compare the old and new versions side-by-side, to ensure I'm still up-to-date.

It's too large to display nicely below, but here's my [podinfo/configmap-podinfo-helm-chart-value-overrides.yaml](https://github.com/geek-cookbook/template-flux/blob/main/podinfo/configmap-podinfo-helm-chart-value-overrides.yaml)

!!! tip "Yes, I am sticking to my super-obtuse file naming convention!"
    Doesn't it make it easier to understand, at a glance, exactly what this YAML file is intended to be?

### Commit the changes

Simply commit your changes, sit back, and wait for flux to do its 1-min update. If you like to watch the fun, you could run `watch -n1 flux get kustomizations` so that you'll see the reconciliation take place (*if you're quick*). You can also force flux to check the repo for changes manually, by running `flux reconcile source git flux-system`.

## Making changes

Let's say you decide that instead of 1 replica of the podinfo pod, you'd like 3 replicas. Edit your configmap, and change `replicaCount: 1` to `replicaCount: 3`.

Commit your changes, and once again do the waiting / impatient-reconciling jig. This time you'll have to wait up to 15 minutes though...

!!! question "Why 15 minutes?"
    > I thought we check the repo every minute?

    Yes, we check the entire GitHub repository for changes every 1 min, and changes to a kustomization are applied immediately. I.e., your podinfo ConfigMap gets updated within a minute (roughly). But the interval value for the HelmRelease is set to 15 minutes, so you could be waiting for as long as 15 minutes for flux to re-reconcile your HelmRelease with the ConfigMap, and to apply any changes. I've found that setting the HelmRelease interval too low causes (a) lots of unnecessary resource usage on behalf of flux, and (b) less stability when you have a large number of HelmReleases, some of whom depend on each other.

    You can force a HelmRelease to reconcile, by running `flux reconcile helmrelease -n <namespace> <name of helmrelease>`

## Success!

We did it. The Holy Grail. We deployed an application into the cluster, without touching the cluster. Pinch yourself, and then prove it worked by running `flux get kustomizations`, or `kubectl get helmreleases -n podinfo`.

--8<-- "recipe-footer.md"

[^1]: Got suggestions for improvements here? Shout out in the comments below!
<reponame>gianlucamalato/collinearity
from collinearity.SelectNonCollinear import SelectNonCollinearA new wargamer explores the wide world of wargames, focusing primarily on Ancient, Medieval, and Renaissance historical periods as well as dipping into Fantasy and Science Fiction wargames.
Note: You can find a Geeklist with all my content linked here. And you can follow me on Twitter at @swordsandchit.
Welcome to Swords and Chit! My aim is to focus on discussing and reviewing wargames. There are two primary reasons I wanted to start blogging about my wargaming experience: as a relatively new wargamer coming from a background of euro games, a lot of things in the wargaming hobby are going to be new to me and I hope to provide a fresh voice for those who might be on a similar journey into this area of gaming. Second, I have a very strong preference for games set in the Medieval period or earlier – although that isn’t where I’ll exclusively play, it is what I will focus on more than anything else. So I am glad you discovered this blog, and I hope you stick around for future posts!
**Note: We’re closing in on the 50th post here at Swords and Chit (the next post, in fact!) – I have a special game designated for that post, and it’ll make sense once it appears. However, the 51st post will be a little different. See, Carl and I started down this path of Wargaming in earnest this year, and so I thought it would be fun for us both to share some of our favorite games we’ve played so far, as well as the games we’re looking forward to playing in the near future. So look for that coming soon enough – perhaps as early as this weekend!
One of the things I look for in a solitaire experience is the ability to set it up and play it in a single sitting. While I’m never opposed to a longer session, it is far easier to get quicker games to the table. So when I looked at the lineup from Tiny Battle Publishing, I had a strong hunch that I’d be finding some games that hit the sweet spot for time consumed. In fact, I could have read the rulebook, punched the counters, set up, played, and tore down the game in a single sitting. That didn’t happen, as my solo time in the present moment is scarce, but I was able to chip away over the course of several days at the Invaders from Dimension X with my first play. The nice thing about it is the game is easy to stop and pick back up later without any real issues, so long as you end the play session at a natural breaking point in the flow.
As a whole, this play felt a little too easy. Early alien activations didn’t incur movement or attacks, really, which allowed me to plow through them with minimal risk. Even on the few turns where I bottlenecked key units across the lava bridge, leaving a single unit exposed on the other side, the chits drawn for the alien were mostly harmless. Which ultimately leans into the game itself and the design, from what I can tell from the designer’s notes in the rulebook: the alien side is unpredictable in what they do and when. Sometimes you’ll have plays where you mostly can do what you need