2022-02-12:k8s安装es,yaml如何写?

2022-03-04 15:12:11 浏览数 (1)

2022-02-12:k8s安装es,yaml如何写?

yaml如下:

代码语言:javascript复制
apiVersion: v1
kind: Service
metadata:
  labels:
    app: elasticsearch
  name: elasticsearch
  namespace: moonfdd
spec:
  ports:
    - name: 9200-9200
      port: 9200
      protocol: TCP
      targetPort: 9200
    - name: 5601-5601
      port: 5601
      protocol: TCP
      targetPort: 5601
  selector:
    app: elasticsearch
  type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: elasticsearch
  name: elasticsearch
  namespace: moonfdd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: elasticsearch
  template:
    metadata:
      labels:
        app: elasticsearch
    spec:
      containers:
        - env:
            - name: discovery.type
              value: single-node
          image: 'elasticsearch:7.14.0'
          imagePullPolicy: Always
          name: elasticsearch
          terminationMessagePolicy: File
        - image: 'kibana:7.14.0'
          imagePullPolicy: IfNotPresent
          name: kibana
        - image: 'mobz/elasticsearch-head:5'
          imagePullPolicy: IfNotPresent
          name: elasticsearch-head

结果如下:

[es的yaml](https://gitee.com/moonfdd/k8syaml/blob/master/moonfdd/elasticsearch.yaml)

0 人点赞