Skip to content

Commit

Permalink
chore: fix ping mode
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Oct 3, 2023
1 parent 01b857e commit 7b6dcaa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ spec:
capabilities:
add:
- CAP_NET_RAW
{{- else if eq .Values.pingMode "unprivileged" }}
securityContext:
sysctls:
- name: net.ipv4.ping_group_range
value: "0 2147483647"
{{- end }}
image: {{ include "canary-checker.imageString" . }}
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
env:
- name: PRIVILEGED
value: {{ .Values.allowPrivilegeEscalation | quote }}
- name: PING_MODE
value: {{ .Values.pingMode | quote }}
{{- if eq .Values.debug true }}
- name: DEBUG
value: "true"
Expand Down
5 changes: 4 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ db:

nameOverride: ""

# set the mechanism for pings - either privileged, privileged or none
pingMode: "unprivileged"
allowPrivilegeEscalation: false

data:
Expand Down Expand Up @@ -120,7 +122,8 @@ resources:
limits:
memory: 2Gi

serviceAccount: {}
serviceAccount:
{}
# Configures extra annotations on the service account
# annotations:
# some: annotation
Expand Down
2 changes: 1 addition & 1 deletion checks/icmp.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var (
)
)

var PRIVILEGED = os.Getenv("PRIVILEGED") == "true"
var PRIVILEGED = os.Getenv("PING_MODE") == "privileged"

func init() {
prometheus.MustRegister(packetLoss)
Expand Down

0 comments on commit 7b6dcaa

Please sign in to comment.