Google cloud internal lb: различия между версиями

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
Строка 93: Строка 93:
 
gcloud compute \
 
gcloud compute \
 
forwarding-rules create consul-forwarding-rule \
 
forwarding-rules create consul-forwarding-rule \
  +
--address 10.206.249.54 \
 
--load-balancing-scheme internal \
 
--load-balancing-scheme internal \
--ports 8500 \
+
--ports 8300,8500 \
 
--network kohls-ecom-nonprod \
 
--network kohls-ecom-nonprod \
 
--subnet kohl-ecom-nonprod-network01 \
 
--subnet kohl-ecom-nonprod-network01 \

Версия 14:20, 20 февраля 2017

Instance Group

gcloud compute \
instance-groups unmanaged \
create consul-ig \
--zone us-central1-b
NAME       LOCATION       SCOPE  NETWORK  MANAGED  INSTANCES
consul-ig  us-central1-b  zone                     0


gcloud compute \
instance-groups set-named-ports consul-ig \
--named-ports "consul-8300:8300,consul-8301:8301,consul-8302:8302,consul-8400:8400,consul-8500:8500,consul-8600:8600"


gcloud compute instance-groups describe  consul-ig
creationTimestamp: '2017-02-20T01:57:22.904-08:00'
description: ''
fingerprint: i-B17zEMY3w=
id: '6384490727661306733'
isManaged: 'No'
kind: compute#instanceGroup
name: consul-ig
namedPorts:
- name: consul-8300
  port: 8300
- name: consul-8301
  port: 8301
- name: consul-8302
  port: 8302
- name: consul-8400
  port: 8400
- name: consul-8500
  port: 8500
- name: consul-8600
  port: 8600


gcloud compute \
instance-groups unmanaged \
add-instances consul-ig \
--instances \
consul-tf-0,consul-tf-1,consul-tf-2 \
--zone us-central1-b

Health Check

gcloud compute \
health-checks \
create tcp consul-tcp-health-check \
--port 8500
NAME                     PROTOCOL
consul-tcp-health-check  TCP


Backend Service

gcloud compute \
backend-services create consul-backend-service \
--load-balancing-scheme internal \
--region us-central1 \
--health-checks consul-tcp-health-check


gcloud compute backend-services add-backend  consul-backend-service\
    --instance-group consul-ig \
    --instance-group-zone us-central1-b \
    --region us-central1

Forwarding Rule

gcloud compute \
forwarding-rules create consul-forwarding-rule \
--address 10.206.249.54 \
--load-balancing-scheme internal \
--ports 8300,8500 \
--network kohls-ecom-nonprod \
--subnet kohl-ecom-nonprod-network01 \
--region us-central1 \
--backend-service consul-backend-service