Skip to content

Instantly share code, notes, and snippets.

@x95castle1
Last active March 27, 2025 19:29
Show Gist options
  • Select an option

  • Save x95castle1/516ca95aee835536ddc2dea742a169df to your computer and use it in GitHub Desktop.

Select an option

Save x95castle1/516ca95aee835536ddc2dea742a169df to your computer and use it in GitHub Desktop.
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.subset({"kind":"Deployment","metadata":{"name":"contour"}}), expects="1+"
---
spec:
#@overlay/replace via=lambda left, _: left
replicas:
---
apiVersion: projectcontour.io/v1alph1
kind: ExtensionService
metadata:
name: otel-collector
namespace: grafana-gitops
spec:
protocol: h2c
services:
- name: k8s-monitoring-grafana-agent
port: 4317
#! This is the deployment from the contour package
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: contour
name: contour
namespace: projectcontour
spec:
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
# This value of maxSurge means that during a rolling update
# the new ReplicaSet will be created first.
maxSurge: 50%
selector:
matchLabels:
app: contour
#@data/values
---
contour:
replicas: 3
contour:
configFileContents:
tracing:
includePodDetail: true
extensionService: grafana-gitops/otel-collector
#! This is the overlay from the contour package
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata": {"name": "contour"}})
---
spec:
replicas: #@ data.values.contour.replicas
#! This is the overlay from the contour package.... There more overlay in the future
apiVersion: v1
kind: Secret
metadata:
name: contour-extension-overlay
namespace: tap-install
stringData:
contour-extension-overlay.yaml: |
#@overlay/match by=overlay.subset({"kind":"Deployment","metadata":{"name":"contour"}}), expects="1+"
---
spec:
#@overlay/replace via=lambda left, _: left
replicas:
---
apiVersion: projectcontour.io/v1alph1
kind: ExtensionService
metadata:
name: otel-collector
namespace: grafana-gitops
spec:
protocol: h2c
services:
- name: k8s-monitoring-grafana-agent
port: 4317
package_overlays:
- name: contour
secrets:
- name: contour-extension-overlay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment