aki0000 / k8s-myplayground

0 stars 0 forks source link

ElasticSearch #11

Closed aki0000 closed 3 years ago

aki0000 commented 3 years ago

I suggest repo for elasticseach needs to be installed by helm. Elasticseach image for debian is not applied according to the official.

 helm search repo Elasticsearch
NAME                                                    CHART VERSION   APP VERSION     DESCRIPTION
prometheus-community/prometheus-elasticsearch-e...      4.3.0           1.1.0           Elasticsearch stats exporter for Prometheus
stable/elasticsearch                                    1.32.5          6.8.6           DEPRECATED Flexible and powerful open source, d...
stable/elasticsearch-curator                            2.2.3           5.7.6           DEPRECATED A Helm chart for Elasticsearch Curator
stable/elasticsearch-exporter                           3.7.1           1.1.0           DEPRECATED Elasticsearch stats exporter for Pro...
stable/fluentd-elasticsearch                            2.0.7           2.3.2           DEPRECATED! - A Fluentd Helm chart for Kubernet...
stable/apm-server                                       2.1.7           7.0.0           DEPRECATED The server receives data from the El...
stable/dmarc2logstash                                   1.3.1           1.0.3           DEPRECATED Provides a POP3-polled DMARC XML rep...
stable/elastabot                                        1.2.1           1.1.0           DEPRECATED A Helm chart for Elastabot - a Slack...
stable/elastalert                                       1.5.1           0.2.4           DEPRECATED ElastAlert is a simple framework for...
stable/fluentd                                          2.5.3           v2.4.0          DEPRECATED A Fluentd Elasticsearch Helm chart f...
stable/kibana                                           3.2.8           6.7.0           DEPRECATED - Kibana is an open source data visu...
aki0000 commented 3 years ago

install repo of elasticseach by helm

 helm install elasticsearch elastic/elasticsearch -n monitoring --values values.yaml
---
values.yaml
imageTag: 7.9.1

replicas: 1

# Permit co-located instances for solitary minikube virtual machines.
antiAffinity: "soft"

# Shrink default JVM heap.
esJavaOpts: "-Xmx128m -Xms128m"

# Allocate smaller chunks of memory per pod.
resources:
  requests:
    cpu: "100m"
    memory: "512M"
  limits:
    cpu: "1000m"
    memory: "512M"

# Request smaller persistent volumes.
volumeClaimTemplate:
  accessModes: [ "ReadWriteOnce" ]
  storageClassName: "standard"
  resources:
    requests:
      storage: 100M
aki0000 commented 3 years ago

After deployed it, I got error message for els pod


Events:
  Type     Reason            Age                   From               Message
  ----     ------            ----                  ----               -------
  Warning  FailedScheduling  2m22s (x18 over 16m)  default-scheduler  0/3 nodes are available: 3 pod has unbound immediate PersistentVolumeClaims.
  Normal   Scheduled         2m12s                 default-scheduler  Successfully assigned monitoring/elasticsearch-master-0 to ras02
  Warning  FailedMount       62s (x8 over 2m11s)   kubelet            MountVolume.SetUp failed for volume "elasticsearch-pv" : mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t nfs 192.168.100.109:/mnt/data/elasticsearch /var/lib/kubelet/pods/69087a02-b937-4f68-96d4-e07fd132294c/volumes/kubernetes.io~nfs/elasticsearch-pv
Output: mount.nfs: access denied by server while mounting 192.168.100.109:/mnt/data/elasticsearch
  Warning  FailedMount  8s  kubelet  Unable to attach or mount volumes: unmounted volumes=[elasticsearch-master], unattached volumes=[default-token-l5892 elasticsearch-master]: timed out waiting for the condition
aki0000 commented 3 years ago

https://stackoverflow.com/questions/45360084/kubernetes-mount-nfs-access-denied-by-server-while-mounting

aki0000 commented 3 years ago
 chmod 666 /your/folder/
aki0000 commented 3 years ago

els is not support armv7l officially......... need to set up a pkg for armv7l manually

aki0000 commented 3 years ago

After #6 , single node has been deployed.

apiVersion: apps/v1
kind: StatefulSet
metadata:
  creationTimestamp: null
  labels:
    app: {{ .Release.Name }}
  name: {{ .Release.Name }}
  namespace: {{ .Release.Namespace }}
spec:
  replicas: 1
  serviceName: "elasticseach"
  selector:
    matchLabels:
      app: {{ .Release.Name }}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: {{ .Release.Name }}
    spec:
      securityContext:
      containers:
      - image: docker.elastic.co/elasticsearch/elasticsearch:7.12.0
        name: {{ .Release.Name }}
        volumeMounts:
        - name: {{ .Release.Name }}-data
          mountPath: /data
        env:
        - name: discovery.type
          value: single-node
        ports:
        - containerPort: 9200
          name: api
        - containerPort: 9300
          name: gossip 
      volumes: 
      - name: {{ .Release.Name }}-data
        persistentVolumeClaim:
          claimName: {{ .Release.Name }}-pvc
monitoring       elasticsearch-0                   1/1     Running   0          8m2s