Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Kibana chart fails when security disabled #1778

Open
andrew-pickin-epi opened this issue Feb 23, 2023 · 1 comment
Open

Kibana chart fails when security disabled #1778

andrew-pickin-epi opened this issue Feb 23, 2023 · 1 comment

Comments

@andrew-pickin-epi
Copy link

andrew-pickin-epi commented Feb 23, 2023

Chart version:

8.5.1

Kubernetes version:

1.22

Kubernetes provider: E.g. GKE (Google Kubernetes Engine)

AWS EKS

Helm Version:

3

helm get release output
Did you mean values?

helm3 -n logging get values kibana 
USER-SUPPLIED VALUES:
elasticsearchHosts: http://elasticsearch-master:9200
ingress:
  annotations:
    nginx.ingress.kubernetes.io/auth-signin: https://$host/oauth2/start?rd=$escaped_request_uri
    nginx.ingress.kubernetes.io/auth-url: https://$host/oauth2/auth
  className: nginx
  enabled: true
  hosts:
  - host: kibana-expt.epimorphics.net
    paths:
    - path: /
  labels: {}
lifecycle:
  postStart:
    exec:
      command:
      - bash
      - -c
      - "#!/usr/bin/env bash\n# Adapted from https://github.com/elastic/kibana/issues/3709\n(
        \n  url=\"http://localhost:5601\"\n  index_pattern=\"logstash-*\"\n  id=\"logstash-*\"\n
        \ time_field=\"@timestamp\"\n  echo \"Post start script\" > /tmp/poststart\n
        \ sleep 50\n  status=500\n  while [[ $status == 5* || $status == 000 ]]; do\n
        \   sleep 10\n    status=$( curl -s -o /dev/null -w \"%{http_code}\"  -XPOST
        -H \"Content-Type: application/json\" -H \"kbn-xsrf: anything\" \\\n    \"$url/api/saved_objects/index-pattern/$id\"
        \\\n    -d\"{\\\"attributes\\\":{\\\"title\\\":\\\"$index_pattern\\\",\\\"timeFieldName\\\":\\\"$time_field\\\"}}\"
        )\n    echo \"$( date ): Index create got $status\" >> /tmp/poststart\n  done\n
        \ \n  # Make it the default index\n  echo \"Setting default index\" >> /tmp/poststart\n
        \ curl -XPOST -H \"Content-Type: application/json\" -H \"kbn-xsrf: anything\"
        \\\n    \"$url/api/kibana/settings/defaultIndex\" \\\n    -d\"{\\\"value\\\":\\\"$id\\\"}\"
        >> /tmp/poststart\n) &   # run as background so as not to block startup\n"
readinessProbe:
  initialDelaySeconds: 60
resources:
  requests:
    cpu: 100m
    memory: 500Mi

While security is enabled by default in 8.5 there are still a number of issues, further it's optional not mandatory.
Using http inside a secure vpn is still valid. But http isn't supported in the help scripts:

Output of helm get release

While security is enabled by default in 8.5 there are still a number of issues, further it's optional not mandatory.
Using http inside a secure vpn is still valid. But http isn't supported in the help scripts:

Steps to reproduce:

  1. elasticsearchHosts: http://elasticsearch-master:9200
  2. Deploy 8.5.1

Expected behavior:

http should be supported.

Provide logs and/or server output (if relevant):

$ kubectl -n logging logs -f pre-install-kibana-kibana-7nlcw
Creating a new Elasticsearch token for Kibana
Cleaning previous token
TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
    at new NodeError (node:internal/errors:387:5)
    at new ClientRequest (node:_http_client:186:11)
    at Object.request (node:https:357:10)
    at /usr/share/kibana/helm-scripts/..2023_02_23_16_22_35.764612015/manage-es-token.js:64:27
    at new Promise (<anonymous>)
    at requestPromise (/usr/share/kibana/helm-scripts/..2023_02_23_16_22_35.764612015/manage-es-token.js:63:10)
    at createEsToken (/usr/share/kibana/helm-scripts/..2023_02_23_16_22_35.764612015/manage-es-token.js:100:10)
    at Object.<anonymous> (/usr/share/kibana/helm-scripts/..2023_02_23_16_22_35.764612015/manage-es-token.js:144:5)
    at Module._compile (node:internal/modules/cjs/loader:1155:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10) {
  code: 'ERR_INVALID_PROTOCOL'
}

Be careful to obfuscate every secrets (credentials, token, public IP, ...) that could be visible in the output before copy-pasting

Any additional context:

@andrew-pickin-epi
Copy link
Author

See also #1772

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant