kubernetes に mongoDB と elasticsearch と共に graylog を設定しています。
これは、環境変数のグレイログの仕様です。値を渡しています。
spec:
terminationGracePeriodSeconds: 70
initContainers:
- name: set-dir-owner
image: busybox:1.29.2
securityContext:
privileged: true
command: ['sh', '-c' ,'chown -R 1100:1100 /usr/share/graylog/data/journal', 'chmod 777 /usr/share/graylog/data/journal//graylog2-committed-read-offset', 'chmod g+rwx /usr/share/graylog/data/journal//graylog2-committed-read-offset', 'chgrp 1100 /usr/share/graylog/data/journal/graylog2-committed-read-offset', 'chown -R 1100:1100 ./graylog_journal', 'chown -R 1100:1100 /usr/share/graylog/data/journal', 'chown -R 1100:1100 /usr/share/graylog/data/journal/graylog2-committed-read-offset']
volumeMounts:
- name: graylog-persistent-storage
mountPath: /usr/share/graylog/data/journal
containers:
- name: graylog-master
image: "graylog/graylog:3.0"
securityContext:
privileged: true
runAsUser: 1100
env:
- name: GRAYLOG_PASSWORD_SECRET
value: {{required "A valid .Values.graylog.passwordSecret entry required!" .Values.graylog.passwordSecret }}
- name: GRAYLOG_ROOT_PASSWORD_SHA2
value: {{ .Values.graylog.passwordSecret | sha256sum }}
- name: GRAYLOG_MONGODB_URI
value: "mongodb://{{ $mongodbServiceName }}-0.{{ $mongodbServiceName }}:27017/graylog?replicaSet=rs0"
- name: GRAYLOG_IS_MASTER
value: "true"
- name: GRAYLOG_ELASTICSEARCH_DISCOVERY_ZEN_PING_UNICAST_HOSTS
value: "{{ $elasticsearchServiceName }}-0.{{ $elasticsearchServiceName }}:9300"
- name: GRAYLOG_ELASTICSEARCH_HOSTS
value: "http://{{ $elasticsearchServiceName }}-0.{{ $elasticsearchServiceName }}:9200"
- name: GRAYLOG_WEB_LISTEN_URI
value: "{{ $externalProtocol }}s://{{ .Release.Name }}.{{ $externalDomain }}{{ if not .Values.ingress.enabled }}:31300{{ end }}"
- name: GRAYLOG_REST_LISTEN_URI
value: "{{ $externalProtocol }}s://{{ .Release.Name }}.{{ $externalDomain }}{{ if not .Values.ingress.enabled }}:31300{{ end }}/api"
- name: GRAYLOG_HTTP_PUBLISH_URI
value: "{{ $externalProtocol }}s://{{ .Release.Name }}.{{ $externalDomain }}{{ if not .Values.ingress.enabled }}:31300{{ end }}"
- name: GRAYLOG_HTTP_EXTERNAL_URI
value: "{{ $externalProtocol }}s://{{ .Release.Name }}.{{ $externalDomain }}{{ if not .Values.ingress.enabled }}:31300{{ end }}/"
- name: GRAYLOG_WEB_ENDPOINT_URI
value: "{{ $externalProtocol }}s://{{ .Release.Name }}.{{ $externalDomain }}{{ if not .Values.ingress.enabled }}:31300{{ end }}"
- name: GRAYLOG_SERVER_JAVA_OPTS
value: "-Xms1g -Xmx1g -XX:NewRatio=1 -XX:MaxMetaspaceSize=256m -server -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow"
ports:
- containerPort: {{ .Values.graylog.web.service.internalPort }}
name: http
- containerPort: 12201
name: udp-input
- containerPort: 1514
name: tcp-input
volumeMounts:
- name: graylog-persistent-storage
mountPath: /usr/share/graylog/data/journal
subPath: graylog
resources:
{{ toYaml .Values.graylog.master.containers.resources | indent 12 }}
readinessProbe:
httpGet:
path: /api/system/lbstatus
port: {{ .Values.graylog.web.service.internalPort }}
initialDelaySeconds: 30
periodSeconds: 3
timeoutSeconds: 3
successThreshold: 1
failureThreshold: 4
私がする時
kubectl get pods
NAME READY STATUS RESTARTS AGE
test-logs-graylog-elasticsearch-0 1/1 Running 0 4m
test-logs-graylog-master-0 0/1 Running 0 4m
test-logs-graylog-slave-0 0/1 Running 0 4m
test-logs-mongodb-replicaset-0 1/1 Running 0 4m
ステータス実行中は READY 状態になりません。
私は試したkubectl describe pod test-logs-graylog-master-0
Normal Started 18m kubelet, gke-wotnot-staging-cluster-pool-1-3420ace9-s7sn Started container
Warning Unhealthy 3m49s (x290 over 18m) kubelet, gke-wotnot-staging-cluster-pool-1-3420ace9-s7sn Readiness probe failed: Get http://10.8.3.86:9000/api/system/lbstatus: dial tcp 10.8.3.86:9000: connect: connection refused
Readiness プローブでは、いくつかの IP を設定しています。Web インターフェイスとすべてを設定する環境で、graylog ドキュメント (ここをクリック) からすべての構成を試しました。