-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create ARO cluster with pre-existing network security group. #57548
Open
mgahagan73
wants to merge
5
commits into
openshift:master
Choose a base branch
from
mgahagan73:aro-byo-nsg-2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+125
−1
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7912bb1
create aro cluster with pre-existing network security group
mgahagan73 0b402e9
add nsg to provisoner
mgahagan73 bc52b09
fix quoting
mgahagan73 2aa5ae8
openshift-verification-tests-master__installer-rehearse-4.15.yaml
mgahagan73 9dd4d0d
try without quotes
mgahagan73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../OWNERS |
45 changes: 45 additions & 0 deletions
45
ci-operator/step-registry/aro/provision/nsg/aro-provision-nsg-commands.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,45 @@ | ||||||||
#!/bin/bash | ||||||||
|
||||||||
set -o nounset | ||||||||
set -o errexit | ||||||||
set -o pipefail | ||||||||
|
||||||||
#echo "Installing oc binary" | ||||||||
#curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/latest/openshift-client-linux.tar.gz | tar zxvf - oc | ||||||||
#chmod +x oc | ||||||||
CLUSTER=${CLUSTER:="${NAMESPACE}-${UNIQUE_HASH}"} | ||||||||
RESOURCEGROUP=${RESOURCEGROUP:=$(cat "${SHARED_DIR}/resourcegroup")} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The step does not declare
Suggested change
|
||||||||
VNET=${VNET:=$(cat "${SHARED_DIR}"/vnet)} | ||||||||
LOCATION=${LOCATION:=${LEASED_RESOURCE}} | ||||||||
AZURE_AUTH_LOCATION="${CLUSTER_PROFILE_DIR}/osServicePrincipal.json" | ||||||||
AZURE_AUTH_CLIENT_ID="$(<"${AZURE_AUTH_LOCATION}" jq -r .clientId)" | ||||||||
AZURE_AUTH_CLIENT_SECRET="$(<"${AZURE_AUTH_LOCATION}" jq -r .clientSecret)" | ||||||||
AZURE_AUTH_TENANT_ID="$(<"${AZURE_AUTH_LOCATION}" jq -r .tenantId)" | ||||||||
MASTER_SUBNET_NAME=${MASTER_SUBNET_NAME:=$(grep controlPlaneSubnet ${SHARED_DIR}/customer_vnet_subnets.yaml | cut -d ":" -f 2 | tr -d "[:blank:]")} | ||||||||
WORKER_SUBNET_NAME=${WORKER_SUBNET_NAME:=$(grep computeSubnet ${SHARED_DIR}/customer_vnet_subnets.yaml | cut -d ":" -f 2 | tr -d "[:blank:]")} | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
NSG=${NSG:=${CLUSTER}-nsg} | ||||||||
NSG_OPEN_PORTS=${NSG_OPEN_PORTS:="80 443 6443"} | ||||||||
|
||||||||
# get az-cli, do feature adds for cloud if needed | ||||||||
# | ||||||||
echo "Logging into Azure Cloud" | ||||||||
# log in with az | ||||||||
if [[ "${CLUSTER_TYPE}" == "azuremag" ]]; then | ||||||||
az cloud set --name AzureUSGovernment | ||||||||
else | ||||||||
az cloud set --name AzureCloud | ||||||||
fi | ||||||||
az login --service-principal -u "${AZURE_AUTH_CLIENT_ID}" -p "${AZURE_AUTH_CLIENT_SECRET}" --tenant "${AZURE_AUTH_TENANT_ID}" --output none | ||||||||
|
||||||||
echo "Creating nsg: ${NSG} in resource group ${RESOURCEGROUP} in location: ${LOCATION}" | ||||||||
# see https://raw.githubusercontent.com/openshift/osde2e/main/ci/create-aro-cluster.sh | ||||||||
# create the resourcegroup to contain the cluster object and vnet | ||||||||
az network nsg create -g "${RESOURCEGROUP}" -n "${NSG}" | ||||||||
az network nsg rule create -g "${RESOURCEGROUP}" --nsg-name "${NSG}" -n "${NSG}-allow" --priority 1000 --access Allow --source-port-ranges "*" --destination-port-ranges ${NSG_OPEN_PORTS} | ||||||||
echo "Updating ${MASTER_SUBNET_NAME} in vnet ${VNET}, attaching ${NSG}" | ||||||||
az network vnet subnet update -g "${RESOURCEGROUP}" -n "${MASTER_SUBNET_NAME}" --vnet-name "${VNET}" --network-security-group "${NSG}" | ||||||||
echo "Updating ${WORKER_SUBNET_NAME} in vnet ${VNET}, attaching ${NSG}" | ||||||||
az network vnet subnet update -g "${RESOURCEGROUP}" -n "${WORKER_SUBNET_NAME}" --vnet-name "${VNET}" --network-security-group "${NSG}" | ||||||||
|
||||||||
|
||||||||
|
17 changes: 17 additions & 0 deletions
17
ci-operator/step-registry/aro/provision/nsg/aro-provision-nsg-ref.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"path": "aro/provision/nsg/aro-provision-nsg-ref.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"jianlinliu", | ||
"yunjiang29", | ||
"mgahagan73", | ||
"MayXuQQ" | ||
], | ||
"reviewers": [ | ||
"jianlinliu", | ||
"yunjiang29", | ||
"mgahagan73", | ||
"MayXuQQ" | ||
] | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
ci-operator/step-registry/aro/provision/nsg/aro-provision-nsg-ref.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ref: | ||
as: aro-provision-nsg | ||
from_image: | ||
namespace: ocp | ||
name: "4.14" | ||
tag: upi-installer | ||
commands: aro-provision-nsg-commands.sh | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 100Mi | ||
env: | ||
- name: NSG_OPEN_PORTS | ||
default: "80 443 6443" | ||
documentation: "Space separated list of ports to open for the network security group" | ||
documentation: |- | ||
Provision a custom network security group for an aro cluster. |
1 change: 1 addition & 0 deletions
1
ci-operator/step-registry/cucushift/installer/rehearse/azure/aro/byonsg/OWNERS
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../OWNERS |
17 changes: 17 additions & 0 deletions
17
...rse/azure/aro/byonsg/cucushift-installer-rehearse-azure-aro-byonsg-workflow.metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"path": "cucushift/installer/rehearse/azure/aro/byonsg/cucushift-installer-rehearse-azure-aro-byonsg-workflow.yaml", | ||
"owners": { | ||
"approvers": [ | ||
"jianlinliu", | ||
"yunjiang29", | ||
"jinyunma", | ||
"mgahagan73" | ||
], | ||
"reviewers": [ | ||
"jianlinliu", | ||
"yunjiang29", | ||
"jinyunma", | ||
"mgahagan73" | ||
] | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ler/rehearse/azure/aro/byonsg/cucushift-installer-rehearse-azure-aro-byonsg-workflow.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
workflow: | ||
as: cucushift-installer-rehearse-azure-aro-byonsg | ||
steps: | ||
pre: | ||
- ref: azure-provision-resourcegroup | ||
- ref: aro-provision-vnet | ||
- ref: aro-provision-nsg | ||
- ref: aro-provision-cluster | ||
- ref: ipi-install-rbac | ||
- ref: openshift-cluster-bot-rbac | ||
- ref: enable-qe-catalogsource | ||
post: | ||
- ref: aro-deprovision | ||
env: | ||
ARO_BYO_NSG: "true" | ||
documentation: |- | ||
This is the workflow to trigger Prow's rehearsal test when submitting installer steps/chain/workflow for aro |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The step does not declare
CLUSTER
env, so I think it should be: