Absorb helm chart collator functions

This copies the hcc functions from airshipctl into treasuremap.
They are not used in the airshipctl repo, and thus having them
there doesn't add value, and also led to issues which were
not uncovered until we uplifted airshipctl in treasuremap [0].
This moves them to treasuremap where they are actually used.

They will need to be removed from airshipctl separately.

[0]: https://review.opendev.org/c/airship/airshipctl/+/794707

Signed-off-by: Sean Eagan <seaneagan1@gmail.com>
Change-Id: Ief295eaa9b84b4303add537b3526b425c91014e6
This commit is contained in:
Sean Eagan 2021-06-07 10:15:00 -05:00
parent 3277230b03
commit 8a172ac2e3
14 changed files with 115 additions and 4 deletions

View File

@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: helm-chart-collator
spec:
selector:
matchLabels:
app: helm-chart-collator
replicas: 2
template:
metadata:
labels:
app: helm-chart-collator
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: helm-chart-collator
image: quay.io/airshipit/helm-chart-collator:latest
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
labels:
app: helm-chart-collator
name: helm-chart-collator
spec:
ports:
- port: 8080
targetPort: 8080
selector:
app: helm-chart-collator
type: ClusterIP

View File

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- helm-chart-collator.yaml
namespace: helm-chart-collator

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: helm-chart-collator

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- versions.yaml

View File

@ -0,0 +1,19 @@
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: helm-chart-collator-versions-replacements
annotations:
config.kubernetes.io/function: |-
container:
image: localhost/replacement-transformer
replacements:
- source:
objref:
kind: VersionsCatalogue
name: versions-treasuremap
fieldref: "{.spec.images.helm_chart_collator.helm_chart_collator.helm_chart_collator.image}"
target:
objref:
kind: Deployment
name: helm-chart-collator
fieldrefs: ["{.spec.template.spec.containers[?(.name == 'helm-chart-collator')].image}"]

View File

@ -0,0 +1,9 @@
# Helm Charts from Helm Repository (Helm Collator)
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: HelmRepository
metadata:
name: collator
namespace: helm-chart-collator
spec:
interval: 5m
url: http://helm-chart-collator.helm-chart-collator.svc:8080

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- helm-repository.yaml

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- versions.yaml

View File

@ -0,0 +1,19 @@
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: helm-repository-versions-replacements
annotations:
config.kubernetes.io/function: |-
container:
image: localhost/replacement-transformer
replacements:
- source:
objref:
kind: VersionsCatalogue
name: versions-treasuremap
fieldref: "{.spec.helm_repositories.helm_chart_collator.url}"
target:
objref:
kind: HelmRepository
name: collator
fieldrefs: ["{.spec.url}"]

View File

@ -29,6 +29,8 @@ spec:
url: https://charts.rook.io/release
dex-aio:
url: http://helm-chart-collator.collator.svc:8080
helm_chart_collator:
url: http://helm-chart-collator.helm-chart-collator.svc:8080
charts:
elasticsearch:
@ -70,6 +72,10 @@ spec:
# <function>:
# <component>:
# <container>:
helm_chart_collator:
helm_chart_collator:
helm_chart_collator:
image: quay.io/airshipit/helm-chart-collator:latest
kube_prometheus_stack:
prometheus_operator:
# NOTE: For prometheus and alertmanager instances managed by the operator

View File

@ -2,7 +2,7 @@ resources:
- ../../../../composite/initinfra
- ../../../../function/hostconfig-operator
- ../../../../../../airshipctl/manifests/composite/flux-helm/
- ../../../../../../airshipctl/manifests/function/helm-chart-collator/
- ../../../../function/helm-chart-collator/
- ../../../../function/rook-operator
commonLabels:

View File

@ -1,5 +1,5 @@
resources:
- ../../../../../composite/initinfra/replacements
- ../../../../../../../airshipctl/manifests/function/helm-chart-collator/replacements
- ../../../../../function/helm-chart-collator/replacements
- ../../../../../function/hostconfig-operator/replacements
- ../../../../../function/rook-operator/replacements

View File

@ -2,7 +2,7 @@ resources:
- ../../../../composite/initinfra
- ../../../../function/hostconfig-operator
- ../../../../../../airshipctl/manifests/composite/flux-helm/
- ../../../../../../airshipctl/manifests/function/helm-chart-collator/
- ../../../../function/helm-chart-collator/
- ../../../../function/rook-operator
commonLabels:

View File

@ -1,5 +1,5 @@
resources:
- ../../../../../composite/initinfra/replacements
- ../../../../../../../airshipctl/manifests/function/helm-chart-collator/replacements
- ../../../../../function/helm-chart-collator/replacements
- ../../../../../function/hostconfig-operator/replacements
- ../../../../../function/rook-operator/replacements