Add Dockerfile for vagrant image (#5977)
This commit is contained in:
parent
32fec3bb74
commit
4d7eca7d2e
6 changed files with 55 additions and 5 deletions
|
@ -8,6 +8,7 @@ stages:
|
||||||
- deploy-special
|
- deploy-special
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
|
KUBESPRAY_VERSION: v2.12.5
|
||||||
FAILFASTCI_NAMESPACE: 'kargo-ci'
|
FAILFASTCI_NAMESPACE: 'kargo-ci'
|
||||||
GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
|
GITLAB_REPOSITORY: 'kargo-ci/kubernetes-sigs-kubespray'
|
||||||
ANSIBLE_FORCE_COLOR: "true"
|
ANSIBLE_FORCE_COLOR: "true"
|
||||||
|
@ -38,8 +39,6 @@ before_script:
|
||||||
.job: &job
|
.job: &job
|
||||||
tags:
|
tags:
|
||||||
- packet
|
- packet
|
||||||
variables:
|
|
||||||
KUBESPRAY_VERSION: v2.12.5
|
|
||||||
image: quay.io/kubespray/kubespray:$KUBESPRAY_VERSION
|
image: quay.io/kubespray/kubespray:$KUBESPRAY_VERSION
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
|
|
|
@ -4,7 +4,7 @@ molecule_tests:
|
||||||
tags: [vagrant]
|
tags: [vagrant]
|
||||||
only: [/^pr-.*$/]
|
only: [/^pr-.*$/]
|
||||||
except: ['triggers']
|
except: ['triggers']
|
||||||
image: quay.io/miouge/kubespray-vagrant
|
image: quay.io/kubespray/vagrant:$KUBESPRAY_VERSION
|
||||||
services: []
|
services: []
|
||||||
stage: deploy-part1
|
stage: deploy-part1
|
||||||
before_script:
|
before_script:
|
||||||
|
@ -24,7 +24,7 @@ molecule_tests:
|
||||||
tags: [vagrant]
|
tags: [vagrant]
|
||||||
only: [/^pr-.*$/]
|
only: [/^pr-.*$/]
|
||||||
except: ['triggers']
|
except: ['triggers']
|
||||||
image: quay.io/miouge/kubespray-vagrant
|
image: quay.io/kubespray/vagrant:$KUBESPRAY_VERSION
|
||||||
services: []
|
services: []
|
||||||
script:
|
script:
|
||||||
- vagrant up
|
- vagrant up
|
||||||
|
|
|
@ -8,7 +8,7 @@ The Kubespray Project is released on an as-needed basis. The process is as follo
|
||||||
4. Remove hashes for [EOL versions](https://github.com/kubernetes/sig-release/blob/master/releases/patch-releases.md) of kubernetes from `*_checksums` variables.
|
4. Remove hashes for [EOL versions](https://github.com/kubernetes/sig-release/blob/master/releases/patch-releases.md) of kubernetes from `*_checksums` variables.
|
||||||
5. An approver creates [new release in GitHub](https://github.com/kubernetes-sigs/kubespray/releases/new) using a version and tag name like `vX.Y.Z` and attaching the release notes
|
5. An approver creates [new release in GitHub](https://github.com/kubernetes-sigs/kubespray/releases/new) using a version and tag name like `vX.Y.Z` and attaching the release notes
|
||||||
6. An approver creates a release branch in the form `release-X.Y`
|
6. An approver creates a release branch in the form `release-X.Y`
|
||||||
7. The corresponding version of [quay.io/kubespray/kubespray:vX.Y.Z](https://quay.io/repository/kubespray/kubespray) docker image is built and tagged
|
7. The corresponding version of [quay.io/kubespray/kubespray:vX.Y.Z](https://quay.io/repository/kubespray/kubespray) and [quay.io/kubespray/vagrant:vX.Y.Z](https://quay.io/repository/kubespray/vagrant) docker images are built and tagged
|
||||||
8. The `KUBESPRAY_VERSION` variable is updated in `.gitlab-ci.yml`
|
8. The `KUBESPRAY_VERSION` variable is updated in `.gitlab-ci.yml`
|
||||||
9. The release issue is closed
|
9. The release issue is closed
|
||||||
10. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] Kubespray $VERSION is released`
|
10. An announcement email is sent to `kubernetes-dev@googlegroups.com` with the subject `[ANNOUNCE] Kubespray $VERSION is released`
|
||||||
|
|
14
test-infra/vagrant-docker/Dockerfile
Normal file
14
test-infra/vagrant-docker/Dockerfile
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
# Docker image published at quay.io/kubespray/vagrant
|
||||||
|
|
||||||
|
ARG KUBESPRAY_VERSION=v2.12.5
|
||||||
|
FROM quay.io/kubespray/kubespray:${KUBESPRAY_VERSION}
|
||||||
|
|
||||||
|
ENV VAGRANT_VERSION=2.2.7
|
||||||
|
ENV VAGRANT_DEFAULT_PROVIDER=libvirt
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y wget libvirt-dev openssh-client rsync git
|
||||||
|
|
||||||
|
# Install Vagrant
|
||||||
|
RUN wget https://releases.hashicorp.com/vagrant/${VAGRANT_VERSION}/vagrant_${VAGRANT_VERSION}_x86_64.deb
|
||||||
|
RUN dpkg -i vagrant_${VAGRANT_VERSION}_x86_64.deb
|
||||||
|
RUN vagrant plugin install vagrant-libvirt
|
24
test-infra/vagrant-docker/README.md
Normal file
24
test-infra/vagrant-docker/README.md
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
# vagrant docker image
|
||||||
|
|
||||||
|
This image is used for the vagrant CI jobs. It is using the libvirt driver.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```console
|
||||||
|
$ docker run --net host --rm -it -v /var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock quay.io/kubespray/vagrant
|
||||||
|
$ vagrant up
|
||||||
|
Bringing machine 'k8s-1' up with 'libvirt' provider...
|
||||||
|
Bringing machine 'k8s-2' up with 'libvirt' provider...
|
||||||
|
Bringing machine 'k8s-3' up with 'libvirt' provider...
|
||||||
|
[...]
|
||||||
|
```
|
||||||
|
|
||||||
|
## Cache
|
||||||
|
|
||||||
|
You can set `/root/kubespray_cache` as a volume to keep cache between runs.
|
||||||
|
|
||||||
|
## Building
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./build.sh v2.12.5
|
||||||
|
```
|
13
test-infra/vagrant-docker/build.sh
Executable file
13
test-infra/vagrant-docker/build.sh
Executable file
|
@ -0,0 +1,13 @@
|
||||||
|
#!/bin/sh
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
if [ "$#" -ne 1 ]; then
|
||||||
|
echo "Usage: $0 tag" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
VERSION="$1"
|
||||||
|
IMG="quay.io/kubespray/vagrant:${VERSION}"
|
||||||
|
|
||||||
|
docker build . --build-arg "KUBESPRAY_VERSION=${VERSION}" --tag "$IMG"
|
||||||
|
docker push "$IMG"
|
Loading…
Reference in a new issue