{"id":320801,"date":"2021-04-03T21:00:44","date_gmt":"2021-04-03T21:00:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=320801"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2021-04-03T21:00:44","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=320801","title":{"rendered":"Spring Boot \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Kubernetes \u0441 Postgresql \u0438 Loki"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p> \u0422\u0435\u043c\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f  Spring Boot  \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432  Kubernetes  \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0443\u0436\u0435 \u043d\u0435 \u043d\u043e\u0432\u0430\u044f \u0438 \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0439 , \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u0443\u0436\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f ,\u043d\u043e \u0438 \u043e \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 ,\u0430 \u0438\u043c\u0435\u043d\u043d\u043e :  \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445,  \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 ,\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u0430 \u0438 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 :<\/p>\n<ol>\n<li>\n<p>Spring Boot  \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0411\u0414  PostgreSQL<\/p>\n<\/li>\n<li>\n<p>Docker \u043e\u0431\u0440\u0430\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>Docker  Grafana (dashboard  \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p>Docker  \u043e\u0431\u0440\u0430\u0437  <a href=\"https:\/\/grafana.com\/oss\/loki\/\" rel=\"noopener noreferrer nofollow\">Loki<\/a><code>(<\/code>\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u0430 \u043b\u043e\u0433\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/grafana.com\/docs\/loki\/latest\/clients\/promtail\/\" rel=\"noopener noreferrer nofollow\">Promtail<\/a> (\u0430\u0433\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0442\u0441\u044b\u043b\u043a\u0438 \u043b\u043e\u0433\u043e\u0432 \u0432  Loki).<\/p>\n<p> Kubernetes cluster  \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438  <a href=\"https:\/\/microk8s.io\/\" rel=\"noopener noreferrer nofollow\">microk8s<\/a>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438   \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430  \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c nginx, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435   nginx-ingress-controller, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u0432  microk8s.<\/p>\n<p><sup><br \/><\/sup><\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/xt\/oh\/jh\/xtohjhxr7x747ix6z7oy45ywslw.png\" width=\"1910\" height=\"710\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u0428\u0430\u0433 1:  \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>\u0414\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 yaml<\/p>\n<pre><code>apiVersion: v1 kind: Service metadata:   name: db spec:   ports:     - port: 5432   selector:     app: db   clusterIP: None --- apiVersion: apps\/v1 kind: Deployment metadata:   name: db spec:   selector:     matchLabels:       app: db   strategy:     type: Recreate   template:     metadata:       labels:         app: db     spec:       containers:         - image: postgres:9.6           name: db           env:             - name: POSTGRES_USER               value: admin              - name: POSTGRES_PASSWORD               value: admin              - name: POSTGRES_DB               value: dbname            ports:             - containerPort: 5432               name: db <\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0438\u0441\u0430\u043d \u0438 \u0441\u0435\u0440\u0432\u0438\u0441, \u0438  \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b. \u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0437 ,\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043e\u0431\u0440\u0430\u0437  Postgres 9.6<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u043c  \u043a\u043e\u043c\u0430\u043d\u0434\u0443<code>kubectl apply -f db.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 2: Grafana<\/h4>\n<p> \u0414\u043b\u044f  Grafana  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c   \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 yaml<\/p>\n<pre><code>apiVersion: v1 kind: Service metadata:   name: grafana spec:   ports:     - port: 3000   selector:     app: grafana   clusterIP: None ---  apiVersion: apps\/v1 kind: Deployment metadata:   name: grafana spec:   selector:     matchLabels:       app: grafana   strategy:     type: Recreate   template:     metadata:       labels:         app: grafana     spec:       containers:         - image: grafana\/grafana:master           name: grafana             ports:             - containerPort: 3000               name: grafana<\/code><\/pre>\n<p> \u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043e\u0431\u0440\u0430\u0437\u0435 (grafana\/grafana:master) \u0438 \u0432 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u043c \u043f\u043e\u0440\u0442\u0435.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<code>kubectl apply -f  grafana.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 3: Loki<\/h4>\n<p>\u041a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435  yaml<\/p>\n<pre><code>apiVersion: v1 kind: Service metadata:   name: loki spec:   ports:     - port: 3100   selector:     app: loki   clusterIP: None ---  apiVersion: apps\/v1 kind: Deployment metadata:   name: loki spec:   selector:     matchLabels:       app: loki   strategy:     type: Recreate   template:     metadata:       labels:         app: loki     spec:       containers:         - image: grafana\/loki:latest           name: loki             ports:             - containerPort: 3100               name: loki <\/code><\/pre>\n<p> \u0418 \u043a\u043e\u043c\u0430\u043d\u0434\u0430<code>kubectl apply -f  grafana.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 4:   Promtail<\/h4>\n<p>\u0414\u043b\u044f promtail  \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f  <a href=\"https:\/\/helm.sh\/\" rel=\"noopener noreferrer nofollow\">Helm<\/a>.  \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c  helm,  \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432  microk8s(\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 2 \u0438 3). \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c  Helm  \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432  \u0444\u0430\u0439\u043b\u0435 config, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0432  \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 .kube, \u0443\u043a\u0430\u0437\u0430\u0442\u044c  ip  \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c  <code>microk8s config <\/code><\/p>\n<h4>\u0428\u0430\u0433 5: Ingress<\/h4>\n<p>\u0414\u043b\u044f  nginx  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<pre><code>apiVersion: networking.k8s.io\/v1 kind: Ingress metadata:   name: server spec:   rules:      #for nginxinc controller host should be set     - http:         paths:           - path: \/             pathType: Prefix             backend:               service:                 name: server                 port:                   number: 8024                              - path: \/grafana             pathType: Prefix             backend:               service:                 name: grafana                 port:                   number: 3000        <\/code><\/pre>\n<p>\u0418 \u043a\u043e\u043c\u0430\u043d\u0434\u0443  <code>kubectl apply -f ingress.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 7:  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e  yaml  \u0438 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e  Docker  \u043e\u0431\u0440\u0430\u0437\u0430.  \u041d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435  \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f  Maven +  <a href=\"https:\/\/www.eclipse.org\/jkube\/\" rel=\"noopener noreferrer nofollow\">jkube maven plugin<\/a> <\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/ec\/qf\/za\/ecqfzatqjzn4he5luhhbqtailmg.png\" width=\"1140\" height=\"800\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430   <code>install <\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442  jar \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0437\u0430\u0442\u0435\u043c  <code>k8s:resource<\/code>   \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u043e\u0442\u043e\u043c  <code>k8s:build <\/code>\u0441\u043e\u0437\u0434\u0430\u0441\u0442  Docker o\u0431\u0440\u0430\u0437 \u0438  k8s:deploy  \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/p>\n<pre><code>&lt;profile&gt;             &lt;id&gt;kube&lt;\/id&gt;             &lt;properties&gt;                 &lt;spring.profiles.active&gt;docker&lt;\/spring.profiles.active&gt;             &lt;\/properties&gt;             &lt;build&gt;                 &lt;plugins&gt;                     &lt;plugin&gt;                         &lt;groupId&gt;org.eclipse.jkube&lt;\/groupId&gt;                         &lt;artifactId&gt;kubernetes-maven-plugin&lt;\/artifactId&gt;                         &lt;version&gt;1.1.1&lt;\/version&gt;                         &lt;configuration&gt;                             &lt;verbose&gt;true&lt;\/verbose&gt;                                        &lt;images&gt;                                 &lt;image&gt;                                     &lt;name&gt;imagename:latest&lt;\/name&gt;                                     &lt;alias&gt;some-alias\/alias&gt;                                     &lt;build&gt;                                         &lt;maintainer&gt;John Smith&lt;\/maintainer&gt;                                         &lt;from&gt;fabric8\/java-centos-openjdk11-jre&lt;\/from&gt;                                         &lt;assembly&gt;                                             &lt;inline&gt;                                                 &lt;baseDirectory&gt;\/deployments&lt;\/baseDirectory&gt;                                             &lt;\/inline&gt;                                          &lt;\/assembly&gt;                                     &lt;\/build&gt;                                 &lt;\/image&gt;                             &lt;\/images&gt;                          &lt;\/configuration&gt;                         &lt;executions&gt;                             &lt;execution&gt;                                 &lt;id&gt;run&lt;\/id&gt;                                 &lt;goals&gt;                                     &lt;goal&gt;resource&lt;\/goal&gt;                                     &lt;goal&gt;build&lt;\/goal&gt;                                     &lt;goal&gt;deploy&lt;\/goal&gt;                                 &lt;\/goals&gt;                             &lt;\/execution&gt;                         &lt;\/executions&gt;                     &lt;\/plugin&gt;                 &lt;\/plugins&gt;             &lt;\/build&gt;          &lt;\/profile&gt;<\/code><\/pre>\n<p> \u041e\u0431\u0440\u0430\u0437 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u0434 \u0442\u0435\u0433\u043e\u043c  image.  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c   \u043e\u0434\u0438\u043d \u0438\u0437 <a href=\"https:\/\/www.eclipse.org\/jkube\/docs\/kubernetes-maven-plugin#generators\" rel=\"noopener noreferrer nofollow\">\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/a><\/p>\n<p> \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c<\/p>\n<p><code>kubectl expose deployment server --type=LoadBalancer --name=server --port=&lt;some-port&gt;<\/code><\/p>\n<p> \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0432\u0435\u0434\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435? \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0431\u044b\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0434\u0435 :  \u0432\u043c\u0435\u0441\u0442\u043e  ip  \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442  \u0441\u0442\u0440\u043e\u043a\u0430  <code>tcp:\/\/&lt;ip-service&gt;.<\/code> \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a  NumberFormatException. <\/p>\n<h4>\u0428\u0430\u0433 8:  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h4>\n<p> \u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  curl  \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e  localhost  \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f,  localhost\/grafana  \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443  \u0432\u0445\u043e\u0434\u0430 \u0432  Grafana.<\/p>\n<h4>\u0428\u0430\u0433 9:  \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043b\u043e\u0433\u0438<\/h4>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0439\u0442\u0438 \u0432  Grafana  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043b\u043e\u0433\u0438\u043d\u0430\/\u043f\u0430\u0440\u043e\u043b\u044f  admin . \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c ,\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  Loki(http:\/\/loki:3000).  \u0417\u0430\u0442\u0435\u043c \u0432 explore  \u0432\u0432\u0435\u0441\u0442\u0438  {app=&#187;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f&#187;} .<\/p>\n<h4>P.S.<\/h4>\n<p>\u0421\u0431\u043e\u0440 \u043b\u043e\u0433\u043e\u0432 \u0431\u044b\u043b \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 <a href=\"https:\/\/medium.com\/@psingh.singh361\/loki-setup-for-kubernetes-cluster-b7403e137591\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/550554\/\"> https:\/\/habr.com\/ru\/post\/550554\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p> \u0422\u0435\u043c\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f  Spring Boot  \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432  Kubernetes  \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0443\u0436\u0435 \u043d\u0435 \u043d\u043e\u0432\u0430\u044f \u0438 \u043d\u0430 \u043c\u043d\u043e\u0433\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u0445, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0434\u0430\u043d\u043d\u044b\u0439 , \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0435\u043c\u0430\u043b\u043e \u0443\u0436\u0435 \u0441\u0442\u0430\u0442\u0435\u0439 \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u0430\u043c\u0438. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u044f \u0431\u044b \u0445\u043e\u0442\u0435\u043b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0438 \u0441\u0430\u043c\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f ,\u043d\u043e \u0438 \u043e \u0441\u043e\u043f\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u0445 ,\u0430 \u0438\u043c\u0435\u043d\u043d\u043e :  \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445,  \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 ,\u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u0430 \u0438 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432.<\/p>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e \u0432\u0441\u0435\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430\u0445 :<\/p>\n<ol>\n<li>\n<p>Spring Boot  \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0411\u0414  PostgreSQL<\/p>\n<\/li>\n<li>\n<p>Docker \u043e\u0431\u0440\u0430\u0437 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445<\/p>\n<\/li>\n<li>\n<p>Docker  Grafana (dashboard  \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043b\u043e\u0433\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p>Docker  \u043e\u0431\u0440\u0430\u0437  <a href=\"https:\/\/grafana.com\/oss\/loki\/\" rel=\"noopener noreferrer nofollow\">Loki<\/a><code>(<\/code>\u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u0431\u043e\u0440\u0430 \u043b\u043e\u0433\u043e\u0432)<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/grafana.com\/docs\/loki\/latest\/clients\/promtail\/\" rel=\"noopener noreferrer nofollow\">Promtail<\/a> (\u0430\u0433\u0435\u043d\u0442 \u0434\u043b\u044f \u043e\u0442\u0441\u044b\u043b\u043a\u0438 \u043b\u043e\u0433\u043e\u0432 \u0432  Loki).<\/p>\n<p> Kubernetes cluster  \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438  <a href=\"https:\/\/microk8s.io\/\" rel=\"noopener noreferrer nofollow\">microk8s<\/a>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0438   \u043f\u043e \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u0442\u0435\u043b\u044c\u0441\u0442\u0432\u0443 web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430  \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0441\u0442\u0443\u043f\u0430\u0442\u044c nginx, \u0430 \u0442\u043e\u0447\u043d\u0435\u0435   nginx-ingress-controller, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0435\u0441\u0442\u044c \u0432  microk8s.<\/p>\n<p><sup><br \/><\/sup><\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u0428\u0430\u0433 1:  \u0411\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h4>\n<p>\u0414\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 yaml<\/p>\n<pre><code>apiVersion: v1 kind: Service metadata:   name: db spec:   ports:     - port: 5432   selector:     app: db   clusterIP: None --- apiVersion: apps\/v1 kind: Deployment metadata:   name: db spec:   selector:     matchLabels:       app: db   strategy:     type: Recreate   template:     metadata:       labels:         app: db     spec:       containers:         - image: postgres:9.6           name: db           env:             - name: POSTGRES_USER               value: admin              - name: POSTGRES_PASSWORD               value: admin              - name: POSTGRES_DB               value: dbname            ports:             - containerPort: 5432               name: db <\/code><\/pre>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u043f\u0438\u0441\u0430\u043d \u0438 \u0441\u0435\u0440\u0432\u0438\u0441, \u0438  \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0431\u0430\u0437\u044b. \u041a\u0430\u043a \u043e\u0431\u0440\u0430\u0437 ,\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u043e\u0431\u0440\u0430\u0437  Postgres 9.6<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0438\u043c  \u043a\u043e\u043c\u0430\u043d\u0434\u0443<code>kubectl apply -f db.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 2: Grafana<\/h4>\n<p> \u0414\u043b\u044f  Grafana  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c   \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 yaml<\/p>\n<pre><code>apiVersion: v1 kind: Service metadata:   name: grafana spec:   ports:     - port: 3000   selector:     app: grafana   clusterIP: None ---  apiVersion: apps\/v1 kind: Deployment metadata:   name: grafana spec:   selector:     matchLabels:       app: grafana   strategy:     type: Recreate   template:     metadata:       labels:         app: grafana     spec:       containers:         - image: grafana\/grafana:master           name: grafana             ports:             - containerPort: 3000               name: grafana<\/code><\/pre>\n<p> \u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0420\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u043e\u0431\u0440\u0430\u0437\u0435 (grafana\/grafana:master) \u0438 \u0432 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u043c \u043f\u043e\u0440\u0442\u0435.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<code>kubectl apply -f  grafana.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 3: Loki<\/h4>\n<p>\u041a\u0430\u043a \u0438 \u0432\u044b\u0448\u0435  yaml<\/p>\n<pre><code>apiVersion: v1 kind: Service metadata:   name: loki spec:   ports:     - port: 3100   selector:     app: loki   clusterIP: None ---  apiVersion: apps\/v1 kind: Deployment metadata:   name: loki spec:   selector:     matchLabels:       app: loki   strategy:     type: Recreate   template:     metadata:       labels:         app: loki     spec:       containers:         - image: grafana\/loki:latest           name: loki             ports:             - containerPort: 3100               name: loki <\/code><\/pre>\n<p> \u0418 \u043a\u043e\u043c\u0430\u043d\u0434\u0430<code>kubectl apply -f  grafana.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 4:   Promtail<\/h4>\n<p>\u0414\u043b\u044f promtail  \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f  <a href=\"https:\/\/helm.sh\/\" rel=\"noopener noreferrer nofollow\">Helm<\/a>.  \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c  helm,  \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432  microk8s(\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 2 \u0438 3). \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c  Helm  \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432  \u0444\u0430\u0439\u043b\u0435 config, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u043c \u0432  \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 .kube, \u0443\u043a\u0430\u0437\u0430\u0442\u044c  ip  \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0430. \u041c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c  <code>microk8s config <\/code><\/p>\n<h4>\u0428\u0430\u0433 5: Ingress<\/h4>\n<p>\u0414\u043b\u044f  nginx  \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0444\u0430\u0439\u043b.<\/p>\n<pre><code>apiVersion: networking.k8s.io\/v1 kind: Ingress metadata:   name: server spec:   rules:      #for nginxinc controller host should be set     - http:         paths:           - path: \/             pathType: Prefix             backend:               service:                 name: server                 port:                   number: 8024                              - path: \/grafana             pathType: Prefix             backend:               service:                 name: grafana                 port:                   number: 3000        <\/code><\/pre>\n<p>\u0418 \u043a\u043e\u043c\u0430\u043d\u0434\u0443  <code>kubectl apply -f ingress.yaml<\/code><\/p>\n<h4>\u0428\u0430\u0433 7:  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/h4>\n<p>\u042d\u0442\u043e\u0442 \u0448\u0430\u0433 \u043d\u0435 \u043f\u043e\u0445\u043e\u0436 \u043d\u0438 \u043d\u0430 \u043e\u0434\u0438\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439. \u0417\u0434\u0435\u0441\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e  yaml  \u0438 \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e  Docker  \u043e\u0431\u0440\u0430\u0437\u0430.  \u041d\u0443\u0436\u043d\u043e\u0435 \u043d\u0430\u043c \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435  \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438.  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f  Maven +  <a href=\"https:\/\/www.eclipse.org\/jkube\/\" rel=\"noopener noreferrer nofollow\">jkube maven plugin<\/a> <\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430   <code>install <\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442  jar \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u0437\u0430\u0442\u0435\u043c  <code>k8s:resource<\/code>   \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0440\u0435\u0441\u0443\u0440\u0441\u044b, \u043f\u043e\u0442\u043e\u043c  <code>k8s:build <\/code>\u0441\u043e\u0437\u0434\u0430\u0441\u0442  Docker o\u0431\u0440\u0430\u0437 \u0438  k8s:deploy  \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435. <\/p>\n<p>\u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430<\/p>\n<pre><code>&lt;profile&gt;             &lt;id&gt;kube&lt;\/id&gt;             &lt;properties&gt;                 &lt;spring.profiles.active&gt;docker&lt;\/spring.profiles.active&gt;             &lt;\/properties&gt;             &lt;build&gt;                 &lt;plugins&gt;                     &lt;plugin&gt;                         &lt;groupId&gt;org.eclipse.jkube&lt;\/groupId&gt;                         &lt;artifactId&gt;kubernetes-maven-plugin&lt;\/artifactId&gt;                         &lt;version&gt;1.1.1&lt;\/version&gt;                         &lt;configuration&gt;                             &lt;verbose&gt;true&lt;\/verbose&gt;                                        &lt;images&gt;                                 &lt;image&gt;                                     &lt;name&gt;imagename:latest&lt;\/name&gt;                                     &lt;alias&gt;some-alias\/alias&gt;                                     &lt;build&gt;                                         &lt;maintainer&gt;John Smith&lt;\/maintainer&gt;                                         &lt;from&gt;fabric8\/java-centos-openjdk11-jre&lt;\/from&gt;                                         &lt;assembly&gt;                                             &lt;inline&gt;                                                 &lt;baseDirectory&gt;\/deployments&lt;\/baseDirectory&gt;                                             &lt;\/inline&gt;                                          &lt;\/assembly&gt;                                     &lt;\/build&gt;                                 &lt;\/image&gt;                             &lt;\/images&gt;                          &lt;\/configuration&gt;                         &lt;executions&gt;                             &lt;execution&gt;                                 &lt;id&gt;run&lt;\/id&gt;                                 &lt;goals&gt;                                     &lt;goal&gt;resource&lt;\/goal&gt;                                     &lt;goal&gt;build&lt;\/goal&gt;                                     &lt;goal&gt;deploy&lt;\/goal&gt;                                 &lt;\/goals&gt;                             &lt;\/execution&gt;                         &lt;\/executions&gt;                     &lt;\/plugin&gt;                 &lt;\/plugins&gt;             &lt;\/build&gt;          &lt;\/profile&gt;<\/code><\/pre>\n<p> \u041e\u0431\u0440\u0430\u0437 \u043e\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u0434 \u0442\u0435\u0433\u043e\u043c  image.  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c   \u043e\u0434\u0438\u043d \u0438\u0437 <a href=\"https:\/\/www.eclipse.org\/jkube\/docs\/kubernetes-maven-plugin#generators\" rel=\"noopener noreferrer nofollow\">\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432.<\/a><\/p>\n<p> \u0422\u0430\u043a\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c<\/p>\n<p><code>kubectl expose deployment server --type=LoadBalancer --name=server --port=&lt;some-port&gt;<\/code><\/p>\n<p> \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0432\u0435\u0434\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u0436\u0435 \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435? \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442, \u0431\u044b\u043b\u0430 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0434\u0435 :  \u0432\u043c\u0435\u0441\u0442\u043e  ip  \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442  \u0441\u0442\u0440\u043e\u043a\u0430  <code>tcp:\/\/&lt;ip-service&gt;.<\/code> \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a  NumberFormatException. <\/p>\n<h4>\u0428\u0430\u0433 8:  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430<\/h4>\n<p> \u0412 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e  curl  \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e  localhost  \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f,  localhost\/grafana  \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443  \u0432\u0445\u043e\u0434\u0430 \u0432  Grafana.<\/p>\n<h4>\u0428\u0430\u0433 9:  \u041e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043b\u043e\u0433\u0438<\/h4>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0439\u0442\u0438 \u0432  Grafana  \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043b\u043e\u0433\u0438\u043d\u0430\/\u043f\u0430\u0440\u043e\u043b\u044f  admin . \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c ,\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  Loki(http:\/\/loki:3000).  \u0417\u0430\u0442\u0435\u043c \u0432 explore  \u0432\u0432\u0435\u0441\u0442\u0438  {app=&#187;\u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f&#187;} .<\/p>\n<h4>P.S.<\/h4>\n<p>\u0421\u0431\u043e\u0440 \u043b\u043e\u0433\u043e\u0432 \u0431\u044b\u043b \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u0439 <a href=\"https:\/\/medium.com\/@psingh.singh361\/loki-setup-for-kubernetes-cluster-b7403e137591\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u0435<\/a>.<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/550554\/\"> https:\/\/habr.com\/ru\/post\/550554\/<\/a><br \/><\/br><\/br><\/br><\/br><\/p>\n<p><\/br><\/p>\n<\/p>\n<p><\/br><\/p>\n<p><\/br><\/br><\/p>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-320801","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=320801"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/320801\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}