goss.yaml 1.3 KB

1234567891011121314151617181920212223242526272829
  1. # Copyright Broadcom, Inc. All Rights Reserved.
  2. # SPDX-License-Identifier: APACHE-2.0
  3. http:
  4. http://127.0.0.1:{{ .Vars.containerPorts.http }}/metrics:
  5. status: 200
  6. body:
  7. - /kube_deployment_status_replicas_ready.*kube-state-metrics.*{{ .Vars.replicaCount }}/
  8. - "!kube_secret_"
  9. http://kube-state-metrics:{{ .Vars.service.ports.http }}/metrics:
  10. status: 200
  11. body:
  12. - /kube_deployment_status_replicas_ready.*kube-state-metrics.*{{ .Vars.replicaCount }}/
  13. - "!kube_secret_"
  14. command:
  15. {{- $uid := .Vars.containerSecurityContext.runAsUser }}
  16. {{- $gid := .Vars.podSecurityContext.fsGroup }}
  17. check-user-info:
  18. # The UID and GID should always be either the one specified as vars (always a bigger number that the default)
  19. # or the one randomly defined by openshift (larger values). Otherwise, the chart is still using the default value.
  20. exec: if [ $(id -u) -lt {{ $uid }} ] || [ $(id -G | awk '{print $2}') -lt {{ $gid }} ]; then exit 1; fi
  21. exit-status: 0
  22. {{ if .Vars.serviceAccount.automountServiceAccountToken }}
  23. check-sa:
  24. exec: cat /var/run/secrets/kubernetes.io/serviceaccount/token | cut -d '.' -f 2 | xargs -I '{}' echo '{}====' | fold -w 4 | sed '$ d' | tr -d '\n' | base64 -d
  25. exit-status: 0
  26. stdout:
  27. - /serviceaccount.*name.*{{.Env.BITNAMI_APP_NAME }}/
  28. {{ end }}