Skip to content

Instantly share code, notes, and snippets.

View grahamwhaley's full-sized avatar
💭
Retired. Geeking for myself.

Graham Whaley grahamwhaley

💭
Retired. Geeking for myself.
  • M7GRW
View GitHub Profile
@grahamwhaley
grahamwhaley / gist:684b424374a3f4d5417d5fe9972fb68c
Created April 24, 2018 15:42
Simple script to measure cpu load with perf whilst running a bandwidth limited VM network test
#!/bin/bash
# Very simple test script to see if we can measure 'cpu utilisation' stably whilst running a bandwidth limited
# network test - across two VM containers.
#set -x
RUNTIME=kata-runtime
C1NAME=fred
@grahamwhaley
grahamwhaley / README-vsock-nfs.md
Last active April 27, 2018 14:59
Setting up vsock/nfs

How to set up vsock/nfs and QEMU

Wed 25 Apr 16:15:47 BST 2018

Setting up the experimental vsock/nfs between a host Linux machine and a KVM/QEMU client is not quite trivial - let's write it down...

Overview

over in kata containers, we use 9pfs to mount host side filesystems into the QEMU/KVM Virtual Machine.

@grahamwhaley
grahamwhaley / packet.net-jenkins-jcloud.md
Last active August 31, 2018 15:13
Joining Packet.net to Jenkins

Setting up Jenkins with packet.net

First, install the Jenkins jcloud plugin into your Jenkins master.

In Jenkins UI, go to 'Manage Jenkins/Configure System'. Scroll down to the 'Cloud' section. 'Add a new cloud' and choose 'Cloud(jcloud)'.

and fail - the jcloud plugin is not listing packet.net as one of the valid providers...

Let's try the openstack plugin for kicks, as that also sits atop jcloud, and we use that plugin already for Kata.

@grahamwhaley
grahamwhaley / Hack_trace_into_kata_proxy.md
Created October 16, 2018 18:01
Hacking trace into kata proxy

I needed to try and grab the golang GODEBUG gc and scheduler trace debug info, from the Kata proxy. But, how - these are enabled by the ENV and/or command line - and the proxy is run from the runtime, which is run from dockerd. Well, this might just require some patches...

In the proxy itself:

diff --git a/proxy.go b/proxy.go
index 2a51f16..4a054bb 100644
--- a/proxy.go

Prereqs for Kata containers on Kubernetes workshop

To fully participate in the workshop, you will require access to a Kubernetes cluster with the following properties:

  • Version >= v1.12 kubernetes
  • That is scratch/disposable (i.e. not a live cluster you care about)
  • That supports virtualisation (Kata runs containers in VMs, so the kubelet must be running on a node that is able to run a VM. - see below)
  • preferably CRI-O installed as the CRI runtime on the cluster, along with the matching runc as the default container runtime.
    • Kata Containers also works with containerd, but the workshop demo will be conducted on a stack configured with CRI-O. you are welcome to follow along with containerd and adapt as necessary if you wish. See this page

Running Kata Containers in Minikube

minikube is an easy way to try out a kubernetes (k8s) cluster locally. It utilises running a single node k8s stack in a local VM.

Kata Containers is an OCI compatible container runtime that runs container workloads inside VMs.

Wouldn't it be nice if you could use kata under minikube to get an easy out of the box experience to try out Kata? Well, turns out with a little bit of config and setup that is already supported, you can!

@grahamwhaley
grahamwhaley / jenkinsfile-runner.md
Created June 18, 2019 09:16
jenkinsfile-runner

How to use jenkinsfile-runner

Developing pipeline jenkinsfiles can be painful. It is slightly easier if you use the jenkinsfile runner to run them locally.

Here is the script I have been using to do that for some in-dev Jenkinsfiles. Writing down as there are some subtleties here that it is going to be easy to lose and hard to re-create.

#!/bin/bash
@grahamwhaley
grahamwhaley / applying_kata_deploy.sh
Last active July 16, 2019 17:53
Quick script to apply kata_deploy to k8s
#!/bin/bash
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# applies kata-deploy to the default kubectl cluster
set -e
@grahamwhaley
grahamwhaley / elastic_json.md
Created July 25, 2019 15:45
Basic elastic json

Simple elastic/json setup

I've had to do this twice now, as I lost my info from the first time around. So, let's write it down...

Run up elastic in docker

First, let's run up elastic. Elastic give you info on how to do this on their site. I ended up firing a small docker compose:

version: '2'
@grahamwhaley
grahamwhaley / json_through_logstash.md
Last active August 6, 2019 12:11
Configuring filebeat and logstash to pass raw JSON to elastic

Configuring filebeat and logstash to pass JSON to elastic

Over on Kata Contaiers we want to store some metrics results into Elasticsearch so we can have some nice views and analysis. Our results are generated as JSON, and we have trialled injecting them directly into Elastic using curl, and that worked OK. As Kata is under the OSF umbrella, we will likely end up using the existing ELK infrastructure. One requirement of that is that we route our JSON data through logstash. To do that from the build machines, the obvious choice is to use filebeat.

The flow