Skip to content

Commit d16bb9c

Browse files
authored
Merge pull request #119880 from nesanton/fix/119795
Fix 119795 - remove CentOS EOL banner
2 parents f4d16ec + 0b67fac commit d16bb9c

File tree

1 file changed

+0
-302
lines changed

1 file changed

+0
-302
lines changed

articles/openshift/howto-restrict-egress.md

Lines changed: 0 additions & 302 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ ms.date: 10/10/2023
1010
---
1111
# Control egress traffic for your Azure Red Hat OpenShift (ARO) cluster
1212

13-
> [!CAUTION]
14-
> This article references CentOS, a Linux distribution that is nearing End Of Life (EOL) status. Please consider your use and planning accordingly.
15-
1613
This article provides the necessary details that allow you to secure outbound traffic from your Azure Red Hat OpenShift cluster (ARO). With the release of the [Egress Lockdown Feature](./concepts-egress-lockdown.md), all of the required connections for an ARO cluster are proxied through the service. There are additional destinations that you may want to allow to use features such as Operator Hub or Red Hat telemetry.
1714

1815
> [!IMPORTANT]
@@ -80,302 +77,3 @@ For additional information on remote health monitoring and telemetry, see the [R
8077
### Azure Monitor container insights
8178

8279
ARO clusters can be monitored using the Azure Monitor container insights extension. Review the pre-requisites and instructions for [enabling the extension](../azure-monitor/containers/container-insights-enable-arc-enabled-clusters.md).
83-
84-
---
85-
<!-- @todo Migrate this to a secondary article if we find customer demand.
86-
## Private ARO cluster setup
87-
The goal is to secure ARO cluster by routing Egress traffic through an Azure Firewall
88-
### Before:
89-
![Before](media/concepts-networking/aro-private.jpg)
90-
### After:
91-
![After](media/concepts-networking/aro-fw.jpg)
92-
93-
## Create a private ARO cluster
94-
95-
### Set up VARS for your environment
96-
```bash
97-
98-
CLUSTER=aro-cluster # Name of your created cluster
99-
RESOURCEGROUP=aro-rg # The name of your resource group where you created the ARO cluster
100-
AROVNET=aro-vnet # The name of your vnet from your created ARO cluster
101-
JUMPSUBNET=jump-subnet
102-
LOCATION=eastus # The location where ARO cluster is deployed
103-
104-
```
105-
106-
### Create a resource group
107-
```azurecli
108-
az group create -g "$RESOURCEGROUP" -l $LOCATION
109-
```
110-
111-
### Create the virtual network
112-
```azurecli
113-
az network vnet create \
114-
-g $RESOURCEGROUP \
115-
-n $AROVNET \
116-
--address-prefixes 10.0.0.0/8
117-
```
118-
119-
### Add two empty subnets to your virtual network
120-
```azurecli
121-
az network vnet subnet create \
122-
-g "$RESOURCEGROUP" \
123-
--vnet-name $AROVNET \
124-
-n "$CLUSTER-master" \
125-
--address-prefixes 10.10.1.0/24 \
126-
--service-endpoints Microsoft.ContainerRegistry
127-
128-
az network vnet subnet create \
129-
-g $RESOURCEGROUP \
130-
--vnet-name $AROVNET \
131-
-n "$CLUSTER-worker" \
132-
--address-prefixes 10.20.1.0/24 \
133-
--service-endpoints Microsoft.ContainerRegistry
134-
```
135-
136-
### Disable network policies for Private Link Service on your virtual network and subnets. This is a requirement for the ARO service to access and manage the cluster.
137-
```azurecli
138-
az network vnet subnet update \
139-
-g "$RESOURCEGROUP" \
140-
--vnet-name $AROVNET \
141-
-n "$CLUSTER-master" \
142-
--disable-private-link-service-network-policies true
143-
```
144-
### Create a Firewall Subnet
145-
```azurecli
146-
az network vnet subnet create \
147-
-g "$RESOURCEGROUP" \
148-
--vnet-name $AROVNET \
149-
-n "AzureFirewallSubnet" \
150-
--address-prefixes 10.100.1.0/26
151-
```
152-
153-
## Create a jump-host VM
154-
### Create a jump-subnet
155-
```azurecli
156-
az network vnet subnet create \
157-
-g "$RESOURCEGROUP" \
158-
--vnet-name $AROVNET \
159-
-n $JUMPSUBNET \
160-
--address-prefixes 10.30.1.0/24 \
161-
--service-endpoints Microsoft.ContainerRegistry
162-
```
163-
### Create a jump-host VM
164-
```azurecli
165-
VMUSERNAME=aroadmin
166-
167-
az vm create --name ubuntu-jump \
168-
--resource-group $RESOURCEGROUP \
169-
--generate-ssh-keys \
170-
--admin-username $VMUSERNAME \
171-
--image Ubuntu2204 \
172-
--subnet $JUMPSUBNET \
173-
--public-ip-address jumphost-ip \
174-
--vnet-name $AROVNET
175-
```
176-
177-
## Create an Azure Red Hat OpenShift cluster
178-
### Get a Red Hat pull secret (optional)
179-
180-
A Red Hat pull secret enables your cluster to access Red Hat container registries along with other content. This step is optional but recommended.
181-
182-
1. **[Go to your Red Hat OpenShift cluster manager portal](https://cloud.redhat.com/openshift/install/azure/aro-provisioned) and log in.**
183-
184-
You will need to log in to your Red Hat account or create a new Red Hat account with your business email and accept the terms and conditions.
185-
186-
2. **Click Download pull secret.**
187-
188-
Keep the saved `pull-secret.txt` file somewhere safe - it will be used in each cluster creation.
189-
190-
When running the `az aro create` command, you can reference your pull secret using the `--pull-secret @pull-secret.txt` parameter. Execute `az aro create` from the directory where you stored your `pull-secret.txt` file. Otherwise, replace `@pull-secret.txt` with `@<path-to-my-pull-secret-file`.
191-
192-
If you're copying your pull secret or referencing it in other scripts, format your pull secret as a valid JSON string.
193-
194-
```azurecli
195-
az aro create \
196-
-g "$RESOURCEGROUP" \
197-
-n "$CLUSTER" \
198-
--vnet $AROVNET \
199-
--master-subnet "$CLUSTER-master" \
200-
--worker-subnet "$CLUSTER-worker" \
201-
--apiserver-visibility Private \
202-
--ingress-visibility Private \
203-
--pull-secret @pull-secret.txt
204-
```
205-
206-
## Create an Azure Firewall
207-
208-
### Create a public IP Address
209-
```azurecli
210-
az network public-ip create -g $RESOURCEGROUP -n fw-ip --sku "Standard" --location $LOCATION
211-
```
212-
### Update install Azure Firewall extension
213-
```azurecli
214-
az extension add -n azure-firewall
215-
az extension update -n azure-firewall
216-
```
217-
218-
### Create Azure Firewall and configure IP Config
219-
```azurecli
220-
az network firewall create -g $RESOURCEGROUP -n aro-private -l $LOCATION
221-
az network firewall ip-config create -g $RESOURCEGROUP -f aro-private -n fw-config --public-ip-address fw-ip --vnet-name $AROVNET
222-
223-
```
224-
225-
### Capture Azure Firewall IPs for a later use
226-
```azurecli
227-
FWPUBLIC_IP=$(az network public-ip show -g $RESOURCEGROUP -n fw-ip --query "ipAddress" -o tsv)
228-
FWPRIVATE_IP=$(az network firewall show -g $RESOURCEGROUP -n aro-private --query "ipConfigurations[0].privateIPAddress" -o tsv)
229-
230-
echo $FWPUBLIC_IP
231-
echo $FWPRIVATE_IP
232-
```
233-
234-
### Create a UDR and Routing Table for Azure Firewall
235-
```azurecli
236-
az network route-table create -g $RESOURCEGROUP --name aro-udr
237-
238-
az network route-table route create -g $RESOURCEGROUP --name aro-udr --route-table-name aro-udr --address-prefix 0.0.0.0/0 --next-hop-type VirtualAppliance --next-hop-ip-address $FWPRIVATE_IP
239-
```
240-
241-
### Add Application Rules for Azure Firewall
242-
Example rule for telemetry to work. Additional possibilities are listed [here](https://docs.openshift.com/container-platform/4.3/installing/install_config/configuring-firewall.html#configuring-firewall_configuring-firewall):
243-
```azurecli
244-
az network firewall application-rule create -g $RESOURCEGROUP -f aro-private \
245-
--collection-name 'ARO' \
246-
--action allow \
247-
--priority 100 \
248-
-n 'required' \
249-
--source-addresses '*' \
250-
--protocols 'http=80' 'https=443' \
251-
--target-fqdns 'cert-api.access.redhat.com' 'api.openshift.com' 'api.access.redhat.com' 'infogw.api.openshift.com'
252-
```
253-
Optional rules for Docker images:
254-
```azurecli
255-
az network firewall application-rule create -g $RESOURCEGROUP -f aro-private \
256-
--collection-name 'Docker' \
257-
--action allow \
258-
--priority 200 \
259-
-n 'docker' \
260-
--source-addresses '*' \
261-
--protocols 'http=80' 'https=443' \
262-
--target-fqdns '*cloudflare.docker.com' '*registry-1.docker.io' 'apt.dockerproject.org' 'auth.docker.io'
263-
```
264-
265-
### Associate ARO Subnets to FW
266-
```azurecli
267-
az network vnet subnet update -g $RESOURCEGROUP --vnet-name $AROVNET --name "$CLUSTER-master" --route-table aro-udr
268-
az network vnet subnet update -g $RESOURCEGROUP --vnet-name $AROVNET --name "$CLUSTER-worker" --route-table aro-udr
269-
```
270-
271-
## Test the configuration from the Jumpbox
272-
These steps work only if you added rules for Docker images.
273-
### Configure the jumpbox
274-
Log in to a jumpbox VM and install `azure-cli`, `oc-cli`, and `jq` utils. For the installation of openshift-cli, check the Red Hat customer portal.
275-
```bash
276-
#Install Azure-cli
277-
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
278-
#Install jq
279-
sudo apt install jq -y
280-
```
281-
### Log in to the ARO cluster
282-
List cluster credentials:
283-
```bash
284-
285-
# Login to Azure
286-
az login
287-
# Set Vars in Jumpbox
288-
CLUSTER=aro-cluster # Name of your created cluster
289-
RESOURCEGROUP=aro-rg # The name of your resource group where you created the ARO cluster
290-
291-
#Get the cluster credentials
292-
ARO_PASSWORD=$(az aro list-credentials -n $CLUSTER -g $RESOURCEGROUP -o json | jq -r '.kubeadminPassword')
293-
ARO_USERNAME=$(az aro list-credentials -n $CLUSTER -g $RESOURCEGROUP -o json | jq -r '.kubeadminUsername')
294-
```
295-
Get an API server endpoint:
296-
```azurecli
297-
ARO_URL=$(az aro show -n $CLUSTER -g $RESOURCEGROUP -o json | jq -r '.apiserverProfile.url')
298-
```
299-
300-
### Download the oc CLI to the jumpbox
301-
```bash
302-
cd ~
303-
wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz
304-
305-
mkdir openshift
306-
tar -zxvf openshift-client-linux.tar.gz -C openshift
307-
echo 'export PATH=$PATH:~/openshift' >> ~/.bashrc && source ~/.bashrc
308-
```
309-
310-
Log in using `oc login`:
311-
```bash
312-
oc login $ARO_URL -u $ARO_USERNAME -p $ARO_PASSWORD
313-
```
314-
315-
### Run CentOS to test outside connectivity
316-
Create a pod
317-
```bash
318-
cat <<EOF | oc apply -f -
319-
apiVersion: v1
320-
kind: Pod
321-
metadata:
322-
name: centos
323-
spec:
324-
containers:
325-
- name: centos
326-
image: centos
327-
ports:
328-
- containerPort: 80
329-
command:
330-
- sleep
331-
- "3600"
332-
EOF
333-
```
334-
Once the pod is running, exec into it and test outside connectivity.
335-
336-
```bash
337-
oc exec -it centos -- /bin/bash
338-
curl microsoft.com
339-
```
340-
341-
## Access the web console of the private cluster
342-
343-
### Set up ssh forwards commands
344-
345-
```bash
346-
sudo ssh -i $SSH_PATH -L 443:$CONSOLE_URL:443 aroadmin@$JUMPHOST
347-
348-
example:
349-
sudo ssh -i /Users/jimzim/.ssh/id_rsa -L 443:console-openshift-console.apps.d5xm5iut.eastus.aroapp.io:443 [email protected]
350-
```
351-
352-
### Modify the etc. hosts file on your local machine
353-
```bash
354-
##
355-
# Host Database
356-
#
357-
127.0.0.1 console-openshift-console.apps.d5xm5iut.eastus.aroapp.io
358-
127.0.0.1 oauth-openshift.apps.d5xm5iut.eastus.aroapp.io
359-
```
360-
361-
### Use sshuttle as another option
362-
363-
[SSHuttle](https://github.com/sshuttle/sshuttle)
364-
365-
366-
## Clean up resources
367-
368-
```azurecli
369-
370-
# Clean up the ARO cluster, vnet, firewall and jumpbox
371-
372-
# Remove udr from master and worker subnets first or will get error when deleting ARO cluster
373-
az network vnet subnet update --vnet-name $AROVNET -n aro-cluster-master -g $RESOURCEGROUP --route-table aro-udr --remove routeTable
374-
az network vnet subnet update --vnet-name $AROVNET -n aro-cluster-worker -g $RESOURCEGROUP --route-table aro-udr --remove routeTable
375-
376-
# Remove ARO Cluster
377-
az aro delete -n $CLUSTER -g $RESOURCEGROUP
378-
379-
# Remove the resource group that contains the firewall, jumpbox and vnet
380-
az group delete -n $RESOURCEGROUP
381-
``` -->

0 commit comments

Comments
 (0)