Coder Social home page Coder Social logo

tedezed / kubevirt-images-generator Goto Github PK

View Code? Open in Web Editor NEW
67.0 3.0 26.0 23 KB

Easy Kubevirt images generator - Public images repository ๐Ÿ’ฟ

License: Apache License 2.0

Makefile 4.01% Dockerfile 48.50% Shell 47.48%
kubevirt os cloud-images docker debian kubevirt-images demo kubernetes

kubevirt-images-generator's Introduction

Kubevirt Images Generator

Debian

Ubuntu

CentOS

Fedora

OpenSUSE

CirrOS

CoreOS

Examples Kubevirt

Create VM (kubevirt.io/v1alpha3, Debian 9):

cat <<EOF | kubectl apply -f -
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
  name: debian
spec:
  running: false
  template:
    metadata:
      labels: 
        kubevirt.io/size: small
        kubevirt.io/domain: debian
    spec:
      domain:
        cpu:
          cores: 2
        devices:
          disks:
            - name: containervolume
              disk:
                bus: virtio
            - name: cloudinitvolume
              disk:
                bus: virtio
          interfaces:
          - name: default
            bridge: {}
        resources:
          requests:
            memory: 1024M
      networks:
      - name: default
        pod: {}
      volumes:
        - name: containervolume
          containerDisk:
            image: tedezed/debian-container-disk:9.0
        - name: cloudinitvolume
          cloudInitNoCloud:
            userData: |-
              #cloud-config
              chpasswd:
                list: |
                  debian:debian
                  root:toor
                expire: False
EOF

Create VM old (kubevirt.io/v1alpha2, Debian 9):

cat <<EOF | kubectl apply -f -
apiVersion: kubevirt.io/v1alpha2
kind: VirtualMachine
metadata:
  name: debian
spec:
  running: false
  template:
    metadata:
      labels: 
        kubevirt.io/size: small
        kubevirt.io/domain: debian
    spec:
      domain:
        cpu:
          cores: 2
        devices:
          disks:
            - name: containerdisk
              volumeName: containervolume
              disk:
                bus: virtio
            - name: cloudinitdisk
              volumeName: cloudinitvolume
              disk:
                bus: virtio
          interfaces:
          - name: default
            bridge: {}
        resources:
          requests:
            memory: 1024M
      networks:
      - name: default
        pod: {}
      volumes:
        - name: containervolume
          containerDisk:
            image: tedezed/debian-container-disk:9.0
        - name: cloudinitvolume
          cloudInitNoCloud:
            userData: |-
              #cloud-config
              chpasswd:
                list: |
                  debian:debian
                  root:toor
                expire: False
EOF

Conect to vm:

kubectl get vms
virtctl start debian

virtctl console debian

Create VM with Debian 10

Currently Debian 10 has problems to start with cloud-init, you can use the following example to use it and solve the problem temporarily.

cat <<EOF | kubectl apply -f -
apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
  name: debian
spec:
  running: false
  template:
    metadata:
      labels: 
        kubevirt.io/size: small
        kubevirt.io/domain: debian
    spec:
      domain:
        cpu:
          cores: 2
        devices:
          disks:
            - name: containervolume
              disk:
                bus: virtio
            - name: cloudinitvolume
              disk:
                bus: virtio
          interfaces:
          - name: default
            bridge: {}
        resources:
          requests:
            memory: 1024M
      networks:
      - name: default
        pod: {}
      volumes:
        - name: containervolume
          containerDisk:
            image: tedezed/debian-container-disk:10.0
        - name: cloudinitvolume
          cloudInitNoCloud:
            userData: |-
              #cloud-config
              bootcmd:
                - echo cloud-init=disabled > /etc/cloud/cloud-init.disabled
                - [ /bin/bash, -c, 'echo -e "demopass\ndemopass" | passwd root' ]
                - reboot
EOF

Example in docker

Example: docker pull tedezed/debian-container-disk:8.0

Customizable use

Edit the file build_variable with your OS images, personal Docker registry and execute the next command to compile:

source build_variable
make build

kubevirt-images-generator's People

Contributors

addyess avatar tedezed avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

kubevirt-images-generator's Issues

Ubuntu vm

I have been playing with this, but I cant seem to figure out the username / password to login to the ubuntu vm

using qemu , I know its a non issue just did not know where else to post this

container-disk-v1alpha base image is not needed/recommended anymore.

And also cause of python3.7 the yum update its broken.

Now the recommended way is from scratch just add the image. and qcow2 is the recommended one.

https://kubevirt.io/user-guide/docs/latest/creating-virtual-machines/disks-and-volumes.html#containerdisk-workflow-example

so something like this should be better:

FROM alpine as BUILDER
ARG IMG_URL="https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"

RUN wget $IMG_URL -O ubuntu.qcow2
# ubuntu publish the qcow2 images as .img -.-
FROM scratch
copy  --from=BUILDER /ubuntu.qcow2 /disk/

I am creating the images in this repo: https://github.com/zakkg3/kubevirt-images

but it still needs some automation as you did for this one.

Cheers!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.