This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.Este contenido no está disponible en el idioma seleccionado.
Chapter 20. Configuring for Azure
20.1. Overview Copiar enlaceEnlace copiado en el portapapeles!
OpenShift Container Platform can be configured to access an Azure infrastructure, including using Azure disk as persistent storage for application data. After Azure is configured properly, some additional configurations need to be completed on the OpenShift Container Platform hosts.
20.2. Permissions Copiar enlaceEnlace copiado en el portapapeles!
Configuring Azure for OpenShift Container Platform requires the following role:
Contributor | To create and manage all types of Azure resources. |
20.3. The Azure Configuration File Copiar enlaceEnlace copiado en el portapapeles!
Configuring OpenShift Container Platform for Azure requires the /etc/azure/azure.conf file, on each node host.
If the file does not exist, create it, and add the following:
- 1
- The AAD tenant ID for the subscription that the cluster is deployed in.
- 2
- The Azure subscription ID that the cluster is deployed in.
- 3
- The client ID for an AAD application with RBAC access to talk to Azure RM APIs.
- 4
- The client secret for an AAD application with RBAC access to talk to Azure RM APIs.
- 5
- Ensure this is the same as tenant ID (optional).
- 6
- The Azure Resource Group name that Azure VM belongs to.
- 7
- The compact style Azure region, for example
southeastasia
(optional).
20.4. Configuring Masters Copiar enlaceEnlace copiado en el portapapeles!
Edit or create the master configuration file on all masters (/etc/origin/master/master-config.yaml by default) and update the contents of the apiServerArguments
and controllerArguments
sections:
When triggering a containerized installation, only the /etc/origin and /var/lib/origin directories are mounted to the master and node container. Therefore, master-config.yaml should be in /etc/origin/master instead of /etc/.
20.5. Configuring Nodes Copiar enlaceEnlace copiado en el portapapeles!
Edit or create the node configuration file on all nodes (/etc/origin/node/node-config.yaml by default) and update the contents of the
kubeletArguments
section:kubeletArguments: cloud-provider: - "azure" cloud-config: - "/etc/azure/azure.conf"
kubeletArguments: cloud-provider: - "azure" cloud-config: - "/etc/azure/azure.conf"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantWhen triggering a containerized installation, only the /etc/origin and /var/lib/origin directories are mounted to the master and node container. Therefore, node-config.yaml should be in /etc/origin/node instead of /etc/.
20.6. Applying Configuration Changes Copiar enlaceEnlace copiado en el portapapeles!
Start or restart OpenShift Container Platform services on all master and node hosts to apply your configuration changes, see Restarting OpenShift Container Platform services:
systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers systemctl restart atomic-openshift-node
# systemctl restart atomic-openshift-master-api atomic-openshift-master-controllers
# systemctl restart atomic-openshift-node
Switching from not using a cloud provider to using a cloud provider produces an error message. Adding the cloud provider tries to delete the node because the node switches from using the hostname as the externalID
(which would have been the case when no cloud provider was being used) to using the cloud provider’s instance-id
(which is what the cloud provider specifies). To resolve this issue:
- Log in to the CLI as a cluster administrator.
Check and back up existing node labels:
oc describe node <node_name> | grep -Poz '(?s)Labels.*\n.*(?=Taints)'
$ oc describe node <node_name> | grep -Poz '(?s)Labels.*\n.*(?=Taints)'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the nodes:
oc delete node <node_name>
$ oc delete node <node_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow On each node host, restart the OpenShift Container Platform service.
systemctl restart atomic-openshift-node
# systemctl restart atomic-openshift-node
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Add back any labels on each node that you previously had.