Skip to content

Commit

Permalink
Merge pull request #182 from Mirantis/source-label
Browse files Browse the repository at this point in the history
Watch only hmc-managed resources in source-controller
  • Loading branch information
Kshatrix authored Aug 12, 2024
2 parents fc66273 + 68f588a commit d0b33ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions docs/templates/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ and use them for deployment.
Here are the instructions on how to bring your own Template to HMC:

1. Create a [HelmRepository](https://fluxcd.io/flux/components/source/helmrepositories/) object containing the URL to the
external Helm repository.
external Helm repository. Label it with `hmc.mirantis.com/managed: "true"`.
2. Create a [HelmChart](https://fluxcd.io/flux/components/source/helmcharts/) object referencing the `HelmRepository` as a
`sourceRef`, specifying the name and version of your Helm chart.
`sourceRef`, specifying the name and version of your Helm chart. Label it with `hmc.mirantis.com/managed: "true"`.
3. Create a `Template` object in `hmc-system` namespace referencing this helm chart in `spec.helm.chartRef`.
`chartRef` is a field of the
[CrossNamespaceSourceReference](https://fluxcd.io/flux/components/helm/api/v2/#helm.toolkit.fluxcd.io/v2.CrossNamespaceSourceReference) kind.
Expand All @@ -26,6 +26,8 @@ kind: HelmRepository
metadata:
name: custom-templates-repo
namespace: hmc-system
labels:
hmc.mirantis.com/managed: "true"
spec:
insecure: true
interval: 10m0s
Expand All @@ -40,6 +42,8 @@ kind: HelmChart
metadata:
name: custom-template-chart
namespace: hmc-system
labels:
hmc.mirantis.com/managed: "true"
spec:
interval: 5m0s
chart: custom-template-chart-name
Expand Down
4 changes: 4 additions & 0 deletions templates/hmc/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ flux2:
container:
additionalArgs:
- --watch-label-selector=hmc.mirantis.com/managed=true
sourceController:
container:
additionalArgs:
- --watch-label-selector=hmc.mirantis.com/managed=true

0 comments on commit d0b33ef

Please sign in to comment.