Skip to content

Commit

Permalink
fix and improve basic-health test (#2733)
Browse files Browse the repository at this point in the history
Signed-off-by: chipzoller <[email protected]>
  • Loading branch information
chipzoller authored Nov 8, 2023
1 parent 852faf9 commit 4168152
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions cost-analyzer/templates/tests/basic-health.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,31 @@ metadata:
annotations:
{{- include "kubecost.test.annotations" . | nindent 4 }}
spec:
serviceAccountName: {{ template "cost-analyzer.serviceAccountName" . }}
automountServiceAccountToken: false
restartPolicy: Never
securityContext:
seccompProfile:
type: RuntimeDefault
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 3000
fsGroup: 2000
containers:
- name: test-kubecost
image: alpine/k8s:1.26.9
securityContext:
privileged: false
capabilities:
drop:
- ALL
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
command:
- /bin/sh
args:
- -c
- >-
svc=$(kubectl -n {{ .Release.Namespace }} get svc -l app.kubernetes.io/name=cost-analyzer -o json | jq -r .items[0].metadata.name);
svc="{{ .Release.Name }}-cost-analyzer";
echo Getting current Kubecost state.;
response=$(curl -sL http://${svc}:9090/model/getConfigs);
code=$(echo ${response} | jq .code);
Expand Down

0 comments on commit 4168152

Please sign in to comment.