@@ -79,6 +79,83 @@ run_vpc_diagnostics() {
7979 echo " "
8080}
8181
82+ run_ipi_prerequisites () {
83+ echo " ### IPI Prerequisites Check"
84+ echo " "
85+ echo " Checking if the account has the resources needed for OpenShift IPI on IBM Cloud VPC..."
86+ echo " "
87+
88+ echo " #### 1. VPC Infrastructure (create VMs, networks)"
89+ echo ' ```'
90+ if ibmcloud is vpcs 2>&1 | head -3; then
91+ echo " RESULT: VPC access OK"
92+ else
93+ echo " RESULT: FAILED — need VPC Infrastructure Administrator"
94+ fi
95+ echo ' ```'
96+ echo " "
97+
98+ echo " #### 2. Cloud Object Storage (RHCOS images, ignition)"
99+ echo ' ```'
100+ if ibmcloud resource service-instances --service-name cloud-object-storage 2>&1 | head -5; then
101+ echo " RESULT: COS access OK"
102+ else
103+ echo " RESULT: FAILED — need COS Administrator"
104+ fi
105+ echo ' ```'
106+ echo " "
107+
108+ echo " #### 3. DNS Services (cluster API/ingress records)"
109+ echo ' ```'
110+ ibmcloud plugin install dns -f 2> /dev/null || true
111+ if ibmcloud dns zones 2>&1 | head -10; then
112+ echo " RESULT: DNS Services access OK"
113+ else
114+ echo " RESULT: FAILED or no DNS zones configured — IPI needs a public DNS zone"
115+ fi
116+ echo ' ```'
117+ echo " "
118+
119+ echo " #### 4. Internet Services / CIS (alternative to DNS Services)"
120+ echo ' ```'
121+ ibmcloud plugin install cis -f 2> /dev/null || true
122+ if ibmcloud cis instances 2>&1 | head -5; then
123+ echo " RESULT: CIS access OK"
124+ else
125+ echo " RESULT: No CIS instances (may use DNS Services instead)"
126+ fi
127+ echo ' ```'
128+ echo " "
129+
130+ echo " #### 5. IAM Identity Service (service IDs for cluster components)"
131+ echo ' ```'
132+ if ibmcloud iam service-ids 2>&1 | head -5; then
133+ echo " RESULT: IAM Identity access OK"
134+ else
135+ echo " RESULT: FAILED — need IAM Identity Service Administrator"
136+ fi
137+ echo ' ```'
138+ echo " "
139+
140+ echo " #### 6. Resource groups"
141+ echo ' ```'
142+ ibmcloud resource groups 2>&1 | head -10
143+ echo ' ```'
144+ echo " "
145+
146+ echo " #### 7. IAM authorization policies (service-to-service)"
147+ echo ' ```'
148+ ibmcloud iam authorization-policies 2>&1 | head -20
149+ echo ' ```'
150+ echo " "
151+
152+ echo " #### Summary"
153+ echo " "
154+ echo " If checks 1-5 show OK and check 3 or 4 has a DNS zone, IPI should work."
155+ echo " If DNS shows no zones, a domain + DNS zone must be configured first."
156+ echo " "
157+ }
158+
82159write_diagnostics () {
83160 echo " ## IBM Cloud IAM diagnostics"
84161 echo " "
@@ -107,7 +184,9 @@ write_diagnostics() {
107184 echo ' ```'
108185 echo " "
109186
110- if [[ " ${INFRASTRUCTURE_TYPE} " == " vpc" ]]; then
187+ if [[ " ${INFRASTRUCTURE_TYPE} " == " ipi" ]]; then
188+ run_ipi_prerequisites
189+ elif [[ " ${INFRASTRUCTURE_TYPE} " == " vpc" ]]; then
111190 run_vpc_diagnostics
112191 else
113192 echo " ### Classic infrastructure permissions (missing required/suggested)"
0 commit comments