Skip to content

Commit 86557f5

Browse files
committed
Add new AWS creds secret for running kola tests
In this PR we add the aws-fcos-kola-bot-config secret that represents credentials to use when running kola tests in AWS. This will allow us to upload builds to the prod Fedora Account (more locked down security) and do testing in our community Fedora Account where we have control over the credentials handed out.
1 parent 244bfd0 commit 86557f5

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

HACKING.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ If you're planning to test changes, it would be best to fork
150150
this repo so that you do your work there. The workflow
151151
requires a remote repo to which to push changes.
152152

153-
### Creating AWS credentials config
153+
### Creating AWS credentials configs
154154

155155
If you are in production where we upload builds to S3 OR you want to
156156
test uploading to S3 as part of your pipeline development, you need to
@@ -159,7 +159,7 @@ create a credentials config as a secret within OpenShift.
159159
First create a file with your secret content:
160160

161161
```
162-
cat <<'EOF' > /path/to/file
162+
cat <<'EOF' > /path/to/upload-secret
163163
[default]
164164
aws_access_key_id=keyid
165165
aws_secret_access_key=key
@@ -169,7 +169,23 @@ EOF
169169
Then create the secret in OpenShift:
170170

171171
```
172-
oc create secret generic aws-fcos-builds-bot-config --from-file=config=/path/to/file
172+
oc create secret generic aws-fcos-builds-bot-config --from-file=config=/path/to/upload-secret
173+
```
174+
175+
We also have a second AWS config that can be used for running kola
176+
tests. If you have a single account that has enough permissions for
177+
both then you can use the same account for both uploading builds and
178+
running kola tests (i.e. re-use `upload-secret` from above. If not then
179+
you can use a second set of credentials for the kola tests.
180+
181+
```
182+
cat <<'EOF' > /path/to/kola-secret
183+
[default]
184+
aws_access_key_id=keyid
185+
aws_secret_access_key=key
186+
EOF
187+
188+
oc create secret generic aws-fcos-kola-bot-config --from-file=config=/path/to/kola-secret
173189
```
174190

175191
### Create a Jenkins instance with a persistent volume backing store

Jenkinsfile.kola.aws

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ podTemplate(cloud: 'openshift', label: 'coreos-assembler', yaml: pod, defaultCon
5555

5656
stage('AWS Kola Run') {
5757
utils.shwrap("""
58+
export AWS_CONFIG_FILE=\${AWS_FCOS_KOLA_BOT_CONFIG}
5859
kola run -p aws --aws-ami ${ami} --aws-region ${ami_region} -b fcos -j 10 || :
5960
tar -cf - _kola_temp/ | xz -c9 > _kola_temp.tar.xz
6061
""")

manifests/pod.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,17 @@ spec:
2020
env:
2121
- name: AWS_FCOS_BUILDS_BOT_CONFIG
2222
value: /.aws-fcos-builds-bot-config/config
23+
- name: AWS_FCOS_KOLA_BOT_CONFIG
24+
value: /.aws-fcos-kola-bot-config/config
2325
volumeMounts:
2426
- name: data
2527
mountPath: /srv/
2628
- name: aws-fcos-builds-bot-config
2729
mountPath: /.aws-fcos-builds-bot-config/
2830
readOnly: true
31+
- name: aws-fcos-kola-bot-config
32+
mountPath: /.aws-fcos-kola-bot-config/
33+
readOnly: true
2934
- name: github-token
3035
mountPath: /.github
3136
readOnly: true
@@ -42,6 +47,11 @@ spec:
4247
secret:
4348
secretName: aws-fcos-builds-bot-config
4449
optional: true
50+
# This secret is used for running aws kola tests
51+
- name: aws-fcos-kola-bot-config
52+
secret:
53+
secretName: aws-fcos-kola-bot-config
54+
optional: true
4555
- name: github-token
4656
secret:
4757
secretName: coreosbot-github-token

manifests/sleep.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,17 @@ spec:
1515
env:
1616
- name: AWS_FCOS_BUILDS_BOT_CONFIG
1717
value: /.aws-fcos-builds-bot-config/config
18+
- name: AWS_FCOS_KOLA_BOT_CONFIG
19+
value: /.aws-fcos-kola-bot-config/config
1820
volumeMounts:
1921
- name: data
2022
mountPath: /srv/
2123
- name: aws-fcos-builds-bot-config
2224
mountPath: /.aws-fcos-builds-bot-config/
2325
readOnly: true
26+
- name: aws-fcos-kola-bot-config
27+
mountPath: /.aws-fcos-kola-bot-config/
28+
readOnly: true
2429
securityContext:
2530
privileged: false
2631
volumes:
@@ -32,3 +37,8 @@ spec:
3237
secret:
3338
secretName: aws-fcos-builds-bot-config
3439
optional: true
40+
# This secret is used for running aws kola tests
41+
- name: aws-fcos-kola-bot-config
42+
secret:
43+
secretName: aws-fcos-kola-bot-config
44+
optional: true

0 commit comments

Comments
 (0)