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

2022-02-12 23:37:22 浏览数 (1)

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

yaml如下:

代码语言:yaml复制
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

0 人点赞