Skip to content

Instantly share code, notes, and snippets.

Avatar

Joel Seguillon jseguillon

View GitHub Profile
@jseguillon
jseguillon / 00-README.txt
Last active Feb 8, 2021
Molecule : from docker to kubevirt
View 00-README.txt
goto venv : pip install
curl + patch apply
re-install deps
create sa
launch test pod
ssh
launch test
@jseguillon
jseguillon / molecule-pod.yaml
Last active Jan 24, 2021
molecule kubevirt - pod
View molecule-pod.yaml
---
apiVersion: v1
kind: Pod
metadata:
name: molecule
labels:
app: molecule
spec:
serviceAccountName: molecule-kubevirt
@jseguillon
jseguillon / molecule.yml
Created Jan 24, 2021
molecule kubevirt - molecule.yml
View molecule.yml
# molecule/default/molecule.yml
driver:
name: kubevirt
platforms:
- name: instance
image: "${MOLECULE_DISTRO:-quay.io/jseguillon/kubevirt-images:centos-7-x86_64-genericcloud-2009}"
@jseguillon
jseguillon / converge.yml
Created Jan 24, 2021
molecule kubevirt convege
View converge.yml
# molecule/default/converge.yml
- name: Converge
hosts: all
become: yes
@jseguillon
jseguillon / Dockerfile
Created Jan 24, 2021
molecule kubevirt Dockerfile
View Dockerfile
# Dockerfile
FROM python:3.9
RUN python3 -m pip install ansible molecule molecule-kubevirt && \
ansible-galaxy collection install community.crypto && \
ansible-galaxy collection install
# Need to copy twice the source code : once for the test, once for the code we test
COPY molecule /molecule
COPY . /molecule/default/roles/geerlingguy.nginx
@jseguillon
jseguillon / molecule-kubevirt-sa.yaml
Last active Jan 24, 2021
molecule-kubevirt Service Account and Roles
View molecule-kubevirt-sa.yaml
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: molecule-kubevirt
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
@jseguillon
jseguillon / launch
Last active Dec 5, 2020
kubespray kubevirt centos 7.9
View launch
curl -L https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-2009.qcow2 -o CentOS-7-x86_64-GenericCloud-2009.qcow2
cat <<EOF > Dockerfile
FROM kubevirt/registry-disk-v1alpha
COPY CentOS-7-x86_64-GenericCloud-2009.qcow2 /disk
EOF
docker build . -t kubevirt:centos-2009
@jseguillon
jseguillon / 00 - VM
Last active Nov 17, 2020
Kubevirt Netwok annotations
View 00 - VM
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
labels:
kubevirt.io/os: linux
name: centos7-master-x
spec:
running: true
template:
spec:
View kubespray centos7.8
PLAY [localhost] *************************************************************************************************************************
Friday 30 October 2020 15:47:26 +0000 (0:00:00.468) 0:00:00.468 ********
TASK [Check ansible version >=2.8.0] *****************************************************************************************************
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
View gist:3e88a58e54646e5590680bbca39b0b01
PS C:\temp\2> New-Winspray-Cluster .\test.yml -Force
# Winspray - check env
Vagrant 2.2.6
Client: Docker Engine - Community
Version: 19.03.8
API version: 1.40
Go version: go1.12.17
Git commit: afacb8b
Built: Wed Mar 11 01:23:10 2020
OS/Arch: windows/amd64