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

Материал из noname.com.ua
Перейти к навигацииПерейти к поиску
 
(не показано 7 промежуточных версий этого же участника)
Строка 1: Строка 1:
  +
[[Категория:Linux]]
  +
[[Категория:gcloud]]
  +
==Instance Group==
 
<PRE>
 
<PRE>
 
gcloud compute \
 
gcloud compute \
Строка 17: Строка 20:
 
--named-ports "consul-8300:8300,consul-8301:8301,consul-8302:8302,consul-8400:8400,consul-8500:8500,consul-8600:8600"
 
--named-ports "consul-8300:8300,consul-8301:8301,consul-8302:8302,consul-8400:8400,consul-8500:8500,consul-8600:8600"
 
</PRE>
 
</PRE>
  +
  +
   
 
<PRE>
 
<PRE>
Строка 44: Строка 49:
   
   
  +
<PRE>
  +
gcloud compute \
  +
instance-groups unmanaged \
  +
add-instances consul-ig \
  +
--instances \
  +
consul-tf-0,consul-tf-1,consul-tf-2 \
  +
--zone us-central1-b
  +
</PRE>
   
  +
==Health Check==
 
<PRE>
 
<PRE>
 
gcloud compute \
 
gcloud compute \
Строка 57: Строка 71:
 
</PRE>
 
</PRE>
   
  +
  +
  +
==Backend Service==
   
 
<PRE>
 
<PRE>
Строка 65: Строка 82:
 
--health-checks consul-tcp-health-check
 
--health-checks consul-tcp-health-check
   
  +
</PRE>
  +
  +
  +
<PRE>
  +
gcloud compute backend-services add-backend consul-backend-service\
  +
--instance-group consul-ig \
  +
--instance-group-zone us-central1-b \
  +
--region us-central1
  +
</PRE>
  +
==Forwarding Rule==
  +
<PRE>
  +
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
 
</PRE>
 
</PRE>

Текущая версия на 09:17, 30 октября 2023

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