Coder Social home page Coder Social logo

maya-r / kubevirtci Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kubevirt/kubevirtci

0.0 1.0 0.0 26.4 MB

Contains cluster definitions and client tools to quickly spin up and destroy ephemeral and scalable k8s and ocp clusters for testing

License: Apache License 2.0

Shell 51.97% Makefile 0.32% Go 35.32% Dockerfile 0.83% Roff 9.84% Starlark 1.72%

kubevirtci's Introduction

kubevirt/kubevirtci

Welcome! This repository hosts code to provision and start containerized Kubernetes clusters in order to test KubeVirt on several Kubernetes configurations using Prow.

Getting Started with a multi-node Kubernetes Provider

Download this repo

git clone https://github.com/kubevirt/kubevirtci.git
cd kubevirtci

Start multi node k8s cluster with 2 nics

export KUBEVIRT_PROVIDER=k8s-1.13.3 KUBEVIRT_NUM_NODES=2 KUBEVIRT_NUM_SECONDARY_NICS=1
make cluster-up

Stop k8s cluster

make cluster-down

Use provider's kubectl client with kubectl.sh wrapper script

cluster-up/kubectl.sh get nodes
cluster-up/kubectl.sh get pods --all-namespaces

Use your own kubectl client by defining the KUBECONFIG environment variable

export KUBECONFIG=$(cluster-up/kubeconfig.sh)

kubectl get nodes
kubectl apply -f <some file>

SSH into a node

cluster-up/ssh.sh node01

Attach to node console with socat and pty (non okd4 providers)

# Get node01 container id
node01_id=$(docker ps |grep node01 |awk '{print $1}')

# Install socat
docker exec $node01_id yum install -y socat

# Attach to node01 console
docker exec -it $node01_id socat - /dev/pts/0

Getting Started with multi-node OKD Provider

Download this repo

git clone https://github.com/kubevirt/kubevirtci.git
cd kubevirtci

Start okd cluster (pre-configured with a master and worker node)

export KUBEVIRT_PROVIDER=okd-4.1
# export OKD_CONSOLE_PORT=443  # Uncomment to access OKD console
make cluster-up

Stop okd cluster

make cluster-down

Use provider's OC client with oc.sh wrapper script

cluster-up/oc.sh get nodes
cluster-up/oc.sh get pods --all-namespaces

Use your own OC client by defining the KUBECONFIG environment variable

export KUBECONFIG=$(cluster-up/kubeconfig.sh)

oc get nodes
oc apply -f <some file>

SSH into master

cluster-up/ssh.sh master-0

SSH into worker

cluster-up/ssh.sh worker-0

Connect to the container (with KUBECONFIG exported)

make connect

In order to check newly created provider run, this will point to the local created provider upon cluster-up

export KUBEVIRTCI_PROVISION_CHECK=1

OKD Console

To access the OKD UI from the host running docker, remember to export OKD_CONSOLE_PORT=443 before make cluster-up. You should find out the IP address of the OKD docker container

clusterip=$(docker inspect $(docker ps | grep "kubevirtci/$KUBEVIRT_PROVIDER" | awk '{print $1}') | jq -r '.[0].NetworkSettings.IPAddress' )

and make it known in /etc/hosts via

cat << EOF >> /etc/hosts
$clusterip console-openshift-console.apps.test-1.tt.testing
$clusterip oauth-openshift.apps.test-1.tt.testing
EOF

Now you can browse to https://console-openshift-console.apps.test-1.tt.testing and log in by picking the htpasswd_provider option. The credentials are admin/admin.

To access the OKD UI from a remote client, forward incoming port 433 into the OKD cluster on the host running kubevirtci:

$ nic=em1  # the interface facing your remote client
$ sudo iptables -t nat -A PREROUTING -p tcp -i $nic --dport 443 -j DNAT --to-destination $clusterip

On your remote client host, point the cluster fqdn to the host running kubevirtci

kubevirtci_ip=a.b.c.d  # put here the ip address of the host running kubevirtci
cat << EOF >> /etc/hosts
$kubevirtci_ip console-openshift-console.apps.test-1.tt.testing
$kubevirtci_ip oauth-openshift.apps.test-1.tt.testing
EOF

Contributing

Please see CONTRIBUTING.md for details on how to contribute.

kubevirtci's People

Contributors

ahadas avatar awels avatar booxter avatar danielbelenky avatar dankenigsberg avatar davidvossel avatar dhiller avatar eranco74 avatar fabiand avatar fedepaol avatar ffromani avatar igoihman avatar ksimon1 avatar kunalkushwaha avatar mmazur avatar ormergi avatar oshoval avatar petrkotas avatar qinqon avatar ramlavi avatar rmohr avatar rollandf avatar schseba avatar slintes avatar vladikr avatar yuvalif avatar yuvalk avatar

Watchers

 avatar

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.