Eugeny Shtoltc - IT Cloud

Здесь есть возможность читать онлайн «Eugeny Shtoltc - IT Cloud» — ознакомительный отрывок электронной книги совершенно бесплатно, а после прочтения отрывка купить полную версию. В некоторых случаях можно слушать аудио, скачать через торрент в формате fb2 и присутствует краткое содержание. Год выпуска: 2021, Жанр: foreign_comp, на русском языке. Описание произведения, (предисловие) а так же отзывы посетителей доступны на портале библиотеки ЛибКат.

IT Cloud: краткое содержание, описание и аннотация

Предлагаем к чтению аннотацию, описание, краткое содержание или предисловие (зависит от того, что написал сам автор книги «IT Cloud»). Если вы не нашли необходимую информацию о книге — напишите в комментариях, мы постараемся отыскать её.

In this book, the Chief Architect of the Cloud Native Competence Architecture Department at Sberbank shares his knowledge and experience with the reader on the creation and transition to the cloud ecosystem, as well as the creation and adaptation of applications for it. In the book, the author tries to lead the reader along the path, bypassing mistakes and difficulties. To do this, practical applications are demonstrated and explained so that the reader can use them as instructions for educational and work purposes. The reader can be both developers of different levels and ecosystem specialists who wish not to lose the relevance of their skills in an already changed world.

IT Cloud — читать онлайн ознакомительный отрывок

Ниже представлен текст книги, разбитый по страницам. Система сохранения места последней прочитанной страницы, позволяет с удобством читать онлайн бесплатно книгу «IT Cloud», без необходимости каждый раз заново искать на чём Вы остановились. Поставьте закладку, и сможете в любой момент перейти на страницу, на которой закончили чтение.

Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

container {

image = "gcr.io/node-cluster-243923/nodejs_cluster:latest"

name = "node-js"

}

Let's check the result of balancing for different nodes (no line break at the end of the output):

essh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lqg48essh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lqg48essh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lhgsnessh @ kubernetes-master: ~ / node-cluster $ curl http://35.246.85.138:80

Nodejs_cluster is working! My host is terraform-nodejs-997fd5c9c-lqg48essh @ kubernetes-master: ~ / node-cluster $

We will automate the process of creating images, for this we will use the Google Cloud Build service (free for 5 users and traffic up to 50GB) to create a new image when creating a new version (tag) in the Cloud Source Repositories repository (free on Google Cloud Platform Free Tier). Google Cloud Platform -> Menu -> Tools -> Cloud Build -> Triggers -> Enable Cloud Build API -> Get Started -> Create a repository that will be available on Google Cloud Platform -> Menu -> Tools -> Source Code Repositories (Cloud Source Repositories):

essh @ kubernetes-master: ~ / node-cluster $ cd app /

essh @ kubernetes-master: ~ / node-cluster / app $ ls

server.js

essh @ kubernetes-master: ~ / node-cluster / app $ mv ./server.js ../

essh @ kubernetes-master: ~ / node-cluster / app $ gcloud source repos clone nodejs –project = node-cluster-243923

Cloning into '/ home / essh / node-cluster / app / nodejs' …

warning: You appear to have cloned an empty repository.

Project [node-cluster-243923] repository [nodejs] was cloned to [/ home / essh / node-cluster / app / nodejs].

essh @ kubernetes-master: ~ / node-cluster / app $ ls -a

… .. nodejs

essh @ kubernetes-master: ~ / node-cluster / app $ ls nodejs /

essh @ kubernetes-master: ~ / node-cluster / app $ ls -a nodejs /

… .. .git

essh @ kubernetes-master: ~ / node-cluster / app $ cd nodejs /

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ mv ../../server.js.

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git add server.js

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git commit -m 'test server'

[master (root-commit) 46dd957] test server

1 file changed, 7 insertions (+)

create mode 100644 server.js

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git push -u origin master

Counting objects: 3, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (3/3), 408 bytes | 408.00 KiB / s, done.

Total 3 (delta 0), reused 0 (delta 0)

To https://source.developers.google.com/p/node-cluster-243923/r/nodejs

* [new branch] master -> master

Branch 'master' set up to track remote branch 'master' from 'origin'.

Now it's time to set up image creation when creating a new version of the product: go to GCP -> Cloud Build -> triggers -> Create trigger -> Google Cloud source code repository -> NodeJS. Trigger tag type so that the image is not created during normal commits. I will change the name of the image from gcr.io/node-cluster-243923/NodeJS:$SHORT_SHA to gcr.io/node-cluster-243923/NodeJS:$SHORT_SHA and the timeout to 60 seconds. Now I'll commit and add a tag:

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ cp ../../Dockerfile.

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git add Dockerfile

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git add Dockerfile

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ cp ../../Dockerfile.

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git add Dockerfile

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git commit -m 'add Dockerfile'

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git remote -v

origin https://source.developers.google.com/p/node-cluster-243923/r/nodejs (fetch)

origin https://source.developers.google.com/p/node-cluster-243923/r/nodejs (push)

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git push origin master

Counting objects: 3, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (3/3), done.

Writing objects: 100% (3/3), 380 bytes | 380.00 KiB / s, done.

Total 3 (delta 0), reused 0 (delta 0)

To https://source.developers.google.com/p/node-cluster-243923/r/nodejs

46dd957..b86c01d master -> master

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git tag

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git tag -a v0.0.1 -m 'test to run'

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git push origin v0.0.1

Counting objects: 1, done.

Writing objects: 100% (1/1), 161 bytes | 161.00 KiB / s, done.

Total 1 (delta 0), reused 0 (delta 0)

To https://source.developers.google.com/p/node-cluster-243923/r/nodejs

* [new tag] v0.0.1 -> v0.0.1

Now, if we press the start trigger button, we will see the image in the Container Registry with our tag:

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ gcloud container images list

NAME

gcr.io/node-cluster-243923/nodejs

gcr.io/node-cluster-243923/nodejs_cluster

Only listing images in gcr.io/node-cluster-243923. Use –repository to list images in other repositories.

Now if we just add the changes and the tag, the image will be created automatically:

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ sed -i 's / HOSTNAME \} / HOSTNAME \} \ n /' server.js

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git add server.js

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git commit -m 'fix'

[master 230d67e] fix

1 file changed, 2 insertions (+), 1 deletion (-)

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git push origin master

Counting objects: 3, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (3/3), done.

Writing objects: 100% (3/3), 304 bytes | 304.00 KiB / s, done.

Total 3 (delta 1), reused 0 (delta 0)

remote: Resolving deltas: 100% (1/1)

To https://source.developers.google.com/p/node-cluster-243923/r/nodejs

b86c01d..230d67e master -> master

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git tag -a v0.0.2 -m 'fix'

essh @ kubernetes-master: ~ / node-cluster / app / nodejs $ git push origin v0.0.2

Читать дальше
Тёмная тема
Сбросить

Интервал:

Закладка:

Сделать

Похожие книги на «IT Cloud»

Представляем Вашему вниманию похожие книги на «IT Cloud» списком для выбора. Мы отобрали схожую по названию и смыслу литературу в надежде предоставить читателям больше вариантов отыскать новые, интересные, ещё непрочитанные произведения.


Отзывы о книге «IT Cloud»

Обсуждение, отзывы о книге «IT Cloud» и просто собственные мнения читателей. Оставьте ваши комментарии, напишите, что Вы думаете о произведении, его смысле или главных героях. Укажите что конкретно понравилось, а что нет, и почему Вы так считаете.

x