简体   繁体   中英

How to assign both external and internal static IP address to GCP VM/Dataproc cluster via Airflow

We have a requirement where we need to assign an static IP address (external and internal) to GCP VM/Dataproc Cluster's Master node while creating via Airflow.

We know its possible from GCP Console, but not sure how it can be done via Airflow or programmatically.

You need to pass hard coded value to assign the static IP addresses.You can follow the steps below to programmatically pass the static IP address:

  • Pass the hard coded IP address to natIP field in the script.
  • Perform a request to get the static IP address.
  • Extract the IP address and pass it to the script.

You can use static external IP address using this documentation and for static internal IP address you can check this link . For using the static IP addresses in airflow, you can pass the static IP address in ipConfiguration field.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM