Skip to content

Commit 96f2bae

Browse files
committed
pkg/steps/clusterinstall/template: Update to pull in openshift/release changes
Catching up with the state as of openshift/release@f5fe3f5 (2019-05-01). I've mostly used the release repo's cluster-launch-installer-e2e.yaml, but I mixed in some code from cluster-launch-installer-openstack-e2e.yaml because the template here seemed to have OpenStack support already. I've also bumped the AWS zones to include us-east-1c, which will mean three-zone upgrade jobs launched from this config while the release-templates will result in two-zone jobs since openshift/release@d87fffb3aa (ci-operator/templates/openshift: Drop us-east-1c, 2019-04-26, openshift/release#3615).
1 parent cc7fa83 commit 96f2bae

File tree

1 file changed

+65
-20
lines changed

1 file changed

+65
-20
lines changed

pkg/steps/clusterinstall/template.go

Lines changed: 65 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ parameters:
2121
required: true
2222
- name: RELEASE_IMAGE_LATEST
2323
required: true
24+
- name: BASE_DOMAIN
25+
value: origin-ci-int-aws.dev.rhcloud.com
26+
required: true
2427

2528
objects:
2629

@@ -197,7 +200,7 @@ objects:
197200
- name: CLUSTER_NAME
198201
value: ${NAMESPACE}-${JOB_NAME_HASH}
199202
- name: BASE_DOMAIN
200-
value: origin-ci-int-aws.dev.rhcloud.com
203+
value: ${BASE_DOMAIN}
201204
- name: SSH_PUB_KEY_PATH
202205
value: /etc/openshift-installer/ssh-publickey
203206
- name: PULL_SECRET_PATH
@@ -207,9 +210,11 @@ objects:
207210
- name: OPENSTACK_IMAGE
208211
value: rhcos
209212
- name: OPENSTACK_REGION
210-
value: RegionOne
213+
value: moc-kzn
214+
- name: OPENSTACK_FLAVOR
215+
value: m1.s2.xlarge
211216
- name: OPENSTACK_EXTERNAL_NETWORK
212-
value: public
217+
value: external
213218
- name: OS_CLOUD
214219
value: openstack-cloud
215220
- name: OS_CLIENT_CONFIG_FILE
@@ -239,24 +244,41 @@ objects:
239244
fi
240245

241246
export EXPIRATION_DATE=$(date -d '4 hours' --iso=minutes --utc)
242-
export CLUSTER_ID=$(uuidgen --random)
243247
export SSH_PUB_KEY=$(cat "${SSH_PUB_KEY_PATH}")
244248
export PULL_SECRET=$(cat "${PULL_SECRET_PATH}")
245249

246250
if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
247251
cat > /tmp/artifacts/installer/install-config.yaml << EOF
248-
apiVersion: v1beta3
252+
apiVersion: v1beta4
249253
baseDomain: ${BASE_DOMAIN}
250-
clusterID: ${CLUSTER_ID}
251254
metadata:
252255
name: ${CLUSTER_NAME}
256+
controlPlane:
257+
name: master
258+
replicas: 3
259+
platform:
260+
aws:
261+
zones:
262+
- us-east-1a
263+
- us-east-1b
264+
- us-east-1c
265+
compute:
266+
- name: worker
267+
replicas: 3
268+
platform:
269+
aws:
270+
zones:
271+
- us-east-1a
272+
- us-east-1b
273+
- us-east-1c
253274
networking:
254-
clusterNetworks:
255-
- cidr: 10.128.0.0/14
256-
hostSubnetLength: 9
275+
clusterNetwork:
276+
- cidr: 10.128.0.0/14
277+
hostPrefix: 23
257278
machineCIDR: 10.0.0.0/16
258-
serviceCIDR: 172.30.0.0/16
259-
type: OpenShiftSDN
279+
serviceNetwork:
280+
- 172.30.0.0/16
281+
networkType: OpenShiftSDN
260282
platform:
261283
aws:
262284
region: ${AWS_REGION}
@@ -267,11 +289,16 @@ objects:
267289
sshKey: |
268290
${SSH_PUB_KEY}
269291
EOF
270-
elif [[ "${CLUSTER_TYPE}" == "openstack" ]]; then
271-
cat > /tmp/artifacts/installer/install-config.yaml << EOF
272-
apiVersion: v1beta3
292+
elif [[ "${CLUSTER_TYPE}" == "openshift" ]]; then
293+
# create a new floating ip tagged with CLUSTER_NAME so it can be deleted later
294+
LB_FIP=$(openstack floating ip create --description $CLUSTER_NAME $OPENSTACK_EXTERNAL_NETWORK --format value -c 'floating_ip_address')
295+
296+
# create A record for the api
297+
curl -v -X POST $CI_DNS_IP:8080 -d '{"name": "'api.$CLUSTER_NAME'", "ip": "'$LB_FIP'"}'
298+
299+
cat > /tmp/artifacts/installer/install-config.yaml << EOF
300+
apiVersion: v1beta4
273301
baseDomain: ${BASE_DOMAIN}
274-
clusterID: ${CLUSTER_ID}
275302
metadata:
276303
name: ${CLUSTER_NAME}
277304
networking:
@@ -286,7 +313,9 @@ objects:
286313
baseImage: ${OPENSTACK_IMAGE}
287314
cloud: ${OS_CLOUD}
288315
externalNetwork: ${OPENSTACK_EXTERNAL_NETWORK}
316+
computeFlavor: ${OPENSTACK_FLAVOR}
289317
region: ${OPENSTACK_REGION}
318+
lbFloatingIP: ${LB_FIP}
290319
pullSecret: >
291320
${PULL_SECRET}
292321
sshKey: |
@@ -370,6 +399,15 @@ objects:
370399
--key /tmp/artifacts/installer/tls/journal-gatewayd.key \
371400
--url "https://${bootstrap_ip}:19531/entries?_SYSTEMD_UNIT=${service}.service"
372401
done
402+
if ! whoami &> /dev/null; then
403+
if [ -w /etc/passwd ]; then
404+
echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
405+
fi
406+
fi
407+
eval $(ssh-agent)
408+
ssh-add /etc/openshift-installer/ssh-privatekey
409+
ssh -A -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip} /bin/bash -x /usr/local/bin/installer-gather.sh
410+
scp -o PreferredAuthentications=publickey -o StrictHostKeyChecking=false -o UserKnownHostsFile=/dev/null core@${bootstrap_ip}:log-bundle.tar.gz /tmp/artifacts/installer/bootstrap-logs.tar.gz
373411
fi
374412
else
375413
echo "No terraform statefile found. Skipping collection of bootstrap logs."
@@ -379,14 +417,16 @@ objects:
379417
oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces --template '{{ range .items }}{{ $name := .metadata.name }}{{ $ns := .metadata.namespace }}{{ range .spec.containers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ range .spec.initContainers }}-n {{ $ns }} {{ $name }} -c {{ .name }}{{ "\n" }}{{ end }}{{ end }}' > /tmp/containers
380418
oc --insecure-skip-tls-verify --request-timeout=5s get pods -l openshift.io/component=api --all-namespaces --template '{{ range .items }}-n {{ .metadata.namespace }} {{ .metadata.name }}{{ "\n" }}{{ end }}' > /tmp/pods-api
381419

420+
queue /tmp/artifacts/config-resources.json oc --insecure-skip-tls-verify --request-timeout=5s get apiserver.config.openshift.io authentication.config.openshift.io build.config.openshift.io console.config.openshift.io dns.config.openshift.io featuregate.config.openshift.io image.config.openshift.io infrastructure.config.openshift.io ingress.config.openshift.io network.config.openshift.io oauth.config.openshift.io project.config.openshift.io scheduler.config.openshift.io -o json
382421
queue /tmp/artifacts/apiservices.json oc --insecure-skip-tls-verify --request-timeout=5s get apiservices -o json
383422
queue /tmp/artifacts/clusteroperators.json oc --insecure-skip-tls-verify --request-timeout=5s get clusteroperators -o json
384423
queue /tmp/artifacts/clusterversion.json oc --insecure-skip-tls-verify --request-timeout=5s get clusterversion -o json
385424
queue /tmp/artifacts/configmaps.json oc --insecure-skip-tls-verify --request-timeout=5s get configmaps --all-namespaces -o json
425+
queue /tmp/artifacts/credentialsrequests.json oc --insecure-skip-tls-verify --request-timeout=5s get credentialsrequests --all-namespaces -o json
386426
queue /tmp/artifacts/csr.json oc --insecure-skip-tls-verify --request-timeout=5s get csr -o json
387427
queue /tmp/artifacts/endpoints.json oc --insecure-skip-tls-verify --request-timeout=5s get endpoints --all-namespaces -o json
388-
queue /tmp/artifacts/deployments.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get deployments --all-namespaces -o json
389-
queue /tmp/artifacts/daemonsets.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get daemonsets --all-namespaces -o json
428+
FILTER=gzip queue /tmp/artifacts/deployments.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get deployments --all-namespaces -o json
429+
FILTER=gzip queue /tmp/artifacts/daemonsets.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get daemonsets --all-namespaces -o json
390430
queue /tmp/artifacts/events.json oc --insecure-skip-tls-verify --request-timeout=5s get events --all-namespaces -o json
391431
queue /tmp/artifacts/kubeapiserver.json oc --insecure-skip-tls-verify --request-timeout=5s get kubeapiserver -o json
392432
queue /tmp/artifacts/kubecontrollermanager.json oc --insecure-skip-tls-verify --request-timeout=5s get kubecontrollermanager -o json
@@ -396,11 +436,13 @@ objects:
396436
queue /tmp/artifacts/nodes.json oc --insecure-skip-tls-verify --request-timeout=5s get nodes -o json
397437
queue /tmp/artifacts/openshiftapiserver.json oc --insecure-skip-tls-verify --request-timeout=5s get openshiftapiserver -o json
398438
queue /tmp/artifacts/pods.json oc --insecure-skip-tls-verify --request-timeout=5s get pods --all-namespaces -o json
399-
queue /tmp/artifacts/replicasets.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get replicasets --all-namespaces -o json
439+
queue /tmp/artifacts/persistentvolumes.json oc --insecure-skip-tls-verify --request-timeout=5s get persistentvolumes --all-namespaces -o json
440+
queue /tmp/artifacts/persistentvolumeclaims.json oc --insecure-skip-tls-verify --request-timeout=5s get persistentvolumeclaims --all-namespaces -o json
441+
FILTER=gzip queue /tmp/artifacts/replicasets.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get replicasets --all-namespaces -o json
400442
queue /tmp/artifacts/rolebindings.json oc --insecure-skip-tls-verify --request-timeout=5s get rolebindings --all-namespaces -o json
401443
queue /tmp/artifacts/roles.json oc --insecure-skip-tls-verify --request-timeout=5s get roles --all-namespaces -o json
402444
queue /tmp/artifacts/services.json oc --insecure-skip-tls-verify --request-timeout=5s get services --all-namespaces -o json
403-
queue /tmp/artifacts/statefulsets.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get statefulsets --all-namespaces -o json
445+
FILTER=gzip queue /tmp/artifacts/statefulsets.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get statefulsets --all-namespaces -o json
404446

405447
FILTER=gzip queue /tmp/artifacts/openapi.json.gz oc --insecure-skip-tls-verify --request-timeout=5s get --raw /openapi/v2
406448

@@ -461,6 +503,10 @@ objects:
461503
echo "Snapshotting prometheus (may take 15s) ..."
462504
queue /tmp/artifacts/metrics/prometheus.tar.gz oc --insecure-skip-tls-verify exec -n openshift-monitoring prometheus-k8s-0 -- tar cvzf - -C /prometheus .
463505

506+
echo "Running must-gather..."
507+
mkdir -p /tmp/artifacts/must-gather
508+
queue /tmp/artifacts/must-gather/must-gather.log oc --insecure-skip-tls-verify adm must-gather --dest-dir /tmp/artifacts/must-gather
509+
464510
echo "Waiting for logs ..."
465511
wait
466512

@@ -478,4 +524,3 @@ objects:
478524
fi
479525
sleep 60 & wait
480526
done
481-
`

0 commit comments

Comments
 (0)