Skip to content

Commit

Permalink
Merge pull request #25814 from saschagrunert/env-inject-crio
Browse files Browse the repository at this point in the history
Inject SSH key for CRI-O presubmits
  • Loading branch information
k8s-ci-robot authored Apr 4, 2022
2 parents 79ba12c + 85ca8f7 commit e77c09c
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config/jobs/kubernetes/sig-node/sig-node-presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -736,14 +736,17 @@ presubmits:
- --provider=gce
- --test_args=--nodes=8 --focus="\[NodeConformance\]|\[NodeFeature:.+\]|\[NodeFeature\]" --skip="\[Flaky\]|\[Slow\]|\[Serial\]"
- --timeout=180m
- --node-args=--image-config-file=/workspace/test-infra/jobs/e2e_node/crio/latest/image-config-cgrpv2.yaml
- --node-args=--image-config-file=/workspace/test-infra/jobs/e2e_node/crio/latest/image-config-cgrpv2-k8s-infra-prow-build.yaml
resources:
limits:
cpu: 4
memory: 6Gi
requests:
cpu: 4
memory: 6Gi
env:
- name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE
value: "1"
- name: pull-kubernetes-node-crio-cgrpv2-e2e-kubetest2
cluster: k8s-infra-prow-build
# explicitly needs /test pull-kubernetes-node-crio-cgrpv2-e2e-kubetest2 to run
Expand Down Expand Up @@ -928,14 +931,17 @@ presubmits:
- --provider=gce
- --test_args=--nodes=8 --focus="\[NodeConformance\]|\[NodeFeature:.+\]|\[NodeFeature\]" --skip="\[Flaky\]|\[Slow\]|\[Serial\]"
- --timeout=180m
- --node-args=--image-config-file=/workspace/test-infra/jobs/e2e_node/crio/latest/image-config-cgrpv1.yaml
- --node-args=--image-config-file=/workspace/test-infra/jobs/e2e_node/crio/latest/image-config-cgrpv1-k8s-infra-prow-build.yaml
resources:
limits:
cpu: 4
memory: 6Gi
requests:
cpu: 4
memory: 6Gi
env:
- name: IGNITION_INJECT_GCE_SSH_PUBLIC_KEY_FILE
value: "1"
- name: pull-kubernetes-node-crio-e2e-kubetest2
cluster: k8s-infra-prow-build
# explicitly needs /test pull-kubernetes-node-crio-e2e-kubetest2 to run
Expand Down
42 changes: 42 additions & 0 deletions jobs/e2e_node/crio/crio_cgrpv2_k8s_infra_prow_build.ign
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"ignition": {
"version": "3.3.0"
},
"storage": {
"files": [
{
"path": "/etc/ssh-key-secret/ssh-public",
"contents": {
"source": "data:text/plain;base64,GCE_SSH_PUBLIC_KEY_FILE_CONTENT"
},
"mode": 420
},
{
"path": "/etc/zincati/config.d/90-disable-auto-updates.toml",
"contents": {
"source": "data:,%5Bupdates%5D%0Aenabled%20%3D%20false%0A"
},
"mode": 420
}
]
},
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=Copy authorized keys\nBefore=crio-install.service\nAfter=network-online.target\n\n[Service]\nType=oneshot\nExecStart=/bin/sh -c '/usr/bin/mkdir -m 0700 -p /home/core/.ssh && /usr/bin/cat /etc/ssh-key-secret/ssh-public >> /home/core/.ssh/authorized_keys && chown -R core:core /home/core/.ssh && chmod 0600 /home/core/.ssh/authorized_keys'\n\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "authorized-key.service"
},
{
"contents": "[Unit]\nDescription=Download and install dbus-tools.\nBefore=crio-install.service\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive dbus-tools\n\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "dbus-tools-install.service"
},
{
"contents": "[Unit]\nDescription=Download and install crio binaries and configurations.\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=oneshot\nExecStartPre=/usr/bin/bash -c '/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -o /usr/local/crio-nodee2e-installer.sh https://raw.githubusercontent.com/cri-o/cri-o/74583d26406963ba150004f343bc36c16a861164/scripts/node_e2e_installer'\nExecStart=/usr/bin/bash /usr/local/crio-nodee2e-installer.sh\n\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "crio-install.service"
}
]
}
}
47 changes: 47 additions & 0 deletions jobs/e2e_node/crio/crio_k8s_infra_prow_build.ign
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"ignition": {
"version": "3.3.0"
},
"kernelArguments": {
"shouldExist": [
"systemd.unified_cgroup_hierarchy=0"
]
},
"storage": {
"files": [
{
"path": "/etc/ssh-key-secret/ssh-public",
"contents": {
"source": "data:text/plain;base64,GCE_SSH_PUBLIC_KEY_FILE_CONTENT"
},
"mode": 420
},
{
"path": "/etc/zincati/config.d/90-disable-auto-updates.toml",
"contents": {
"source": "data:,%5Bupdates%5D%0Aenabled%20%3D%20false%0A"
},
"mode": 420
}
]
},
"systemd": {
"units": [
{
"contents": "[Unit]\nDescription=Copy authorized keys\nBefore=crio-install.service\nAfter=network-online.target\n\n[Service]\nType=oneshot\nExecStart=/bin/sh -c '/usr/bin/mkdir -m 0700 -p /home/core/.ssh && /usr/bin/cat /etc/ssh-key-secret/ssh-public >> /home/core/.ssh/authorized_keys && chown -R core:core /home/core/.ssh && chmod 0600 /home/core/.ssh/authorized_keys'\n\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "authorized-key.service"
},
{
"contents": "[Unit]\nDescription=Download and install dbus-tools.\nBefore=crio-install.service\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=oneshot\nExecStart=/usr/bin/rpm-ostree install --apply-live --allow-inactive dbus-tools\n\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "dbus-tools-install.service"
},
{
"contents": "[Unit]\nDescription=Download and install crio binaries and configurations.\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=oneshot\nExecStartPre=/usr/bin/bash -c '/usr/bin/curl --fail --retry 5 --retry-delay 3 --silent --show-error -o /usr/local/crio-nodee2e-installer.sh https://raw.githubusercontent.com/cri-o/cri-o/74583d26406963ba150004f343bc36c16a861164/scripts/node_e2e_installer'\nExecStart=/usr/bin/bash /usr/local/crio-nodee2e-installer.sh\n\n[Install]\nWantedBy=multi-user.target\n",
"enabled": true,
"name": "crio-install.service"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
images:
fedora:
image_family: fedora-coreos-stable
project: fedora-coreos-cloud
metadata: "user-data</workspace/test-infra/jobs/e2e_node/crio/crio_k8s_infra_prow_build.ign"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
images:
fedora:
image_family: fedora-coreos-stable
project: fedora-coreos-cloud
metadata: "user-data</workspace/test-infra/jobs/e2e_node/crio/crio_cgrpv2_k8s_infra_prow_build.ign"

0 comments on commit e77c09c

Please sign in to comment.