{"id":276,"date":"2018-11-20T15:01:56","date_gmt":"2018-11-20T12:01:56","guid":{"rendered":"https:\/\/artem.services\/?p=276"},"modified":"2018-11-22T13:09:39","modified_gmt":"2018-11-22T10:09:39","slug":"graylog2-%d0%b7%d0%b0%d0%bf%d1%83%d1%81%d0%ba-%d0%b2-kubernetes","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=276","title":{"rendered":"Graylog2 &#8212; \u0417\u0430\u043f\u0443\u0441\u043a \u0432 Kubernetes"},"content":{"rendered":"<h4><img loading=\"lazy\" class=\"alignnone size-full wp-image-277\" src=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/Graylog-Logo.png\" alt=\"\" width=\"915\" height=\"300\" srcset=\"https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/Graylog-Logo.png 915w, https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/Graylog-Logo-300x98.png 300w, https:\/\/artem.services\/wp-content\/uploads\/2018\/11\/Graylog-Logo-768x252.png 768w\" sizes=\"(max-width: 915px) 100vw, 915px\" \/><\/h4>\n<h4>\u0421\u0435\u0440\u0432\u0438\u0441\u044b \u0432 <strong>Kubernetes<\/strong>:<\/h4>\n<ul>\n<li><strong>Elasticsearch<\/strong> &#8212; <strong>elasticsearch<\/strong><\/li>\n<li><strong>MongoDB<\/strong> &#8212; <strong>mongodb-main<\/strong><\/li>\n<\/ul>\n<p><strong>Namespace<\/strong>: <strong>staging<\/strong><\/p>\n<p><strong>URL<\/strong> \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u0432 <strong>Web UI<\/strong>: <strong>graylog.domain.com<\/strong><\/p>\n<h4>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f &quot;<strong>PASSWORD_SECRET<\/strong>&quot; \u0438 \u0445\u0435\u0448 \u043f\u0430\u0440\u043e\u043b\u044f &quot;<strong>ROOT_PASSWORD_SHA2<\/strong>&quot;<\/h4>\n<p><strong>PASSWORD_SECRET<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npwgen -s 80 1\r\n<\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 &quot;<strong>pwgen<\/strong>&quot; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0442\u043e \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/p>\n<p><strong>ROOT_PASSWORD_SHA2<\/strong>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\necho -n &quot;Enter Password: &quot; &amp;&amp; head -1 &lt;\/dev\/stdin | tr -d '\\n' | sha256sum | cut -d&quot; &quot; -f1\r\n<\/pre>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0445\u0435\u0448:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nEnter Password: qwerty\r\n\r\n65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5\r\n<\/pre>\n<h1><\/h1>\n<p><!--more--><\/p>\n<h1>manifest.yml<\/h1>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\napiVersion: v1\r\nkind: ConfigMap\r\nmetadata:\r\n  name: graylog-config\r\n  namespace: staging\r\n  labels:\r\n    app: graylog-app\r\ndata:\r\n  GRAYLOG_REST_LISTEN_URI: &quot;http:\/\/0.0.0.0:9000\/api\/&quot;\r\n  GRAYLOG_WEB_LISTEN_URI: &quot;http:\/\/0.0.0.0:9000\/&quot;\r\n  GRAYLOG_WEB_ENDPOINT_URI: &quot;https:\/\/graylog.domain.com\/api\/&quot;\r\n  GRAYLOG_PASSWORD_SECRET: &quot;0JKrvpOPrAxH2GDlnZEc0hOcLPLxqMlacCxQnJOB7QOvA2S8AEaZWZtYJoXzIYTnkW9sDyuVwn4xwd8y&quot;\r\n  GRAYLOG_ROOT_PASSWORD_SHA2: &quot;65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5&quot;\r\n  GRAYLOG_MONGODB_URI: &quot;mongodb:\/\/mongodb-main\/graylog&quot;\r\n  GRAYLOG_MESSAGE_JOURNAL_ENABLED: &quot;false&quot;\r\n  GRAYLOG_ELASTICSEARCH_HOSTS: &quot;http:\/\/elasticsearch:9200&quot;\r\n  GRAYLOG_ELASTICSEARCH_DISCOVERY_ENABLED: &quot;true&quot;\r\n  GRAYLOG_ROOT_TIMEZONE: &quot;Europe\/Kiev&quot;\r\n\r\n---\r\n\r\napiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: graylog-app\r\n  namespace: staging\r\n  labels:\r\n    app: graylog-app\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    matchLabels:\r\n      app: graylog-app\r\n  strategy:\r\n    type: RollingUpdate\r\n  progressDeadlineSeconds: 300\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: graylog-app\r\n    spec:\r\n      containers:\r\n      - image: graylog\/graylog:2.4\r\n        name: graylog\r\n        imagePullPolicy: &quot;IfNotPresent&quot;\r\n        ports:\r\n          - containerPort: 9000\r\n          - containerPort: 12201\r\n          - containerPort: 514\r\n        envFrom:\r\n            - configMapRef:\r\n                name: graylog-config\r\n      nodeSelector:\r\n        nodegroup: staging\r\n\r\n---\r\n\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: graylog-svc\r\n  namespace: staging\r\nspec:\r\n  ports:\r\n  - name: web\r\n    port: 9000\r\n    protocol: TCP\r\n  - name: gelf\r\n    port: 12201\r\n    protocol: UDP\r\n  - name: syslog\r\n    port: 514\r\n    protocol: UDP\r\n  selector:\r\n    app: graylog-app\r\n\r\n---\r\n\r\napiVersion: extensions\/v1beta1\r\nkind: Ingress\r\nmetadata:\r\n  name: graylog-ing\r\n  namespace: staging\r\n  annotations:\r\n    kubernetes.io\/ingress.class: ingress-staging\r\n    certmanager.k8s.io\/cluster-issuer: letsencrypt-production\r\n    certmanager.k8s.io\/acme-challenge-type: dns01\r\n    certmanager.k8s.io\/acme-dns01-provider: dns\r\n    nginx.ingress.kubernetes.io\/rewrite-target: \/\r\n    nginx.ingress.kubernetes.io\/proxy-body-size: &quot;0&quot;\r\nspec:\r\n  tls:\r\n  - hosts:\r\n    - graylog.domain.com\r\n    secretName: graylog.domain.com-secret-tls\r\n  rules:\r\n  - host: graylog.domain.com\r\n    http:\r\n      paths:\r\n      - path: \/\r\n        backend:\r\n          serviceName: graylog-svc\r\n          servicePort: 9000\r\n<\/pre>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nkubectl apply -f manifest.yml\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0435\u0440\u0432\u0438\u0441\u044b \u0432 Kubernetes: Elasticsearch &#8212; elasticsearch MongoDB &#8212; mongodb-main Namespace: staging URL \u0434\u043b\u044f \u0432\u0445\u043e\u0434\u0430 \u0432 Web UI: graylog.domain.com \u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f &quot;PASSWORD_SECRET&quot; \u0438 \u0445\u0435\u0448 \u043f\u0430\u0440\u043e\u043b\u044f &quot;ROOT_PASSWORD_SHA2&quot; PASSWORD_SECRET: \u0415\u0441\u043b\u0438 \u043f\u0430\u043a\u0435\u0442 &quot;pwgen&quot; \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435, \u0442\u043e \u0435\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c. ROOT_PASSWORD_SHA2: \u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0435\u0433\u043e \u0445\u0435\u0448:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,20],"tags":[28,64,17],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/276"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=276"}],"version-history":[{"count":5,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/276\/revisions"}],"predecessor-version":[{"id":284,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/276\/revisions\/284"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=276"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=276"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}