Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions .scripts/overlay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ if [ ! -f ${PROJECT_DIR}/config/values.yaml ]; then
fi

for OVERLAY in `ls ${PROJECT_DIR}/config/overlays`; do \
yot \
--indent-level=2 \
--instructions=${PROJECT_DIR}/config/overlays/${OVERLAY} \
--output-directory=. \
--values-file=${PROJECT_DIR}/config/values.yaml \
--values-file=${CATEGORY_DIR}/values.yaml \
--remove-comments \
--stdout > ${CATEGORY}/${PROJECT}/${OVERLAY}
# yot \
# --indent-level=2 \
# --instructions=${PROJECT_DIR}/config/overlays/${OVERLAY} \
# --output-directory=. \
# --values-file=${PROJECT_DIR}/config/values.yaml \
# --values-file=${CATEGORY_DIR}/values.yaml \
# --remove-comments \
# --stdout > ${CATEGORY}/${PROJECT}/${OVERLAY}

# TODO: remove duplication in overlays for nukleros labels
# run the stdout through our common overlays
Expand All @@ -54,4 +54,14 @@ for OVERLAY in `ls ${PROJECT_DIR}/config/overlays`; do \
# --values-file=${CATEGORY_DIR}/values.yaml \
# --remove-comments \
# --stdout > ${CATEGORY}/${PROJECT}/${OVERLAY}

find ${PROJECT_DIR}/vendor -name "*.yaml" -exec cat {} \; > ${PROJECT_DIR}/in.yaml
cat ${PROJECT_DIR}/in.yaml | yot \
--indent-level=2 \
--instructions=${PROJECT_DIR}/config/overlays/${OVERLAY} \
--output-directory=. \
--values-file=${PROJECT_DIR}/config/values.yaml \
--values-file=${CATEGORY_DIR}/values.yaml \
--remove-comments \
--stdout > ${CATEGORY}/${PROJECT}/${OVERLAY}
done
34 changes: 34 additions & 0 deletions .source/observability/prometheus/config/overlays/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
commonOverlays:
- name: "remove the helm info"
query:
- metadata.labels["helm.sh/chart"]
- metadata.labels["app.kubernetes.io/managed-by"]
action: delete

yamlFiles:
- name: "prometheus config"
path: "../../vendor/"
outputPath: "observability/prometheus/"
overlays:
- name: "ensure we are only acting upon config resources"
query: "$"
action: delete
documentQuery:
- conditions:
- query: $[?($.kind != "Secret")]
- query: $[?($.kind != "ConfigMap")]

- name: "ensure namespace is updated"
query:
- metadata.namespace
- subjects[*].namespace
value: "{{ .namespace }}"

# There are 28 Configmaps in 4 files only following 3 are processed by yot with configuration
# path: "../../vendor/"
# outputPath: "observability/prometheus/"

# name: grafana-dashboards <-- .source/observability/prometheus/vendor/grafana-dashboardSources.yaml
# name: adapter-config <-- .source/observability/prometheus/vendor/prometheusAdapter-configMap.yaml
# name: blackbox-exporter-configuration <-- source/observability/prometheus/vendor/blackboxExporter-configuration.yaml
26 changes: 26 additions & 0 deletions .source/observability/prometheus/config/overlays/crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
commonOverlays:
- name: "apply nukleros labels"
query: "metadata.labels"
value:
platform.nukleros.io/category: "{{ .category }}"
platform.nukleros.io/project: "{{ .project }}"
onMissing:
action: inject

- name: "remove the creation timestamp"
query:
- metadata.creationTimestamp
action: delete

yamlFiles:
- name: "prometheus custom resource definitions"
path: "../../vendor/"
outputPath: "observability/prometheus/"
overlays:
- name: "ensure we are only acting upon crds"
query: "$"
action: delete
documentQuery:
- conditions:
- query: $[?($.kind != "CustomResourceDefinition")]
Loading