Skip to content

[Improvement]The kibana running status in kubeblocks cannot be ready #1902

@chengyifei1991

Description

@chengyifei1991
  readinessProbe:
    exec:
      command:
      - bash
      - -c
      - |
        #!/usr/bin/env bash -e

        # Disable nss cache to avoid filling dentry cache when calling curl
        # This is required with Kibana Docker using nss < 3.52
        export NSS_SDB_USE_CACHE=no

        http () {
            local path="${1}"
            set -- -XGET -s --fail -L

            if [ -n "${ELASTICSEARCH_USERNAME}" ] && [ -n "${ELASTICSEARCH_PASSWORD}" ]; then
              set -- "$@" -u "${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}"
            fi

            if [ -n "${KB_TLS_CERT_FILE}" ]; then
              READINESS_PROBE_PROTOCOL=https
            else
              READINESS_PROBE_PROTOCOL=http
            fi
            endpoint="${READINESS_PROBE_PROTOCOL}://${POD_IP}:5601"
            STATUS=$(curl --output /dev/null --write-out "%{http_code}" -k "$@" "${endpoint}${path}")
            if [[ "${STATUS}" -eq 200 ]]; then
              exit 0
            fi

            echo "Error: Got HTTP code ${STATUS} but expected a 200"
            exit 1
        }

        http "/app/kibana"

Because the readprobe path in the CD configuration of kubeblocks kibana cannot be linked to the kibana environment variable serverBasePath. The path is hard-coded as /app/kibana. It is recommended to introduce ${SERVER_BASEPATH} and modify the CD readprobe detection path to http "${SERVER_BASEPATH}/app/kibana"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions