Looker PSC Southbound SSH Internet NEG

1. บทนำ

ใน Codelab นี้ คุณจะทำการเชื่อมต่อ SSH ขาออกกับ GitHub โดยใช้ตัวจัดสรรภาระงานพร็อกซี TCP ภายในและกลุ่มปลายทางเครือข่ายอินเทอร์เน็ตที่เรียกใช้จาก Looker PSC ในฐานะผู้ใช้บริการ

Private Service Connect เป็นความสามารถของเครือข่าย Google Cloud ที่ช่วยให้ผู้ใช้เข้าถึงบริการที่มีการจัดการแบบส่วนตัวจากภายในเครือข่าย VPC ของตนได้ ในทำนองเดียวกัน ก็ช่วยให้ผู้ให้บริการที่มีการจัดการโฮสต์บริการเหล่านี้ในเครือข่าย VPC ของตนเองแยกต่างหาก และเสนอการเชื่อมต่อส่วนตัวแก่ผู้บริโภคได้ ตัวอย่างเช่น เมื่อใช้ Private Service Connect เพื่อเข้าถึง Looker คุณจะเป็นผู้ใช้บริการ และ Google จะเป็นผู้ให้บริการ ดังที่ไฮไลต์ไว้ในรูปที่ 1

รูปที่ 1

145ea4672c3a3b14.png

การเข้าถึง Southbound หรือที่เรียกว่า PSC แบบย้อนกลับช่วยให้ผู้ใช้สร้างบริการที่เผยแพร่เป็นผู้ผลิตเพื่ออนุญาตให้ Looker เข้าถึงปลายทางในองค์กร ใน VPC ไปยังบริการที่มีการจัดการ และอินเทอร์เน็ตได้ การเชื่อมต่อขาออกสามารถติดตั้งใช้งานได้ในทุกภูมิภาค ไม่ว่า Looker PSC จะติดตั้งใช้งานอยู่ที่ใดก็ตาม ดังที่ไฮไลต์ไว้ในรูปที่ 2

รูปที่ 2

259493afd914f68b.png

สิ่งที่คุณจะได้เรียนรู้

  • ข้อกำหนดเกี่ยวกับเครือข่าย
  • สร้างบริการของผู้ผลิต Private Service Connect
  • สร้างปลายทาง Private Service Connect ใน Looker
  • สร้างการเชื่อมต่อกับ GitHub จาก Looker โดยใช้การทดสอบการเชื่อมต่อ

สิ่งที่คุณต้องมี

def88091b42bfe4d.png

2. สิ่งที่คุณจะสร้าง

คุณจะสร้างเครือข่าย Producer, looker-psc-demo เพื่อทำให้ใช้งานได้ตัวจัดสรรภาระงานพร็อกซี TCP ภายในและ NEG อินเทอร์เน็ตที่เผยแพร่เป็นบริการผ่าน Private Service Connect (PSC) เมื่อเผยแพร่แล้ว คุณจะต้องดำเนินการต่อไปนี้เพื่อตรวจสอบสิทธิ์เข้าถึงบริการ Producer

  • สร้างปลายทาง PSC ใน Looker ที่เชื่อมโยงกับไฟล์แนบเกี่ยวกับบริการของผู้ผลิต
  • ใช้ Looker Console เพื่อสร้างโปรเจ็กต์ใหม่และทดสอบการเชื่อมต่อ SSH กับ GitHub.com โดยใช้ขั้นตอนการเชื่อมต่อกับ Git โดยใช้ SSH

3. ข้อกำหนดเกี่ยวกับเครือข่าย

ด้านล่างนี้คือรายละเอียดข้อกำหนดของเครือข่ายสำหรับเครือข่าย Producer โดย Consumer ใน Codelab นี้คืออินสแตนซ์ PSC ของ Looker

เครือข่ายผู้ผลิต

คอมโพเนนต์

คำอธิบาย

VPC (looker-psc-demo)

VPC โหมดที่กำหนดเอง

ซับเน็ต NAT ของ PSC

ระบบจะแปลแพ็กเก็ตจากเครือข่าย VPC ของผู้ใช้โดยใช้ Source NAT (SNAT) เพื่อแปลงที่อยู่ IP ต้นทางเดิมเป็นที่อยู่ IP ต้นทางจากซับเน็ต NAT ในเครือข่าย VPC ของผู้ผลิต

ซับเน็ตของกฎการส่งต่อ PSC

ใช้เพื่อจัดสรรที่อยู่ IP สำหรับตัวจัดสรรภาระงานพร็อกซี TCP ภายในระดับภูมิภาค

ซับเน็ต PSC NEG

ใช้เพื่อจัดสรรที่อยู่ IP สำหรับกลุ่มปลายทางเครือข่าย

ซับเน็ตเฉพาะพร็อกซี

พร็อกซี ของตัวจัดสรรภาระงานแต่ละรายการจะได้รับที่อยู่ IP ภายใน แพ็กเกตที่ส่งจากพร็อกซีไปยัง VM หรือปลายทางแบ็กเอนด์จะมีที่อยู่ IP ต้นทางจากเครือข่ายย่อยเฉพาะพร็อกซี

NEG อินเทอร์เน็ต

ทรัพยากรที่ใช้เพื่อกำหนดแบ็กเอนด์ภายนอกสำหรับตัวจัดสรรภาระงาน ปลายทางจะเข้าถึงได้ผ่าน Cloud VPN หรือ Cloud Interconnect เท่านั้นไม่ได้

บริการแบ็กเอนด์

บริการแบ็กเอนด์ทำหน้าที่เป็นสะพานเชื่อมระหว่างตัวจัดสรรภาระงานกับทรัพยากรแบ็กเอนด์ ในบทแนะนำนี้ บริการแบ็กเอนด์จะเชื่อมโยงกับ NEG ของอินเทอร์เน็ต

Cloud Router

Cloud NAT อาศัยเราเตอร์ระบบคลาวด์ สำหรับความสามารถของระนาบควบคุม แต่ไม่ใช่สำหรับการจัดการเซสชัน BGP

Cloud NAT

NEG อินเทอร์เน็ตระดับภูมิภาคใช้ Cloud NAT สำหรับการรับส่งข้อมูลอินเทอร์เน็ตขาออก

4. โทโพโลยี Codelab

dfa4dd1d681a66da.png

5. การตั้งค่าและข้อกำหนด

การตั้งค่าสภาพแวดล้อมแบบเรียนรู้ด้วยตนเอง

  1. ลงชื่อเข้าใช้ Google Cloud Console แล้วสร้างโปรเจ็กต์ใหม่หรือใช้โปรเจ็กต์ที่มีอยู่ซ้ำ หากยังไม่มีบัญชี Gmail หรือ Google Workspace คุณต้องสร้างบัญชี

fbef9caa1602edd0.png

a99b7ace416376c4.png

5e3ff691252acf41.png

  • ชื่อโปรเจ็กต์คือชื่อที่แสดงสำหรับผู้เข้าร่วมโปรเจ็กต์นี้ ซึ่งเป็นสตริงอักขระที่ Google APIs ไม่ได้ใช้ คุณอัปเดตได้ทุกเมื่อ
  • รหัสโปรเจ็กต์จะไม่ซ้ำกันในโปรเจ็กต์ Google Cloud ทั้งหมดและเปลี่ยนแปลงไม่ได้ (เปลี่ยนไม่ได้หลังจากตั้งค่าแล้ว) Cloud Console จะสร้างสตริงที่ไม่ซ้ำกันโดยอัตโนมัติ ซึ่งโดยปกติแล้วคุณไม่จำเป็นต้องสนใจว่าสตริงนั้นคืออะไร ใน Codelab ส่วนใหญ่ คุณจะต้องอ้างอิงรหัสโปรเจ็กต์ (โดยทั่วไปจะระบุเป็น PROJECT_ID) หากไม่ชอบรหัสที่สร้างขึ้น คุณอาจสร้างรหัสแบบสุ่มอีกรหัสหนึ่งได้ หรือคุณอาจลองใช้ชื่อของคุณเองและดูว่ามีชื่อนั้นหรือไม่ คุณจะเปลี่ยนแปลงรหัสนี้หลังจากขั้นตอนนี้ไม่ได้ และรหัสจะคงอยู่ตลอดระยะเวลาของโปรเจ็กต์
  • โปรดทราบว่ายังมีค่าที่ 3 ซึ่งคือหมายเลขโปรเจ็กต์ที่ API บางตัวใช้ ดูข้อมูลเพิ่มเติมเกี่ยวกับค่าทั้ง 3 นี้ได้ในเอกสารประกอบ
  1. จากนั้นคุณจะต้องเปิดใช้การเรียกเก็บเงินใน Cloud Console เพื่อใช้ทรัพยากร/API ของ Cloud การทำตาม Codelab นี้จะไม่มีค่าใช้จ่ายมากนัก หรืออาจไม่มีค่าใช้จ่ายเลย หากต้องการปิดทรัพยากรเพื่อหลีกเลี่ยงการเรียกเก็บเงินนอกเหนือจากบทแนะนำนี้ คุณสามารถลบทรัพยากรที่สร้างขึ้นหรือลบโปรเจ็กต์ได้ ผู้ใช้ Google Cloud รายใหม่มีสิทธิ์เข้าร่วมโปรแกรมช่วงทดลองใช้ฟรีมูลค่า$300 USD

เริ่มต้น Cloud Shell

แม้ว่าคุณจะใช้งาน Google Cloud จากระยะไกลจากแล็ปท็อปได้ แต่ใน Codelab นี้คุณจะใช้ Google Cloud Shell ซึ่งเป็นสภาพแวดล้อมบรรทัดคำสั่งที่ทำงานในระบบคลาวด์

จาก Google Cloud Console ให้คลิกไอคอน Cloud Shell ในแถบเครื่องมือด้านขวาบน

55efc1aaa7a4d3ad.png

การจัดสรรและเชื่อมต่อกับสภาพแวดล้อมจะใช้เวลาเพียงไม่กี่นาที เมื่อเสร็จแล้ว คุณควรเห็นข้อความคล้ายกับตัวอย่างต่อไปนี้

7ffe5cbb04455448.png

เครื่องเสมือนนี้มาพร้อมเครื่องมือพัฒนาซอฟต์แวร์ทั้งหมดที่คุณต้องการ โดยมีไดเรกทอรีหลักแบบถาวรขนาด 5 GB และทำงานบน Google Cloud ซึ่งช่วยเพิ่มประสิทธิภาพเครือข่ายและการตรวจสอบสิทธิ์ได้อย่างมาก คุณสามารถทำงานทั้งหมดใน Codelab นี้ได้ภายในเบราว์เซอร์ คุณไม่จำเป็นต้องติดตั้งอะไร

6. ก่อนเริ่มต้น

เปิดใช้ API

ใน Cloud Shell ให้ตรวจสอบว่าได้ตั้งค่ารหัสโปรเจ็กต์แล้ว

gcloud config list project
gcloud config set project [YOUR-PROJECT-ID]
project=[YOUR-PROJECT-ID]
region=[YOUR-REGION]
echo $project
echo $region

เปิดใช้บริการที่จำเป็นทั้งหมด

gcloud services enable compute.googleapis.com

7. สร้างเครือข่าย VPC ของผู้ผลิต

เครือข่าย VPC

ใน Cloud Shell ให้ทำดังนี้

gcloud compute networks create looker-psc-demo --subnet-mode custom

สร้างซับเน็ต

ซับเน็ต PSC จะเชื่อมโยงกับไฟล์แนบบริการ PSC เพื่อวัตถุประสงค์ในการเปลี่ยนค่าที่อยู่เครือข่าย

สร้างซับเน็ต NAT ของ PSC ใน Cloud Shell โดยทำดังนี้

gcloud compute networks subnets create producer-psc-nat-subnet --network looker-psc-demo --range 172.16.10.0/28 --region $region --purpose=PRIVATE_SERVICE_CONNECT

สร้างซับเน็ตของกฎการส่งต่อสำหรับผู้ผลิตภายใน Cloud Shell โดยทำดังนี้

gcloud compute networks subnets create producer-psc-fr-subnet --network looker-psc-demo --range 172.16.20.0/28 --region $region --enable-private-ip-google-access

สร้างซับเน็ตเฉพาะพร็อกซีระดับภูมิภาคของผู้ผลิตภายใน Cloud Shell โดยใช้คำสั่งต่อไปนี้

gcloud compute networks subnets create $region-proxy-only-subnet \
  --purpose=REGIONAL_MANAGED_PROXY \
  --role=ACTIVE \
  --region=$region \
  --network=looker-psc-demo \
  --range=10.10.10.0/24

สร้าง Public NAT gateway

ตัวจัดสรรภาระงานพร็อกซี TCP ภายในระดับภูมิภาคใช้เกตเวย์ NAT สำหรับการรับส่งข้อมูลอินเทอร์เน็ตขาออกที่มีตัวเลือกการกำหนดค่า –endpoint-types=ENDPOINT_TYPE_MANAGED_PROXY_LB ดังนั้น NATGW เดียวกันจึงไม่รองรับการรับส่งข้อมูลอินเทอร์เน็ตขาออกของ GCE/GKE ทำให้ใช้งานได้ NAT GW เพิ่มเติมด้วย –endpoint-types=ENDPOINT_TYPE_VM สำหรับการรับส่งข้อมูลอินเทอร์เน็ตขาออกจาก GCE/GKE

สร้าง Cloud Router ภายใน Cloud Shell โดยทำดังนี้

gcloud compute routers create looker-psc-demo-cloud-router --network looker-psc-demo --region $region

สร้างเกตเวย์ Cloud NAT ภายใน Cloud Shell เพื่อเปิดใช้การออกทางอินเทอร์เน็ตสำหรับตัวจัดสรรภาระงานพร็อกซี TCP

gcloud compute routers nats create looker-psc-demo-natgw \
  --router=looker-psc-demo-cloud-router \
  --endpoint-types=ENDPOINT_TYPE_MANAGED_PROXY_LB \
  --nat-custom-subnet-ip-ranges=$region-proxy-only-subnet \
  --auto-allocate-nat-external-ips \
  --region=$region

สำรองที่อยู่ IP ของตัวจัดสรรภาระงาน

ใน Cloud Shell ให้จองที่อยู่ IP ภายในสำหรับตัวจัดสรรภาระงานโดยทำดังนี้

gcloud compute addresses create internet-neg-lb-ip \
  --region=$region \
  --subnet=producer-psc-fr-subnet

ดูที่อยู่ IP ที่สงวนไว้ภายใน Cloud Shell

gcloud compute addresses describe internet-neg-lb-ip \
  --region=$region | grep -i address:

ตัวอย่าง

user@cloudshell$ gcloud compute addresses describe internet-neg-lb-ip   --region=$region | grep -i address:
address: 172.16.20.2

ตั้งค่า NEG อินเทอร์เน็ต

สร้าง NEG อินเทอร์เน็ต และตั้งค่า –network-endpoint-type เป็น internet-fqdn-port (ชื่อโฮสต์และพอร์ตที่เข้าถึงแบ็กเอนด์ภายนอกได้)

สร้าง NEG อินเทอร์เน็ตที่ใช้สำหรับ github.com ภายใน Cloud Shell

gcloud compute network-endpoint-groups create github-internet-neg-ssh \
    --network-endpoint-type=INTERNET_FQDN_PORT \
    --network=looker-psc-demo \
    --region=$region

ใน Cloud Shell ให้อัปเดต NEG อินเทอร์เน็ต github-internet-neg-ssh ด้วย FQDN github.com และพอร์ต 22

gcloud compute network-endpoint-groups update github-internet-neg-ssh \
    --add-endpoint="fqdn=github.com,port=22" \
    --region=$region

สร้างนโยบายไฟร์วอลล์เครือข่ายและกฎไฟร์วอลล์

ใน Cloud Shell ให้ทำดังนี้

gcloud compute network-firewall-policies create looker-psc-demo-policy --global

gcloud compute network-firewall-policies associations create --firewall-policy looker-psc-demo-policy --network looker-psc-demo --name looker-psc-demo --global-firewall-policy

กฎไฟร์วอลล์ต่อไปนี้อนุญาตการรับส่งข้อมูลจากช่วงซับเน็ต NAT ของ PSC ไปยังอินสแตนซ์ทั้งหมดในเครือข่าย

ใน Cloud Shell ให้ทำดังนี้

gcloud compute network-firewall-policies rules create 2001 --action ALLOW --firewall-policy looker-psc-demo-policy --description "allow traffic from PSC NAT subnet" --direction INGRESS --src-ip-ranges 172.16.10.0/28 --global-firewall-policy --layer4-configs=tcp

8. สร้างบริการของผู้ผลิต

สร้างคอมโพเนนต์ของตัวจัดสรรภาระงาน

ใน Cloud Shell ให้ทำดังนี้

gcloud compute backend-services create producer-backend-svc  --protocol=tcp --region=$region --load-balancing-scheme=INTERNAL_MANAGED

gcloud compute backend-services add-backend producer-backend-svc --network-endpoint-group=github-internet-neg-ssh --network-endpoint-group-region=$region --region=$region

ใน Cloud Shell ให้สร้างพร็อกซี TCP เป้าหมายเพื่อกำหนดเส้นทางการรับส่งข้อมูลไปยังบริการแบ็กเอนด์

gcloud compute target-tcp-proxies create producer-lb-tcp-proxy \
      --backend-service=producer-backend-svc  \
      --region=$region

ในไวยากรณ์ต่อไปนี้ ให้สร้างกฎการส่งต่อ (ตัวจัดสรรภาระงานพร็อกซี TCP ภายใน)

ใน Cloud Shell ให้ทำดังนี้

gcloud compute forwarding-rules create producer-github-fr \
     --load-balancing-scheme=INTERNAL_MANAGED \
     --network-tier=PREMIUM \
     --network=looker-psc-demo \
     --subnet=producer-psc-fr-subnet \
     --address=internet-neg-lb-ip \
     --target-tcp-proxy=producer-lb-tcp-proxy \
     --target-tcp-proxy-region=$region \
     --region=$region \
     --ports=22

สร้าง Service Attachment

สร้างไฟล์แนบบริการ github-svc-attachment-ssh ใน Cloud Shell ดังนี้

gcloud compute service-attachments create github-svc-attachment-ssh --region=$region --producer-forwarding-rule=producer-github-fr --connection-preference=ACCEPT_AUTOMATIC --nat-subnets=producer-psc-nat-subnet

จากนั้น ให้รับและจดบันทึก Service Attachment ที่แสดงใน URI ของ selfLink ซึ่งเริ่มต้นด้วยโปรเจ็กต์เพื่อกำหนดค่าปลายทาง PSC ใน Looker

selfLink: projects/<your-project-id>/regions/<your-region>/serviceAttachments/github-svc-attachment-ssh

ใน Cloud Shell ให้ทำดังนี้

gcloud compute service-attachments describe github-svc-attachment-ssh --region=$region

ตัวอย่างผลลัพธ์ที่คาดหวัง

connectionPreference: ACCEPT_AUTOMATIC
creationTimestamp: '2024-08-31T13:43:07.078-07:00'
description: ''
enableProxyProtocol: false
fingerprint: O5OtqHR33v4=
id: '7557641709467614900'
kind: compute#serviceAttachment
name: github-svc-attachment-ssh
natSubnets:
- https://www.googleapis.com/compute/v1/projects/$project/regions/$region/subnetworks/producer-psc-nat-subnet
pscServiceAttachmentId:
  high: '19348441121424360'
  low: '7557641709467614900'
reconcileConnections: false
region: https://www.googleapis.com/compute/v1/projects/$project/regions/$region
selfLink: https://www.googleapis.com/compute/v1/projects/$project/regions/$region/serviceAttachments/github-svc-attachment-ssh
targetService: https://www.googleapis.com/compute/v1/projects/$project/regions/$region/forwardingRules/producer-github-fr

ใน Cloud Console ให้ไปที่

บริการเครือข่าย → Private Service Connect → บริการที่เผยแพร่

30b1a280966b1f06.png

4eafe698193f5f44.png

9. สร้างการเชื่อมต่อปลายทาง PSC ใน Looker

ในส่วนต่อไปนี้ คุณจะเชื่อมโยงการแนบบริการของผู้ผลิตกับ PSC หลักของ Looker โดยใช้แฟล็ก -psc-service-attachment ใน Cloud Shell สำหรับโดเมนเดียว

ใน Cloud Shell ให้สร้างการเชื่อมโยง PSC โดยอัปเดตพารามิเตอร์ต่อไปนี้ให้ตรงกับสภาพแวดล้อมของคุณ

  • INSTANCE_NAME: ชื่ออินสแตนซ์ Looker (Google Cloud Core)
  • DOMAIN_1: githubssh.com
  • SERVICE_ATTACHMENT_1: URI ที่บันทึกไว้เมื่ออธิบาย Service Attachment, github-svc-attachment-ssh
  • REGION: ภูมิภาคที่โฮสต์อินสแตนซ์ Looker (Google Cloud Core)

ใน Cloud Shell ให้ทำดังนี้

gcloud looker instances update INSTANCE_NAME \
--psc-service-attachment  domain=DOMAIN_1,attachment=SERVICE_ATTACHMENT_URI_1 \
--region=REGION

ตัวอย่าง

gcloud looker instances update looker-psc-instance \
--psc-service-attachment  domain=githubssh.com,attachment=projects/$project/regions/$region/serviceAttachments/github-svc-attachment-ssh \
--region=$region

ภายใน Cloud Shell ให้ตรวจสอบว่า connectionStatus ของ serviceAttachments เป็น "ACCEPTED" อัปเดตด้วย INSTANCE_NAME ของ PSC ของ Looker

gcloud looker instances describe [INSTANCE_NAME] --region=$region --format=json

ตัวอย่าง

gcloud looker instances describe looker-psc-instance --region=$region --format=json

ตัวอย่าง

{
  "adminSettings": {},
  "createTime": "2024-08-23T00:00:45.339063195Z",
  "customDomain": {
    "domain": "cosmopup.com",
    "state": "AVAILABLE"
  },
  "encryptionConfig": {},
  "lookerVersion": "24.14.18",
  "name": "projects/$project/locations/$region/instances/looker-psc-instance",
  "platformEdition": "LOOKER_CORE_ENTERPRISE_ANNUAL",
  "pscConfig": {
    "allowedVpcs": [
      "projects/$project/global/networks/looker-psc-demo",
      "projects/$project/global/networks/looker-shared-vpc"
    ],
    "lookerServiceAttachmentUri": "projects/t7ec792caf2a609d1-tp/regions/$region/serviceAttachments/looker-psc-f51982e2-ac0d-48b1-91bb-88656971c183",
    "serviceAttachments": [
      {
        "connectionStatus": "ACCEPTED",
        "localFqdn": "githubssh.com",
        "targetServiceAttachmentUri": "projects/$project/regions/$region/serviceAttachments/github-svc-attachment-ssh"
      }
    ]
  },
  "pscEnabled": true,
  "state": "ACTIVE",
  "updateTime": "2024-08-31T20:53:04.824018122Z"
}

ตรวจสอบความถูกต้องของปลายทาง PSC ใน Cloud Console

คุณสามารถตรวจสอบการเชื่อมต่อ PSC จาก Cloud Console ได้

ใน Cloud Console ให้ไปที่

Looker → อินสแตนซ์ Looker → รายละเอียด

2d4684d722d31e4b.png

db670bb008ea3fc4.png

10. ทดสอบการเชื่อมต่อกับ GitHub

ในขั้นตอนต่อไปนี้ คุณจะใช้ Looker Console เพื่อสร้างโปรเจ็กต์เพื่อตรวจสอบการเชื่อมต่อ SSH กับ GitHub.com โดยการอัปเดตโดเมน github.com เป็น githubssh.com ใน UI ของ Looker การดำเนินการนี้จำเป็นสำหรับการเชื่อมต่อ SSH กับ GitHub เท่านั้น

11. สร้างโปรเจ็กต์ใหม่

เปิดใช้โหมดการพัฒนา

ใน Looker Console ให้ไปที่

เปิดใช้โหมดนักพัฒนา (หน้าด้านซ้ายล่าง) เมื่อเลือกแล้ว แบนเนอร์ "คุณอยู่ในโหมดนักพัฒนา" จะแสดงขึ้น

70c9ded749decfbe.png

สร้างโปรเจ็กต์ใหม่

ใน Cloud Console ให้ไปที่

พัฒนา → โปรเจ็กต์

e8ae11e0392a776d.png

เลือกโปรเจ็กต์ LookML ใหม่

65a3c2573e97e1e9.png

ระบุชื่อโปรเจ็กต์ เลือกโปรเจ็กต์เปล่า แล้วสร้างโปรเจ็กต์

dbb890960291aa84.png

เลือกกำหนดค่า Git

42f5e51ce70642ad.png

กำหนดค่า Git

3962a1fe7ac8da77.png

เมื่อเลือก "ดำเนินการต่อ" ระบบจะแจ้งให้คุณตรวจสอบ URL ของที่เก็บและบริการโฮสติ้ง Git

743e5d963cfe6f82.png

เพิ่มคีย์การทำให้ใช้งานได้ ลงในที่เก็บ GitHub โปรดตรวจสอบว่าได้อนุญาตสิทธิ์การเขียนแล้ว เมื่ออัปเดตแล้ว ให้เลือก "ทดสอบและตั้งค่าขั้นสุดท้าย"

4894e0af6421802e.png

เลือก Git Actions

e87931dbf7e265f3.png

เลือก "ทดสอบการเชื่อมต่อ Git"

73d90adf267120af.png

ตรวจสอบการทดสอบการเชื่อมต่อ Git

f69bc63b9c595aa1.png

12. ล้างข้อมูล

ลบคอมโพเนนต์ของ Lab จากเทอร์มินัล Cloud Shell เดียว

gcloud compute service-attachments delete github-svc-attachment-ssh --region=$region -q

gcloud compute forwarding-rules delete producer-github-fr --region=$region -q

gcloud compute target-tcp-proxies delete producer-lb-tcp-proxy --region=$region -q

gcloud compute backend-services delete producer-backend-svc --region=$region -q

gcloud compute network-firewall-policies rules delete 2001 --firewall-policy looker-psc-demo-policy --global-firewall-policy -q

gcloud compute network-firewall-policies associations delete --firewall-policy=looker-psc-demo-policy  --name=looker-psc-demo --global-firewall-policy -q

gcloud compute network-firewall-policies delete looker-psc-demo-policy --global -q

gcloud compute routers nats delete looker-psc-demo-natgw --router=looker-psc-demo-cloud-router --router-region=$region -q

gcloud compute routers delete looker-psc-demo-cloud-router --region=$region -q

gcloud compute addresses delete internet-neg-lb-ip --region=$region -q

gcloud compute network-endpoint-groups delete github-internet-neg-ssh --region=$region -q

gcloud compute networks subnets delete producer-psc-fr-subnet producer-psc-nat-subnet $region-proxy-only-subnet --region=$region -q

gcloud compute networks delete looker-psc-demo -q

13. ขอแสดงความยินดี

ขอแสดงความยินดี คุณได้กำหนดค่าและตรวจสอบการเชื่อมต่อกับ GitHub โดยใช้ Looker Console ที่ขับเคลื่อนโดย Private Service Connect เรียบร้อยแล้ว

คุณสร้างโครงสร้างพื้นฐานของผู้ผลิต เรียนรู้วิธีสร้าง NEG อินเทอร์เน็ต บริการของผู้ผลิต และปลายทาง PSC ของ Looker ที่อนุญาตให้เชื่อมต่อกับบริการของผู้ผลิต

Cosmopup คิดว่า Codelab นั้นยอดเยี่ยม!!

c911c127bffdee57.jpeg

สิ่งต่อไปที่ควรทำ

ลองใช้ Codelab เหล่านี้

อ่านเพิ่มเติมและวิดีโอ

เอกสารอ้างอิง