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
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,15 @@ azure-secrets:
oc create secret generic codecov-token --from-literal=upload=${CODECOV_UPLOAD_TOKEN} -o yaml --dry-run | oc apply -n azure -f -
.PHONY: azure-secrets

azure4-secrets:
Copy link
Contributor

Choose a reason for hiding this comment

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

Please call this azure-e2e-secrets for now (azure4 is confusing). @jim-minter since azure is camping on the convention that the rest of the e2e suites run, I would prefer if you guys can over time migrate from azure-secrets to azure-aro-secrets or similar. The base namespace belongs to the core CI platform.

oc create secret generic cluster-secrets-azure4 \
--from-file=cluster/test-deploy/azure4/osServicePrincipal.json \
Copy link
Contributor

Choose a reason for hiding this comment

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

This actually shouldn't be used, can you remove this section? ci-operator/populate-secrets-from-bitwarden is used instead.

--from-file=cluster/test-deploy/azure4/pull-secret \
--from-file=cluster/test-deploy/azure4/ssh-privatekey \
--from-file=cluster/test-deploy/azure4/ssh-publickey \
-o yaml --dry-run | oc apply -n ocp -f -
.PHONY: azure4-secrets

metering:
$(MAKE) -C projects/metering
.PHONY: metering
Expand Down
9 changes: 9 additions & 0 deletions ci-operator/SECRETS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@ currently exist:
| `metrics-int.key` | Azure Geneva metrics authentication key |
| `system-docker-config.json` | Root/node/system level docker config.json file, currently holding access registry.redhat.io |

#### `cluster-secrets-azure4`

| Key | Description |
| ----------------------------------| ----------- |
| `osServicePrincipal.json` | Credentials for the Azure API. This is a json file that contains fields described in [upstream credentials doc](https://docs.microsoft.com/en-us/azure-stack/operator/azure-stack-create-service-principals#create-a-service-principal-using-a-client-secret). |
Copy link
Contributor

Choose a reason for hiding this comment

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

@coverprice this would be the secret we need in bitwarden

| `pull-secret` | Credentials for pulling OpenShift images from Quay and for authenticating to telemetry. Retrieved from [try.openshift.com](https://try.openshift.com) under the [email protected] account, and has the service account token from the `ocp` namespace added with `oc registry login --to=/tmp/pull-secret -z default -n ocp`.|
| `ssh-privatekey` | Private half of the SSH key, for connecting to Azure VMs. |
| `ssh-publickey` | Public half of the SSH key, for connecting to Azure VMs. |

#### `cluster-secrets-vsphere`

| Key | Description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@ tests:
openshift_installer:
cluster_profile: aws
upgrade: false
- as: e2e-azure
commands: TEST_SUITE=openshift/conformance/parallel run-tests
openshift_installer:
cluster_profile: azure4
upgrade: false
- as: e2e-aws-upgrade
commands: TEST_SUITE=all run-upgrade-tests
openshift_installer:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,71 @@ presubmits:
secret:
secretName: sentry-dsn
trigger: (?m)^/test( | .* )e2e-aws-upi,?($|\s.*)
- agent: kubernetes
always_run: false
branches:
- master
context: ci/prow/e2e-azure
decorate: true
decoration_config:
skip_cloning: true
labels:
ci-operator.openshift.io/prowgen-controlled: "true"
name: pull-ci-openshift-installer-master-e2e-azure
optional: true
rerun_command: /test e2e-azure
spec:
containers:
- args:
- --artifact-dir=$(ARTIFACTS)
- --give-pr-author-access-to-namespace=true
- --secret-dir=/usr/local/e2e-azure-cluster-profile
- --sentry-dsn-path=/etc/sentry-dsn/ci-operator
- --target=e2e-azure
- --template=/usr/local/e2e-azure
command:
- ci-operator
env:
- name: CLUSTER_TYPE
value: azure4
- name: CONFIG_SPEC
valueFrom:
configMapKeyRef:
key: openshift-installer-master.yaml
name: ci-operator-master-configs
- name: JOB_NAME_SAFE
value: e2e-azure
- name: TEST_COMMAND
value: TEST_SUITE=openshift/conformance/parallel run-tests
image: ci-operator:latest
imagePullPolicy: Always
name: ""
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /usr/local/e2e-azure-cluster-profile
name: cluster-profile
- mountPath: /usr/local/e2e-azure
name: job-definition
subPath: cluster-launch-installer-e2e.yaml
- mountPath: /etc/sentry-dsn
name: sentry-dsn
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: cluster-profile
projected:
sources:
- secret:
name: cluster-secrets-azure4
- configMap:
name: prow-job-cluster-launch-installer-e2e
name: job-definition
- name: sentry-dsn
secret:
secretName: sentry-dsn
trigger: (?m)^/test( | .* )e2e-azure,?($|\s.*)
- agent: kubernetes
always_run: false
branches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ parameters:
- name: RELEASE_IMAGE_LATEST
required: true
- name: BASE_DOMAIN
value: origin-ci-int-aws.dev.rhcloud.com
required: true

objects:

Expand Down Expand Up @@ -97,6 +95,8 @@ objects:
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /tmp/cluster/.awscred
- name: AZURE_AUTH_LOCATION
value: /tmp/cluster/osServicePrincipal.json
- name: ARTIFACT_DIR
value: /tmp/artifacts
- name: HOME
Expand Down Expand Up @@ -154,6 +154,12 @@ objects:
# TODO: make openshift-tests auto-discover this from cluster config
export TEST_PROVIDER='{"type":"aws","region":"us-east-1","zone":"us-east-1a","multizone":true,"multimaster":true}'
export KUBE_SSH_USER=core
elif [[ "${CLUSTER_TYPE}" == "azure" ]]; then
mkdir -p ~/.ssh
export PROVIDER_ARGS="-provider=azure -gce-zone=centralus"
# TODO: make openshift-tests auto-discover this from cluster config
export TEST_PROVIDER='{"type":"azure","region":"centralus","multizone":true,"multimaster":true}'
export KUBE_SSH_USER=core
fi

mkdir -p /tmp/output
Expand Down Expand Up @@ -527,6 +533,10 @@ objects:
value: /etc/openshift-installer/.awscred
- name: AWS_REGION
value: us-east-1
- name: AZURE_AUTH_LOCATION
value: /etc/openshift-installer/osServicePrincipal.json
- name: AZURE_REGION
value: centralus
- name: CLUSTER_NAME
value: ${NAMESPACE}-${JOB_NAME_HASH}
- name: BASE_DOMAIN
Expand Down Expand Up @@ -567,8 +577,8 @@ objects:

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1beta4
baseDomain: ${BASE_DOMAIN}
apiVersion: v1
baseDomain: ${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}
metadata:
name: ${CLUSTER_NAME}
controlPlane:
Expand Down Expand Up @@ -597,6 +607,27 @@ objects:
sshKey: |
${SSH_PUB_KEY}
EOF
elif [[ "${CLUSTER_TYPE}" == "azure4" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1
baseDomain: ${BASE_DOMAIN:-ci.azure.devcluster.openshift.com}
metadata:
name: ${CLUSTER_NAME}
controlPlane:
name: master
replicas: 3
compute:
- name: worker
replicas: 3
Copy link
Member

Choose a reason for hiding this comment

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

I don't see a need to set controlPlane or compute unless we're overriding defaults. Same for networking below (I've filed #3914 to drop unnecessary networking entries from master).

platform:
azure:
baseDomainResourceGroupName: os4-common
region: ${AZURE_REGION}
pullSecret: >
${PULL_SECRET}
sshKey: |
${SSH_PUB_KEY}
EOF
else
echo "Unsupported cluster type '${CLUSTER_NAME}'"
exit 1
Expand All @@ -621,6 +652,14 @@ objects:
value: ${NAMESPACE}-${JOB_NAME_HASH}
- name: TYPE
value: ${CLUSTER_TYPE}
- name: AWS_SHARED_CREDENTIALS_FILE
value: /etc/openshift-installer/.awscred
- name: AWS_REGION
value: us-east-1
- name: AZURE_AUTH_LOCATION
value: /etc/openshift-installer/osServicePrincipal.json
- name: AZURE_REGION
value: centralus
- name: KUBECONFIG
value: /tmp/artifacts/installer/auth/kubeconfig
command:
Expand Down Expand Up @@ -760,7 +799,6 @@ objects:
wait

echo "Deprovisioning cluster ..."
export AWS_SHARED_CREDENTIALS_FILE=/etc/openshift-installer/.awscred
openshift-install --dir /tmp/artifacts/installer destroy cluster
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ parameters:
- name: RESOURCES_TEST
value: '{"requests": {"cpu": 1, "memory": "300Mi"}, "limits": {"memory": "3Gi"}}'
- name: BASE_DOMAIN
value: origin-ci-int-aws.dev.rhcloud.com
required: true

objects:

Expand Down Expand Up @@ -98,6 +96,8 @@ objects:
env:
- name: AWS_SHARED_CREDENTIALS_FILE
value: /tmp/cluster/.awscred
- name: AZURE_AUTH_LOCATION
value: /tmp/cluster/osServicePrincipal.json
- name: ARTIFACT_DIR
value: /tmp/artifacts
- name: HOME
Expand Down Expand Up @@ -157,6 +157,13 @@ objects:
# TODO: make openshift-tests auto-discover this from cluster config
export TEST_PROVIDER='{"type":"aws","region":"us-east-1","zone":"us-east-1a","multizone":true,"multimaster":true}'
export KUBE_SSH_USER=core
elif [[ "${CLUSTER_TYPE}" == "azure" ]]; then
mkdir -p ~/.ssh
export PROVIDER_ARGS="-provider=azure -gce-zone=centralus"
# TODO: make openshift-tests auto-discover this from cluster config
export TEST_PROVIDER='{"type":"azure","region":"centralus","multizone":true,"multimaster":true}'
export KUBE_SSH_USER=core
fi
Copy link
Member

Choose a reason for hiding this comment

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

@spadgett is fixing this if-before-an-elif in #3954.

elif [[ "${CLUSTER_TYPE}" == "openstack" ]]; then
mkdir -p ~/.ssh
cp /tmp/cluster/ssh-privatekey ~/.ssh/kube_openstack_rsa || true
Expand All @@ -182,6 +189,10 @@ objects:
value: /etc/openshift-installer/.awscred
- name: AWS_REGION
value: us-east-1
- name: AZURE_AUTH_LOCATION
value: /etc/openshift-installer/osServicePrincipal.json
- name: AZURE_REGION
value: centralus
- name: CLUSTER_NAME
value: ${NAMESPACE}-${JOB_NAME_HASH}
- name: BASE_DOMAIN
Expand Down Expand Up @@ -225,8 +236,8 @@ objects:

if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1beta4
baseDomain: ${BASE_DOMAIN}
apiVersion: v1
Copy link
Contributor

Choose a reason for hiding this comment

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

Is v1 supported back to rc5? Note from now on you can't bump this ever because 4.1 clusters have to be able to install using this template (templates have to work for all 4.y GA versions).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We GA'd the v1 API before rc4 openshift/installer#1589 (April 14)

baseDomain: ${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}
metadata:
name: ${CLUSTER_NAME}
controlPlane:
Expand Down Expand Up @@ -255,10 +266,31 @@ objects:
sshKey: |
${SSH_PUB_KEY}
EOF
elif [[ "${CLUSTER_TYPE}" == "azure4" ]]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer cluster type to be azure - you can still mount the other secrets to the azure name even if the secret name is different.

cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1
baseDomain: ${BASE_DOMAIN:-ci.azure.devcluster.openshift.com}
metadata:
name: ${CLUSTER_NAME}
controlPlane:
name: master
replicas: 3
compute:
- name: worker
replicas: 3
platform:
azure:
baseDomainResourceGroupName: os4-common
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this already a set name? Something that is part of the account?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

installer currently picks the first DNS Zone from the account based on the base domain, while most cloud providers allow multiple DNS zones with the same name.

We have https://jira.coreos.com/browse/CORS-1070 already in pipeline to allow users to choose the exact Zone (without the guessing). But Microsoft people were far too un-comfortable with leaving the guessing for Azure addition and insisted we add this field to Azure platform while we were frozen for AWS.

Something that is part of the account?

Yes this resource group is present in the CI subscription.

region: ${AZURE_REGION}
pullSecret: >
${PULL_SECRET}
sshKey: |
${SSH_PUB_KEY}
EOF
elif [[ "${CLUSTER_TYPE}" == "openstack" ]]; then
cat > /tmp/artifacts/installer/install-config.yaml << EOF
apiVersion: v1beta4
baseDomain: ${BASE_DOMAIN}
apiVersion: v1
baseDomain: ${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}
metadata:
name: ${CLUSTER_NAME}
platform:
Expand Down Expand Up @@ -296,6 +328,14 @@ objects:
value: ${NAMESPACE}-${JOB_NAME_HASH}
- name: TYPE
value: ${CLUSTER_TYPE}
- name: AWS_SHARED_CREDENTIALS_FILE
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this file inconsistent with the others?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All other containers use the ENV to setup the creds. expect teardown, so this change makes it uniform.

value: /etc/openshift-installer/.awscred
- name: AWS_REGION
value: us-east-1
- name: AZURE_AUTH_LOCATION
value: /etc/openshift-installer/osServicePrincipal.json
- name: AZURE_REGION
value: centralus
- name: KUBECONFIG
value: /tmp/artifacts/installer/auth/kubeconfig
command:
Expand Down Expand Up @@ -434,7 +474,6 @@ objects:
wait

echo "Deprovisioning cluster ..."
export AWS_SHARED_CREDENTIALS_FILE=/etc/openshift-installer/.awscred
openshift-install --dir /tmp/artifacts/installer destroy cluster
}

Expand Down
6 changes: 6 additions & 0 deletions cluster/ci/config/secret-mirroring/mapping.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ secrets:
to:
namespace: ci-stg
name: cluster-secrets-azure
- from:
namespace: ci
name: cluster-secrets-azure4
to:
namespace: ci-stg
name: cluster-secrets-azure4
- from:
namespace: ci
name: cluster-secrets-gcp
Expand Down
5 changes: 5 additions & 0 deletions cluster/test-deploy/azure4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!.type
!.gitignore
!OWNERS
!secret_example
1 change: 1 addition & 0 deletions cluster/test-deploy/azure4/.type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
azure4
6 changes: 6 additions & 0 deletions cluster/test-deploy/azure4/secret_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"subscriptionId": "xxxxx",
"clientId": "xxxxx",
"clientSecret": "xxxxx",
"tenantId": "xxxxx"
}