# 配置pod的反亲和性规则,默认配置将使pod不会部署在同一个节点。 # By default this will make sure two pods don't end up on the same node # Changing this to a region would allow you to spread pods across regions antiAffinityTopologyKey:"kubernetes.io/hostname"
# 配置网络策略 networkPolicy: ## Enable creation of NetworkPolicy resources. Only Ingress traffic is filtered for now. ## In order for a Pod to access Elasticsearch, it needs to have the following label: ## {{ template "uname" . }}-client: "true" ## Example for default configuration to access HTTP port: ## elasticsearch-master-http-client: "true" ## Example for default configuration to access transport port: ## elasticsearch-master-transport-client: "true"
http: enabled:false ## if explicitNamespacesSelector is not set or set to {}, only client Pods being in the networkPolicy's namespace ## and matching all criteria can reach the DB. ## But sometimes, we want the Pods to be accessible to clients from other namespaces, in this case, we can use this ## parameter to select these namespaces ## # explicitNamespacesSelector: # # Accept from namespaces with all those different rules (only from whitelisted Pods) # matchLabels: # role: frontend # matchExpressions: # - {key: role, operator: In, values: [frontend]}
## Additional NetworkPolicy Ingress "from" rules to set. Note that all rules are OR-ed. ## # additionalRules: # - podSelector: # matchLabels: # role: frontend # - podSelector: # matchExpressions: # - key: role # operator: In # values: # - frontend
transport: ## Note that all Elasticsearch Pods can talks to themselves using transport port even if enabled. enabled:false # explicitNamespacesSelector: # matchLabels: # role: frontend # matchExpressions: # - {key: role, operator: In, values: [frontend]} # additionalRules: # - podSelector: # matchLabels: # role: frontend # - podSelector: # matchExpressions: # - key: role # operator: In # values: # - frontend
使用helm install安装es集群到pika名称空间
1
$ helm install elastic-m4nyhd -n pika ./
查看helm安装状态
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
$ kubectl get all -n pika NAME READY STATUS RESTARTS AGE pod/elasticsearch-master-0 1/1 Running 0 10m pod/elasticsearch-master-1 1/1 Running 0 11m pod/elasticsearch-master-2 1/1 Running 0 12m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/elasticsearch-master NodePort 172.16.46.13 <none> 9200:32222/TCP,9300:31061/TCP 52m service/elasticsearch-master-headless ClusterIP None <none> 9200/TCP,9300/TCP 52m
NAME READY AGE statefulset.apps/elasticsearch-master 3/3 52m
$ helm list -n pika NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION elastic-m4nyhd pika 2 2021-07-02 15:31:59.950721086 +0800 CST deployed elasticsearch-0.0.6 7.13.2