Skip to content

Commit

Permalink
fix: use deployment for metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
gavin-stackrox authored Jun 11, 2024
2 parents 191e67a + 0185165 commit 296511a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ jobs:
- name: Dump debug info
if: always()
run: |
kubectl -n "$NS" get -o yaml daemonsets,pods,services,roles,rolebindings
kubectl -n "$NS" get -o yaml daemonsets,deployments,pods,replicasets,services,roles,rolebindings
kubectl -n "$NS" get events
kubectl -n "$NS" logs -l app=basic-metrics --all-containers=true --ignore-errors=true --tail=-1
kubectl -n "$NS" logs -l app=basic-metrics --all-containers=true --ignore-errors=true --tail=-1 --previous=true
Expand Down
56 changes: 32 additions & 24 deletions deploy/deployment.yaml.gotpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,43 @@ roleRef:
---
{{ end }}
{{ if .CollectMetrics }}
apiVersion: v1
kind: Pod
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Name }}-metrics
labels:
app: {{ .Name }}-metrics
spec:
containers:
- name: aggregator
image: {{ .Image }}:{{ .Version }}
args:
- "aggregate-metrics"
- "--debug"
ports:
- containerPort: 8443
name: grpc
- containerPort: 8080
name: http
resources:
requests:
cpu: "5m"
memory: "16Mi"
limits:
cpu: "100m"
memory: "64Mi"
securityContext:
readOnlyRootFilesystem: true
runAsUser: 1000
runAsNonRoot: true
selector:
matchLabels:
app: {{ .Name }}-metrics
template:
metadata:
labels:
app: {{ .Name }}-metrics
spec:
containers:
- name: aggregator
image: {{ .Image }}:{{ .Version }}
args:
- "aggregate-metrics"
- "--debug"
ports:
- containerPort: 8443
name: grpc
- containerPort: 8080
name: http
resources:
requests:
cpu: "5m"
memory: "16Mi"
limits:
cpu: "100m"
memory: "64Mi"
securityContext:
readOnlyRootFilesystem: true
runAsUser: 1000
runAsNonRoot: true
---
apiVersion: v1
kind: Service
Expand Down

0 comments on commit 296511a

Please sign in to comment.