ניהול ה-Fleet באמצעות מדיניות ארגונית מותאמת אישית
אתם יכולים להשתמש בOrganization Policy Service עם אילוצים בהתאמה אישית כדי לאכוף הגדרות ספציפיות באשכולות של Managed Service for Apache Spark בארגון. הגישה המרכזית הזו עוזרת להבטיח תאימות, לשלוט בעלויות ולתקנן את צי המכונות שלכם ב-Managed Service for Apache Spark.
במדריך הזה מוסבר איך ליצור ולאכוף מדיניות ארגונית בהתאמה אישית עבור אשכולות של Managed Service for Apache Spark. מידע נוסף זמין במאמר מבוא למדיניות הארגון.
לפני שמתחילים
- נכנסים לחשבון Google Cloud . אם אתם משתמשים חדשים ב- Google Cloud, צרו חשבון כדי שתוכלו להעריך את הביצועים של המוצרים שלנו בתרחישים מהעולם האמיתי. לקוחות חדשים מקבלים בחינם גם קרדיט בשווי 300$ להרצה, לבדיקה ולפריסה של עומסי העבודה.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Resource Manager API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Make sure that you have the following role or roles on the project: Organization Policy Administrator
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
- Click Grant access.
-
In the New principals field, enter your user identifier. This is typically the email address for a Google Account.
- Click Select a role, then search for the role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
-
-
התקינו את ה-CLI של Google Cloud.
-
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
-
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloud init -
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Roles required to select or create a project
- Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
-
Create a project: To create a project, you need the Project Creator role
(
roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Verify that billing is enabled for your Google Cloud project.
Enable the Resource Manager API.
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.-
Make sure that you have the following role or roles on the project: Organization Policy Administrator
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
- Click Grant access.
-
In the New principals field, enter your user identifier. This is typically the email address for a Google Account.
- Click Select a role, then search for the role.
- To grant additional roles, click Add another role and add each additional role.
- Click Save.
-
-
התקינו את ה-CLI של Google Cloud.
-
אם אתם משתמשים בספק זהויות חיצוני (IdP), קודם אתם צריכים להיכנס ל-CLI של gcloud באמצעות המאגר המאוחד לניהול זהויות.
-
כדי לאתחל את ה-CLI של gcloud, הריצו את הפקודה הבאה:
gcloud init
החלת אילוץ מותאם אישית
בשלבים הבאים מוסבר איך לאכוף דרישת אבטחה נפוצה: לוודא ש-Kerberos מופעל בכל האשכולות החדשים של Managed Service for Apache Spark.
מגדירים את האילוץ המותאם אישית.
- יוצרים קובץ YAML עם התוכן הבא:
name: organizations/ORGANIZATION_ID/customConstraints/custom.dataprocKerberos resourceTypes: - dataproc.googleapis.com/Cluster methodTypes: - CREATE condition: "resource.config.securityConfig.kerberosConfig.enableKerberos == true" actionType: ALLOW displayName: Cluster must have Kerberos enabled.מחליפים את
ORGANIZATION_IDבמזהה הארגון.מגדירים את האילוץ המותאם אישית כך שיהיה זמין לארגון.
gcloud org-policies set-custom-constraint CONSTRAINT_PATHמחליפים את הערך
CONSTRAINT_PATHבנתיב לקובץ האילוצים בפורמט YAML.יוצרים מדיניות ארגון שאוכפת את האילוץ.
- יוצרים עוד קובץ YAML עם התוכן הבא:
name: projects/PROJECT_ID/policies/custom.dataprocKerberos spec: rules: - enforce: trueמחליפים את
PROJECT_IDבמזהה הפרויקט שרוצים להחיל עליו את המדיניות. אפשר להחיל את המדיניות הזו גם ברמת התיקייה או הארגון.מחילים את המדיניות.
gcloud org-policies set-policy POLICY_PATHמחליפים את הערך
POLICY_PATHבנתיב לקובץ מדיניות ה-YAML.
אחרי שמחילים את המדיניות, ניסיון ליצור אשכול של Managed Service for Apache Spark במשאב שצוין בלי ש-Kerberos מופעל ייכשל.
תרחישי שימוש במגבלות מותאמות אישית
אתם יכולים ליצור אילוצים מותאמים אישית כדי לאכוף מגוון רחב של כללי מדיניות בצי שלכם ב-Managed Service for Apache Spark. החלת מדיניות על צי הרכבים עוזרת לשלוט בעלויות, ליצור סטנדרטיזציה ולשפר את האבטחה.
דוגמה: אפשר לדרוש סוגים ספציפיים של מכונות או למנוע כתובות IP ציבוריות בצמתי אשכול.