Eugeny Shtoltc

IT Cloud


Скачать книгу

for [operations / cp.7153345484959140898] to finish … done. https://medium.com/@pnatraj/how-to-run-gcloud-command-line-using-a-service-account-f39043d515b9

      essh @ kubernetes-master: ~ / node-cluster $ gcloud auth application-default login

      essh @ kubernetes-master: ~ / node-cluster $ cp ~ / Downloads / node-cluster-prod-244519-6fd863dd4d38.json ./kubernetes_prod.json

      essh @ kubernetes-master: ~ / node-cluster $ echo "kubernetes_prod.json" >> .gitignore

      essh @ kubernetes-master: ~ / node-cluster $ gcloud iam service-accounts list

      NAME EMAIL DISABLED

      Compute Engine default service account [email protected] False

      terraform-prod [email protected] False

      essh @ kubernetes-master: ~ / node-cluster $ gcloud projects list | grep node-cluster

      node-cluster-243923 node-cluster 26345118671

      node-cluster-prod-244519 node-cluster-prod 1008874319751

      Let's create a prod environment:

      essh @ kubernetes-master: ~ / node-cluster $ mkdir prod

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

      essh @ kubernetes-master: ~ / node-cluster / prod $ cp ../main.tf ../kubernetes_prod_key.json.

      essh @ kubernetes-master: ~ / node-cluster / prod $ gcloud config set project node-cluster-prod-244519

      Updated property [core / project].

      essh @ kubernetes-master: ~ / node-cluster / prod $ gcloud config list project

      [core]

      project = node-cluster-prod-244519

      Your active configuration is: [default]

      essh @ kubernetes-master: ~ / node-cluster / prod $ cat main.tf

      provider "google" {

      alias = "prod"

      credentials = file ("./ kubernetes_prod_key.json")

      project = "node-cluster-prod-244519"

      region = "us-west2"

      }

      module "kubernetes_prod" {

      source = "../Kubernetes"

      providers = {

      google = google.prod

      }

      }

      data "google_client_config" "default" {}

      module "Nginx" {

      source = "../nodejs"

      providers = {

      google = google.prod

      }

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

      endpoint = module.kubernetes_prod.endpoint

      access_token = data.google_client_config.default.access_token

      cluster_ca_certificate = module.kubernetes_prod.cluster_ca_certificate

      }

      essh @ kubernetes-master: ~ / node-cluster / prod $ ../terraform init

      essh @ kubernetes-master: ~ / node-cluster / prod $ ../terraform apply

      Конец ознакомительного фрагмента.

      Текст предоставлен ООО «ЛитРес».

      Прочитайте эту книгу целиком, купив полную легальную версию на ЛитРес.

      Безопасно оплатить книгу можно банковской картой Visa, MasterCard, Maestro, со счета мобильного телефона, с платежного терминала, в салоне МТС или Связной, через PayPal, WebMoney, Яндекс.Деньги, QIWI Кошелек, бонусными картами или другим удобным Вам способом.

/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQH/wgARCAhhBdwDASIAAhEBAxEB/8QAHgABAAAHAQEBAAAAAAAAAAAAAAIDBAUGBwgBCQr/xAAbAQEAAwEBAQEAAAAAAAAAAAAAAgMEAQUGB//aAAwDAQACEAMQAAAB5LH6R+RgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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