Skip to content

Commit

Permalink
local changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mtulio committed Jan 30, 2025
1 parent 20725d0 commit 58a4e5e
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 82 deletions.
7 changes: 4 additions & 3 deletions docs/guides/ocp-aws-outposts.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ Removing debug pod ...
- Create the application
```sh
APP_NAME=myapp-outpost
APP_NAME=sample-outpost
cat << EOF > ./outpost-app.yaml
kind: Namespace
apiVersion: v1
Expand Down Expand Up @@ -673,6 +673,7 @@ spec:
name: echoserver
ports:
- containerPort: 8080
protocol: TCP
volumeMounts:
- mountPath: "/mnt/storage"
name: data
Expand Down Expand Up @@ -723,7 +724,7 @@ metadata:
spec:
ports:
- port: 80
targetPort: 8080
targetPort: 30080
protocol: TCP
type: NodePort
selector:
Expand Down Expand Up @@ -1733,4 +1734,4 @@ aws cloudformation delete-stack --stack-name ${STACK_NAME}
- [AWS Doc: What is AWS Outposts?](https://docs.aws.amazon.com/outposts/latest/userguide/what-is-outposts.html)
- [AWS Doc: How AWS Outposts works](https://docs.aws.amazon.com/outposts/latest/userguide/how-outposts-works.html)
- [AWS Blog: Configuring an Application Load Balancer on AWS Outposts](https://aws.amazon.com/blogs/networking-and-content-delivery/configuring-an-application-load-balancer-on-aws-outposts/)
- [AWS Doc Outposts: Customer-owned IP addresses](https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing)
- [AWS Doc Outposts: Customer-owned IP addresses](https://docs.aws.amazon.com/outposts/latest/userguide/routing.html#ip-addressing)
29 changes: 13 additions & 16 deletions docs/guides/ocp-install-profiles/ocp-aws-byo-vpc-multi-cidr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Deploy OpenShift on AWS in BYO VPC with multi-CDIR blocks.

> Those steps are part of investigation. Needs refinement before publish
> Those steps are part of investigation. Needs refinement before publish.
## BYO VPC with Multi-CIDR

```sh
INSTALLER_BIN="./openshift-install"
INSTALLER_BIN="openshift-install-devel-capa-t"
PULL_SECRET_FILE="${HOME}/.openshift/pull-secret-latest.json"
CLUSTER_NAME=byvpccidr-v0
CLUSTER_NAME=byvpccidr-v1
INSTALL_DIR=${HOME}/openshift-labs/$CLUSTER_NAME
CLUSTER_BASE_DOMAIN=devcluster.openshift.com
SSH_PUB_KEY_FILE=$HOME/.ssh/id_rsa.pub
Expand All @@ -18,27 +18,25 @@ REGION=us-east-1
AWS_REGION=$REGION
mkdir -p $INSTALL_DIR && cd $INSTALL_DIR

MACHINE_CIDR="10.115.0.0/16"
#MACHINE_CIDR="10.190.0.0/16"
VPC_CIDR_PRIMARY="10.0.0.0/16"
VPC_CIDR_SECONDARY="10.134.0.0/16"
MACHINE_CIDR="$VPC_CIDR_SECONDARY"

# Create VPC
cp ~/go/src/github.com/mtulio/mtulio.labs-articles/docs/guides/ocp-aws-byo-vpc-multi-cidr_cfn-vpc.yaml $INSTALL_DIR/vpc.yaml
cp ~/go/src/github.com/mtulio/mtulio.labs-articles/docs/guides/ocp-install-profiles/ocp-aws-byo-vpc-multi-cidr_cfn-vpc.yaml $INSTALL_DIR/vpc.yaml

STACK_VPC="${CLUSTER_NAME}-vpc"
aws cloudformation create-stack --region $REGION --stack-name ${STACK_VPC} \
--template-body file://$INSTALL_DIR/vpc.yaml \
--parameters \
ParameterKey=VpcCidr2,ParameterValue=${MACHINE_CIDR}
ParameterKey=VpcCidr,ParameterValue=${VPC_CIDR_PRIMARY} \
ParameterKey=VpcCidr2,ParameterValue=${VPC_CIDR_SECONDARY}

aws --region $REGION cloudformation wait stack-create-complete --stack-name ${STACK_VPC}
aws --region $REGION cloudformation describe-stacks --stack-name ${STACK_VPC}

# Extract subnet IDs
mapfile -t SUBNETS < <(aws --region $REGION cloudformation describe-stacks --stack-name "${STACK_VPC}" --query "Stacks[0].Outputs[?OutputKey=='PublicSubnetIds'].OutputValue" --output text | tr ',' '\n')

echo ${SUBNETS[@]}

mapfile -t -O "${#SUBNETS[@]}" SUBNETS < <(aws --region $REGION cloudformation describe-stacks --stack-name "${STACK_VPC}" --query "Stacks[0].Outputs[?OutputKey=='PrivateSubnetIds'].OutputValue" --output text | tr ',' '\n')
mapfile -t SUBNETS < <(aws --region $REGION cloudformation describe-stacks --stack-name "${STACK_VPC}" --query "Stacks[0].Outputs[?OutputKey=='SubnetsIdsForCidr2'].OutputValue" --output text | tr ',' '\n')

echo ${SUBNETS[@]}

Expand All @@ -49,11 +47,11 @@ mkdir -p ${INSTALL_DIR}
cat <<EOF | envsubst > ${INSTALL_DIR}/install-config.yaml
apiVersion: v1
baseDomain: ${CLUSTER_BASE_DOMAIN}
metadata:
name: "${CLUSTER_NAME}"
featureSet: CustomNoUpgrade
featureGates:
- ClusterAPIInstall=true
metadata:
name: "${CLUSTER_NAME}"
platform:
aws:
region: ${REGION}
Expand All @@ -71,7 +69,6 @@ sshKey: |
$(cat ${SSH_PUB_KEY_FILE})
EOF

OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="quay.io/openshift-release-dev/ocp-release:4.16.0-ec.6-x86_64" \
OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE="quay.io/openshift-release-dev/ocp-release:4.17.0-rc.1-x86_64" \
$INSTALLER_BIN create cluster --dir $INSTALL_DIR --log-level=debug
```

Loading

0 comments on commit 58a4e5e

Please sign in to comment.