Skip to content

Commit 5fba8d1

Browse files
author
github-actions
committed
Update perfectscale-agent chart with new package version v0.0.16
1 parent 1963153 commit 5fba8d1

File tree

8 files changed

+205
-75
lines changed

8 files changed

+205
-75
lines changed

charts/perfectscale-agent/templates/_helpers.tpl

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,26 +102,4 @@ For testing purposes, in prod we want to get the actual cluster's UID
102102
{{- else }}
103103
{{- "" }}
104104
{{- end }}
105-
{{- end }}
106-
107-
{{/*
108-
How much sleep should init container gets before completing
109-
*/}}
110-
{{- define "helm.exporter.initSleep" -}}
111-
{{- if .Values.settings.initSleep }}
112-
{{- .Values.settings.initSleep }}
113-
{{- else }}
114-
{{- "1s" }}
115-
{{- end }}
116-
{{- end }}
117-
118-
{{/*
119-
Set if we want to enable go PPROF
120-
*/}}
121-
{{- define "helm.exporter.enablePProf" -}}
122-
{{- if .Values.settings.enablePProf }}
123-
{{- .Values.settings.enablePProf }}
124-
{{- else }}
125-
{{- "false" }}
126-
{{- end }}
127-
{{- end }}
105+
{{- end }}

charts/perfectscale-agent/templates/cluster_role.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{{- if .Values.rbac.create -}}
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: {{ template "helm.fullname" . }}
6+
labels:
7+
{{- include "helm.labels" . | nindent 4 }}
8+
rules:
9+
- apiGroups:
10+
- ""
11+
resources:
12+
- pods
13+
- nodes
14+
- nodes/proxy
15+
- replicationcontrollers
16+
- persistentvolumeclaims
17+
- persistentvolumes
18+
- services
19+
- namespaces
20+
- events
21+
verbs:
22+
- get
23+
- list
24+
- watch
25+
- apiGroups:
26+
- ""
27+
resources:
28+
- namespaces
29+
verbs:
30+
- get
31+
- apiGroups:
32+
- "apps"
33+
resources:
34+
- deployments
35+
- replicasets
36+
- daemonsets
37+
- statefulsets
38+
verbs:
39+
- get
40+
- list
41+
- watch
42+
- apiGroups:
43+
- "storage.k8s.io"
44+
resources:
45+
- storageclasses
46+
- csinodes
47+
verbs:
48+
- get
49+
- list
50+
- watch
51+
- apiGroups:
52+
- "batch"
53+
resources:
54+
- jobs
55+
verbs:
56+
- get
57+
- list
58+
- watch
59+
- apiGroups:
60+
- "autoscaling"
61+
resources:
62+
- horizontalpodautoscalers
63+
verbs:
64+
- get
65+
- list
66+
- watch
67+
- apiGroups:
68+
- "coordination.k8s.io"
69+
resources:
70+
- leases
71+
verbs:
72+
- create
73+
- get
74+
- list
75+
- watch
76+
- update
77+
- apiGroups:
78+
- "metrics.k8s.io"
79+
resources:
80+
- pods
81+
verbs:
82+
- get
83+
- list
84+
- nonResourceURLs:
85+
- "/version"
86+
verbs:
87+
- "get"
88+
{{- end }}

charts/perfectscale-agent/templates/cluster_role_binding.yaml renamed to charts/perfectscale-agent/templates/clusterrolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if .Values.serviceAccount.create -}}
1+
{{- if .Values.rbac.create -}}
22
apiVersion: rbac.authorization.k8s.io/v1
33
kind: ClusterRoleBinding
44
metadata:

charts/perfectscale-agent/templates/deployment.yaml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ apiVersion: apps/v1
44
kind: Deployment
55
metadata:
66
name: {{ include "helm.fullname" . }}
7+
namespace: {{ .Release.Namespace }}
78
labels:
89
{{- include "helm.labels" . | nindent 4 }}
10+
{{- with .Values.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
914
spec:
15+
replicas: {{ .Values.replicaCount }}
1016
selector:
1117
matchLabels:
1218
{{- include "helm.selectorLabels" . | nindent 6 }}
@@ -15,12 +21,20 @@ spec:
1521
labels:
1622
{{- include "helm.selectorLabels" . | nindent 8 }}
1723
spec:
24+
{{- if .Values.priorityClass.enabled }}
25+
priorityClassName: {{ .Values.priorityClass.name }}
26+
{{- end }}
1827
serviceAccountName: {{ include "helm.serviceAccountName" . }}
28+
automountServiceAccountToken: true
29+
{{- with .Values.securityContext }}
30+
securityContext:
31+
{{- toYaml . | nindent 8 }}
32+
{{- end }}
1933
initContainers:
2034
- name: depends-on
21-
image: "public.ecr.aws/perfectscale/alpine:3.16"
35+
image: "public.ecr.aws/perfectscale-io/alpine:3.17"
2236
command: [ 'sh' ]
23-
args: [ '-c', 'apk add curl; curl --retry-all-errors --retry 30 --retry-delay 5 -s {{ include "helm.exporter.ksmAddress" . }}; sleep {{ include "helm.exporter.initSleep" . }}' ]
37+
args: [ '-c', 'curl --retry-all-errors --retry 30 --retry-delay 5 -s {{ include "helm.exporter.ksmAddress" . }}; sleep {{ .Values.settings.initSleep | default "1s" }}' ]
2438
containers:
2539
- name: {{ .Chart.Name }}
2640
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
@@ -39,7 +53,7 @@ spec:
3953
- name: KUBE_API_TIMEOUT
4054
value: "{{ .Values.settings.kubeAPITimeoutSec }}"
4155
- name: DATA_RETENTION_TIME
42-
value: "{{ include "helm.exporter.dataRetentionTime" . }}"
56+
value: "{{ .Values.settings.dataRetentionTime | default "15m" }}"
4357
- name: KSM_ADDRESS
4458
value: "{{ include "helm.exporter.ksmAddress" . }}"
4559
- name: CADVISOR_NUM_WORKERS
@@ -49,13 +63,15 @@ spec:
4963
- name: UPLOAD_POLICY_URL
5064
value: "{{ .Values.settings.uploadPolicyUrl }}"
5165
- name: RAW_TIME_WINDOW_SIZE_MINUTES
52-
value: "{{ include "helm.exporter.rawTimeWindowSizeMinutes" . }}"
66+
value: "{{ .Values.settings.rawTimeWindowSizeMinutes | default "10m" }}"
5367
- name: UPLOAD_POLICY_REFRESH_PCT
54-
value: "{{ include "helm.exporter.policyRefreshPct" . }}"
68+
value: "{{ .Values.settings.policyRefreshPct | default "0.5" }}"
5569
- name: CLUSTER_UID
5670
value: "{{ include "helm.exporter.clusterUID" . }}"
5771
- name: DEMO_ENV_ADDRESS
5872
value: "{{ .Values.settings.demoEnvAddress }}"
73+
- name: ENABLE_PPROF
74+
value: "{{ .Values.settings.enablePProf | default "false" }}"
5975
- name: CLIENT_ID
6076
valueFrom:
6177
secretKeyRef:
@@ -68,8 +84,6 @@ spec:
6884
name: {{ .Values.secret.name | default $fullName }}
6985
key: "clientSecret"
7086
optional: false
71-
- name: ENABLE_PPROF
72-
value: "{{ include "helm.exporter.enablePProf" . }}"
7387
ports:
7488
- name: http
7589
containerPort: 8080
@@ -88,3 +102,15 @@ spec:
88102
imagePullSecrets:
89103
- name: {{ .Values.imagePullSecrets.secretName }}
90104
{{- end }}
105+
{{- with .Values.tolerations }}
106+
tolerations:
107+
{{- toYaml . | nindent 8 }}
108+
{{- end }}
109+
{{- with .Values.nodeSelector }}
110+
nodeSelector:
111+
{{- toYaml . | nindent 8 }}
112+
{{- end }}
113+
{{- with .Values.affinity }}
114+
affinity:
115+
{{- toYaml . | nindent 8 }}
116+
{{- end }}

charts/perfectscale-agent/templates/service-monitor.yaml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{{- if .Values.serviceMonitor -}}
2+
{{- if .Values.serviceMonitor.enable -}}
3+
apiVersion: monitoring.coreos.com/v1
4+
kind: ServiceMonitor
5+
metadata:
6+
name: {{ include "helm.fullname" . }}
7+
labels:
8+
{{- include "helm.labels" . | nindent 4 }}
9+
{{- range $key, $value := .Values.serviceMonitor.labels }}
10+
{{ $key }}: {{ $value | quote }}
11+
{{- end }}
12+
spec:
13+
endpoints:
14+
- port: http
15+
{{- if .Values.serviceMonitor.interval }}
16+
interval: {{ .Values.serviceMonitor.interval }}
17+
{{- end }}
18+
{{- if .Values.serviceMonitor.path }}
19+
path: {{ .Values.serviceMonitor.path }}
20+
{{- end }}
21+
{{- if .Values.serviceMonitor.timeout }}
22+
scrapeTimeout: {{ .Values.serviceMonitor.timeout }}
23+
{{- end }}
24+
namespaceSelector:
25+
matchNames:
26+
- {{ .Release.Namespace | quote }}
27+
selector:
28+
matchLabels:
29+
{{- include "helm.selectorLabels" . | nindent 6 }}
30+
{{- end }}
31+
{{- end }}

charts/perfectscale-agent/values.yaml

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ replicaCount: 1
22
image:
33
repository: public.ecr.aws/perfectscale-io/psc-exporter
44
pullPolicy: Always
5-
tag: "v0.0.15"
5+
tag: "v0.0.16"
66
settings:
77
serviceId: "psc-exporter"
88
env: "prod"
@@ -27,6 +27,56 @@ resources:
2727
requests:
2828
cpu: 200m
2929
memory: 300M
30+
## Annotations to add to the deployment
31+
annotations: {}
32+
## Pods Service Account
33+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
34+
serviceAccount:
35+
# Specifies whether a service account should be created
36+
create: true
37+
# Annotations to add to the service account
38+
annotations: {}
39+
# The name of the service account to use.
40+
# If not set and create is true, a name is generated using the fullname template
41+
name: ""
42+
## Role Based Access
43+
## Ref: https://kubernetes.io/docs/admin/authorization/rbac/
44+
##
45+
rbac:
46+
create: true
47+
# Pod security context.
48+
# Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
49+
securityContext:
50+
runAsNonRoot: true
51+
fsGroup: 1002
52+
runAsGroup: 1002
53+
runAsUser: 1002
54+
seccompProfile:
55+
type: RuntimeDefault
56+
priorityClass:
57+
enabled: true
58+
name: system-cluster-critical
59+
# Pod toleration rules.
60+
# Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
61+
tolerations: {}
62+
# Pod node selector rules.
63+
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
64+
nodeSelector: {}
65+
# Pod affinity rules.
66+
# Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
67+
affinity: {}
68+
serviceMonitor:
69+
# When set true then use a ServiceMonitor to configure scraping
70+
enable: true
71+
# Set how frequently Prometheus should scrape
72+
interval: 30s
73+
# Set path to the metrics
74+
path: /metrics
75+
# Set timeout for scrape
76+
timeout: 10s
77+
# Additional Label to the serviceMonitor
78+
# labels:
79+
# prometheus: kube-prometheus
3080
kube-state-metrics:
3181
prometheusScrape: false
3282
metricLabelsAllowlist:
@@ -55,13 +105,3 @@ kube-state-metrics:
55105
requests:
56106
cpu: 200m
57107
memory: 200M
58-
serviceAccount:
59-
# Specifies whether a service account should be created
60-
create: true
61-
# Annotations to add to the service account
62-
annotations: {}
63-
# The name of the service account to use.
64-
# If not set and create is true, a name is generated using the fullname template
65-
name: ""
66-
serviceMonitor:
67-
create: false

0 commit comments

Comments
 (0)