在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):fabric8io/elasticsearch-cloud-kubernetes开源软件地址(OpenSource Url):https://github.com/fabric8io/elasticsearch-cloud-kubernetes开源编程语言(OpenSource Language):Java 81.6%开源软件介绍(OpenSource Introduction):This plugin is no longer under active development and can be replaced by utilizing a headless service as noted belowKubernetes Cloud Plugin for Elasticsearch:The Kubernetes Cloud plugin allows to use Kubernetes API for the unicast discovery mechanism. Alternatively, you can utilize headless services:
elasticsearch.yml:
NOTE: You are highly encouraged to use headless services as the they obsolete this plugin. Installation
Versions availableAs of Older versions:
Kubernetes Pod DiscoveryKubernetes Pod discovery allows to use the kubernetes APIs to perform automatic discovery. Here is a simple sample configuration: cloud:
kubernetes:
service: ${SERVICE}
namespace: ${NAMESPACE}
discovery.zen.hosts_provider: kubernetes
path:
data: /data/data
logs: /data/log Kubernetes authThe preferred way to authenticate to Kubernetes is to use service accounts. This is fully supported by this Elasticsearch Kubernetes plugin as it uses the Fabric8 Kubernetes API client. As an example, to create a service account do something like:
This creates a service account called
This will mount the service account token at Kubernetes exampleIn this example, we're going to use a headless service to look up the Elasticsearch cluster nodes to join. The following manifest uses 3 replication controllers to created Elasticsearch pods in 3 different modes:
We use 2 services as well:
kind: "List"
apiVersion: "v1"
items:
- apiVersion: "v1"
kind: "Service"
metadata:
name: "elasticsearch"
spec:
ports:
- port: 9200
targetPort: "http"
selector:
component: "elasticsearch"
type: "coordinating-only"
provider: "fabric8"
type: "LoadBalancer"
- apiVersion: "v1"
kind: "Service"
metadata:
name: "elasticsearch-cluster"
spec:
clusterIP: "None"
ports:
- port: 9300
targetPort: 9300
selector:
provider: "fabric8"
component: "elasticsearch"
- apiVersion: "v1"
kind: "ReplicationController"
metadata:
name: "elasticsearch-data"
spec:
replicas: 1
selector:
component: "elasticsearch"
type: "data"
provider: "fabric8"
template:
metadata:
labels:
component: "elasticsearch"
type: "data"
provider: "fabric8"
spec:
serviceAccount: elasticsearch
serviceAccountName: elasticsearch
containers:
- env:
- name: "SERVICE"
value: "elasticsearch-cluster"
- name: "KUBERNETES_NAMESPACE"
valueFrom:
fieldRef:
fieldPath: "metadata.namespace"
- name: "NODE_MASTER"
value: "false"
image: "fabric8/elasticsearch-k8s:6.2.3"
name: "elasticsearch"
ports:
- containerPort: 9300
name: "transport"
volumeMounts:
- mountPath: "/usr/share/elasticsearch/data"
name: "elasticsearch-data"
readOnly: false
volumes:
- emptyDir:
medium: ""
name: "elasticsearch-data"
- apiVersion: "v1"
kind: "ReplicationController"
metadata:
name: "elasticsearch-master"
spec:
replicas: 1
selector:
component: "elasticsearch"
type: "master"
provider: "fabric8"
template:
metadata:
labels:
component: "elasticsearch"
type: "master"
provider: "fabric8"
spec:
serviceAccount: elasticsearch
serviceAccountName: elasticsearch
containers:
- env:
- name: "SERVICE"
value: "elasticsearch-cluster"
- name: "KUBERNETES_NAMESPACE"
valueFrom:
fieldRef:
fieldPath: "metadata.namespace"
- name: "NODE_DATA"
value: "false"
image: "fabric8/elasticsearch-k8s:6.2.3"
name: "elasticsearch"
ports:
- containerPort: 9300
name: "transport"
- apiVersion: "v1"
kind: "ReplicationController"
metadata:
name: "elasticsearch-coordinating-only"
spec:
replicas: 1
selector:
component: "elasticsearch"
type: "coordinating-only"
provider: "fabric8"
template:
metadata:
labels:
component: "elasticsearch"
type: "coordinating-only"
provider: "fabric8"
spec:
serviceAccount: elasticsearch
serviceAccountName: elasticsearch
containers:
- env:
- name: "SERVICE"
value: "elasticsearch-cluster"
- name: "KUBERNETES_NAMESPACE"
valueFrom:
fieldRef:
fieldPath: "metadata.namespace"
- name: "NODE_DATA"
value: "false"
- name: "NODE_MASTER"
value: "false"
image: "fabric8/elasticsearch-k8s:6.2.3"
name: "elasticsearch"
ports:
- containerPort: 9200
name: "http"
- containerPort: 9300
name: "transport" |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论