Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ chain:
default: "3"
documentation: "The number nodes to automatically create and join to the cluster."
- name: HYPERSHIFT_BASE_DOMAIN
default: "ci.hypershift.devcluster.openshift.com"
default: ""
documentation: "The cluster's FQDN will be a subdomain of the base domain."
- name: HYPERSHIFT_AWS_REGION
default: "us-east-1"
Expand All @@ -19,8 +19,19 @@ chain:
- name: EXTRA_ARGS
default: ""
documentation: "Extra args to pass to the create cluster aws command"
- name: HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT
default: "false"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw I consider hypershift-aws-create-chain.yaml deprecated. There's no semantic difference with hypershift-aws-setup-nested-management-cluster-chain.yaml which we should rename to just `hypershift-aws-create. Then is up to the workload to chain multiples creates to have nested clusters.

However I'm fine with the change for now and I'll follow up later on with the refactor above.

documentation: "Whether to use the generic CI account or the HyperShift OSD account for the guest clusters infra. For the infra created for the clusters. E.g. For cluster-bot we use the generic CI account"
commands: |-
set -exuo pipefail
AWS_GUEST_INFRA_CREDENTIALS_FILE="/etc/hypershift-ci-jobs-awscreds/credentials"
DEFAULT_BASE_DOMAIN=ci.hypershift.devcluster.openshift.com

if [[ $HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT == "true" ]]; then
AWS_GUEST_INFRA_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"
Comment thread
LiangquanLi930 marked this conversation as resolved.
Outdated
DEFAULT_BASE_DOMAIN=origin-ci-int-aws.dev.rhcloud.com
fi
DOMAIN=${HYPERSHIFT_BASE_DOMAIN:-$DEFAULT_BASE_DOMAIN}

# We don't have the value of HYPERSHIFT_RELEASE_LATEST when we set CONTROLPLANE_OPERATOR_IMAGE so we
# have to use a hack like this.
Expand All @@ -33,10 +44,10 @@ chain:
--name ${CLUSTER_NAME} \
--node-pool-replicas ${HYPERSHIFT_NODE_COUNT} \
--instance-type=m5.xlarge \
--base-domain ${HYPERSHIFT_BASE_DOMAIN} \
--base-domain ${DOMAIN} \
--region ${HYPERSHIFT_AWS_REGION} \
--pull-secret=/etc/ci-pull-credentials/.dockerconfigjson \
--aws-creds /etc/hypershift-pool-aws-credentials/credentials \
--aws-creds=${AWS_GUEST_INFRA_CREDENTIALS_FILE} \
--release-image ${RELEASE_IMAGE_LATEST} \
--control-plane-operator-image=${CONTROLPLANE_OPERATOR_IMAGE:-} \
--additional-tags="expirationDate=$(date -d '4 hours' --iso=minutes --utc)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ chain:
- name: HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT
default: "false"
documentation: "Whether to use the generic CI account or the HyperShift OSD account for the guest clusters infra. For the infra created for the clusters. E.g. For cluster-bot we use the generic CI account"
- name: HYPERSHIFT_BASE_DOMAIN
default: ""
documentation: "The cluster's FQDN will be a subdomain of the base domain."
commands: |-
AWS_GUEST_INFRA_CREDENTIALS_FILE="/etc/hypershift-ci-jobs-awscreds/credentials"
BASE_DOMAIN=ci.hypershift.devcluster.openshift.com
DEFAULT_BASE_DOMAIN=ci.hypershift.devcluster.openshift.com

if [[ $HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT == "true" ]]; then
Comment thread
LiangquanLi930 marked this conversation as resolved.
Outdated
AWS_GUEST_INFRA_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"
BASE_DOMAIN=origin-ci-int-aws.dev.rhcloud.com
DEFAULT_BASE_DOMAIN=origin-ci-int-aws.dev.rhcloud.com
fi
DOMAIN=${HYPERSHIFT_BASE_DOMAIN:-$DEFAULT_BASE_DOMAIN}

CLUSTER_NAME="$(echo -n $PROW_JOB_ID|sha256sum|cut -c-20)-mgmt"
export KUBECONFIG=/etc/hypershift-kubeconfig/hypershift-ops-admin.kubeconfig
Expand All @@ -48,7 +52,7 @@ chain:
--name="${CLUSTER_NAME}" \
--namespace="${HYPERSHIFT_NAMESPACE}" \
--infra-id=${CLUSTER_NAME} \
--base-domain=${BASE_DOMAIN}
--base-domain=${DOMAIN}
credentials:
- mount_path: /etc/hypershift-ci-jobs-awscreds
name: hypershift-ci-jobs-awscreds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,33 @@ chain:
cli: latest
env:
- name: HYPERSHIFT_BASE_DOMAIN
default: "origin-ci-int-aws.dev.rhcloud.com"
default: ""
documentation: "The cluster's FQDN will be a subdomain of the base domain."
- name: HYPERSHIFT_AWS_REGION
default: "us-east-1"
documentation: "The AWS region of the cluster."
- name: HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT
default: "false"
documentation: "Whether to use the generic CI account or the HyperShift OSD account for the guest clusters infra. For the infra created for the clusters. E.g. For cluster-bot we use the generic CI account"
commands: |-
set -exuo pipefail

AWS_GUEST_INFRA_CREDENTIALS_FILE="/etc/hypershift-ci-jobs-awscreds/credentials"
DEFAULT_BASE_DOMAIN=ci.hypershift.devcluster.openshift.com

if [[ $HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT == "true" ]]; then
Comment thread
LiangquanLi930 marked this conversation as resolved.
Outdated
AWS_GUEST_INFRA_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"
DEFAULT_BASE_DOMAIN=origin-ci-int-aws.dev.rhcloud.com
fi
DOMAIN=${HYPERSHIFT_BASE_DOMAIN:-$DEFAULT_BASE_DOMAIN}

CLUSTER_NAME="$(echo -n $PROW_JOB_ID|sha256sum|cut -c-20)"
echo "$(date) Deleting HyperShift cluster ${CLUSTER_NAME}"
bin/hypershift destroy cluster aws \
--aws-creds=/etc/hypershift-pool-aws-credentials/credentials \
--aws-creds=${AWS_GUEST_INFRA_CREDENTIALS_FILE} \
--name ${CLUSTER_NAME} \
--region ${HYPERSHIFT_AWS_REGION} \
--base-domain ${HYPERSHIFT_BASE_DOMAIN} \
--base-domain ${DOMAIN} \
--cluster-grace-period 40m
echo "$(date) Finished deleting cluster"
from_image:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ chain:
- name: HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT
default: "false"
documentation: "Whether to use the generic CI account or the HyperShift OSD account for the guest clusters infra. For the infra created for the clusters. E.g. For cluster-bot we use the generic CI account"
- name: HYPERSHIFT_BASE_DOMAIN
default: ""
documentation: "The cluster's FQDN will be a subdomain of the base domain."
- name: HYPERSHIFT_HC_RELEASE_IMAGE
default: ""
documentation: "Release image used for the HostedCluster. Empty by default so it will use the based code defaulting"
commands: |-
AWS_GUEST_INFRA_CREDENTIALS_FILE="/etc/hypershift-ci-jobs-awscreds/credentials"
BASE_DOMAIN=ci.hypershift.devcluster.openshift.com
DEFAULT_BASE_DOMAIN=ci.hypershift.devcluster.openshift.com

if [[ $HYPERSHIFT_GUEST_INFRA_OCP_ACCOUNT == "true" ]]; then
AWS_GUEST_INFRA_CREDENTIALS_FILE="${CLUSTER_PROFILE_DIR}/.awscred"
BASE_DOMAIN=origin-ci-int-aws.dev.rhcloud.com
DEFAULT_BASE_DOMAIN=origin-ci-int-aws.dev.rhcloud.com
fi
DOMAIN=${HYPERSHIFT_BASE_DOMAIN:-$DEFAULT_BASE_DOMAIN}

export KUBECONFIG=/etc/hypershift-kubeconfig/hypershift-ops-admin.kubeconfig
CLUSTER_NAME="$(echo -n $PROW_JOB_ID|sha256sum|cut -c-20)-mgmt"
Expand All @@ -38,7 +42,7 @@ chain:
--name=${CLUSTER_NAME} \
--region=us-east-1 \
--infra-id=${CLUSTER_NAME} \
--base-domain=${BASE_DOMAIN} \
--base-domain=${DOMAIN} \
--instance-type=m5.xlarge \
--zones=${HYPERSHIFT_ZONES} \
--service-cidr=172.29.0.0/16 \
Expand Down