45 lines
1.1 KiB
YAML
45 lines
1.1 KiB
YAML
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Pod
|
||
|
metadata:
|
||
|
name: basic-health
|
||
|
namespace: {{ .Release.Namespace }}
|
||
|
annotations:
|
||
|
{{- include "kubecost.test.annotations" . | nindent 4 }}
|
||
|
spec:
|
||
|
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="{{ .Release.Name }}-cost-analyzer";
|
||
|
echo Getting current Kubecost state.;
|
||
|
response=$(curl -sL http://${svc}:9090/model/getConfigs);
|
||
|
code=$(echo ${response} | jq .code);
|
||
|
if [ "$code" -eq 200 ]; then
|
||
|
echo "Got Kubecost working configuration. Successful."
|
||
|
exit 0
|
||
|
else
|
||
|
echo "Failed to fetch Kubecost configuration. Response was $response"
|
||
|
exit 1
|
||
|
fi
|