我正在嘗試通過該initContainers功能安裝帶有插件的 Kibana,但它似乎沒有創建帶有插件的 pod。
pod 被創建并且 Kibana 完美運行,但是沒有使用下面的 yaml 安裝插件。
initContainers 檔案
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: quickstart
spec:
version: 7.11.2
count: 1
elasticsearchRef:
name: quickstart
podTemplate:
spec:
initContainers:
- name: install-plugins
command:
- sh
- -c
- |
bin/kibana-plugin install https://github.com/fbaligand/kibana-enhanced-table/releases/download/v1.11.2/enhanced-table-1.11.2_7.11.2.zip
uj5u.com熱心網友回復:
通過使用自定義容器映像讓 Kibana 使用插件
檔案
FROM docker.elastic.co/kibana/kibana:7.11.2
RUN /usr/share/kibana/bin/kibana-plugin install https://github.com/fbaligand/kibana-enhanced-table/releases/download/v1.11.2/enhanced-table-1.11.2_7.11.2.zip
RUN /usr/share/kibana/bin/kibana --optimize
雅姆
apiVersion: kibana.k8s.elastic.co/v1
kind: Kibana
metadata:
name: quickstart
spec:
version: 7.11.2
image: my-conatiner-path/kibana-with-plugins:7.11.2
count: 1
elasticsearchRef:
name: quickstart
uj5u.com熱心網友回復:
建立自己的形象肯定會奏效,盡管在這種情況下可以避免。
您的 initContainer 幾乎就是您要找的東西。除了一個例外:您需要添加一些 emptyDir 卷。
將它安裝到您的 initContainer 和常規 kibana 容器,共享您將在 init 期間安裝的插件。
雖然我對 Kibana CR 不熟悉,但我將如何使用 elasti.co 官方圖片執行此操作:
spec:
template:
spec:
containers:
- name: kibana
image: official-kibana:x.y.z
securityContext:
runAsUser: 1000
volumeMounts:
- mountPath: /usr/share/kibana/plugins
name: plugins
initContainers:
- command:
- /bin/bash
- -c
- |
set -xe
if ! ./bin/kibana-plugin list | grep prometheus-exporter >/dev/null; then
if ! ./bin/kibana-plugin install "https://github.com/pjhampton/kibana-prometheus-exporter/releases/download/7.12.1/kibanaPrometheusExporter-7.12.1.zip"; then
echo WARNING: failed to install Kibana exporter plugin
fi
fi
name: init
image: official-kibana:x.y.z
securityContext:
runAsUser: 1000
volumeMounts:
- mountPath: /usr/share/kibana/plugins
name: plugins
volumes:
- emptyDir: {}
name: plugins
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/323682.html
標籤:弹性搜索 Kubernetes 基巴纳 azure-aks
