-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternatively use system ssh client to connect (k0sproject/rig v0.15.…
…1) (#568) * Bump github.com/k0sproject/rig to v0.15.1 Signed-off-by: Kimmo Lehto <[email protected]> * Add openssh test to workflow Signed-off-by: Kimmo Lehto <[email protected]> * Add openssh test to Makefile Signed-off-by: Kimmo Lehto <[email protected]> --------- Signed-off-by: Kimmo Lehto <[email protected]>
- Loading branch information
Showing
8 changed files
with
184 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -108,6 +108,36 @@ jobs: | |
env: | ||
LINUX_IMAGE: ${{ matrix.image }} | ||
run: make smoke-basic | ||
|
||
smoke-basic-openssh: | ||
strategy: | ||
matrix: | ||
image: | ||
- quay.io/k0sproject/bootloose-alpine3.18 | ||
name: Basic 1+1 smoke using openssh client | ||
needs: build | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version-file: go.mod | ||
check-latest: true | ||
|
||
- {"name":"Go modules cache","uses":"actions/cache@v3","with":{"path":"~/go/pkg/mod\n~/.cache/go-build\n~/Library/Caches/go-build\n%LocalAppData%\\go-build\n","key":"${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}","restore-keys":"${{ runner.os }}-go-\n"}} | ||
- {"name":"Compiled binary cache","uses":"actions/download-artifact@v3","with":{"name":"k0sctl","path":"."}} | ||
- {"name":"Make executable","run":"chmod +x k0sctl"} | ||
- {"name":"K0sctl cache","uses":"actions/cache@v3","with":{"path":"/var/cache/k0sctl\n~/.cache/k0sctl\n!*.log\n","key":"k0sctl-cache"}} | ||
- {"name":"Kubectl cache","uses":"actions/cache@v3","with":{"path":"smoke-test/kubectl\n","key":"kubectl-1.21.3"}} | ||
- {"name":"Go modules cache","uses":"actions/cache@v3","with":{"path":"~/go/pkg/mod\n~/.cache/go-build\n~/Library/Caches/go-build\n%LocalAppData%\\go-build\n","key":"${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}","restore-keys":"${{ runner.os }}-go-\n"}} | ||
- {"name":"Docker Layer Caching For Bootloose","uses":"satackey/[email protected]","continue-on-error":true} | ||
|
||
- name: Run smoke tests | ||
env: | ||
LINUX_IMAGE: ${{ matrix.image }} | ||
run: make smoke-basic-openssh | ||
|
||
smoke-files: | ||
strategy: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: k0sctl.k0sproject.io/v1beta1 | ||
kind: cluster | ||
spec: | ||
hosts: | ||
- role: controller | ||
uploadBinary: true | ||
openSSH: | ||
address: controller | ||
configPath: ssh/config | ||
- role: worker | ||
uploadBinary: true | ||
openSSH: | ||
address: worker | ||
configPath: ssh/config | ||
k0s: | ||
version: "${K0S_VERSION}" | ||
config: | ||
spec: | ||
telemetry: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/env sh | ||
|
||
K0SCTL_CONFIG=${K0SCTL_CONFIG:-"k0sctl-openssh.yaml"} | ||
|
||
set -e | ||
|
||
. ./smoke.common.sh | ||
trap cleanup_openssh EXIT | ||
|
||
cleanup_openssh() { | ||
cleanup | ||
[ -f "ssh/id_rsa_k0s" ] && rm -rf .ssh | ||
} | ||
|
||
deleteCluster | ||
createCluster | ||
|
||
echo "* Create SSH config" | ||
mkdir -p ~/.ssh | ||
mkdir -p ssh | ||
cp id_rsa_k0s ssh/ | ||
cat <<EOF > ssh/config | ||
Host * | ||
StrictHostKeyChecking no | ||
UserKnownHostsFile /dev/null | ||
IdentityFile id_rsa_k0s | ||
User root | ||
Host controller | ||
Hostname 127.0.0.1 | ||
Port 9022 | ||
Host worker | ||
Hostname 127.0.0.1 | ||
Port 9023 | ||
EOF | ||
|
||
echo "* Starting apply" | ||
../k0sctl apply --config "${K0SCTL_CONFIG}" --debug | ||
echo "* Apply OK" | ||
|