Skip to content

Instantly share code, notes, and snippets.

View jasonbrooks's full-sized avatar

Jason Brooks jasonbrooks

View GitHub Profile
@jasonbrooks
jasonbrooks / atomic-hello-k8s.md
Last active August 29, 2015 14:10
atomic kubernetes hello world

Testing Kubernetes with an Atomic Host

Atomic hosts include Kubernetes for orchestration and management of containerized application deployments, across a cluster of container hosts. If you're interested in taking Kubernetes for a spin on an Atomic host, read on!

Kubernetes+Atomic Hello World

First, boot into CentOS Atomic host. You ought to be able to use Fedora Atomic as well, but currently, Atomic Fedora comes with an earlier version of kubernetes, so for each of the kubectl commands in this howto, there's a different kubecfg command, for now.

Due to a bug in CentOS Atomic (not necessary in Fedora Atomic), you must:

@jasonbrooks
jasonbrooks / vagrant-disk-atomic.md
Last active August 29, 2015 14:17
adding a disk to fedora atomic vagrantfile

For vagrant-libvirt, the second disk can be added w/ libvirt.storage :file, :size => '5G'.

To make use of this disk, we can use docker-storage-setup, as described in http://www.projectatomic.io/docs/docker-storage-recommendation.

The lines in the config.vm.provision section below add DEVS="/dev/vdb" to /etc/sysconfig/docker-storage-setup. The commented-out line is supposed to run docker-storage-setup to set up the storage, but this isn't working when run from the Vagrantfile here. Once logged in to the vagrant VM, however, running sudo docker-storage-setup works as expected, except for a syntax error with part of the setup script which doesn't appear to stop the script from doing its job.

Vagrant.configure("2") do |config|

 config.vm.box = "f22atomic"

Compose Your Own Atomic Updates

Project Atomic hosts are built from standard RPM packages which have been composed into filesystem trees using rpm-ostree. This guide provides a method for customizing existing filesystem trees or creating new trees.

Requirements:

  • a machine running CentOS or Fedora for composing filesystem trees
  • a web server for hosting these tree repositories

Process:

.NET
ActionScript
ActiveMQ
Ada
Agile
Akka
Android
Ansible
AngularJS/js[Angular]
Apache
@jasonbrooks
jasonbrooks / vagrant-k8s-atomic
Created July 16, 2015 00:18
vagrantfile for bringing up a kube cluster w/ centos-atomic and kubernetes-ansible
Vagrant.configure(2) do |config|
config.vm.box = "cah"
config.vm.box_url = "http://cloud.centos.org/centos/7/atomic/images/CentOS-Atomic-Host-7-Vagrant-Libvirt.box"
## libvirt-specific settings, adding extra disk here
config.vm.provider "libvirt" do |libvirt|
libvirt.driver = "kvm"
libvirt.memory = 1024
@jasonbrooks
jasonbrooks / cockpit-container-cloud-config.md
Last active August 21, 2017 03:03
run cockpit in a container, automatically, with cloud-init

Fedora 22's Atomic Host dropped most of cockpit from its ostree tree in favor of running cockpit in a container. Matt Micene blogged about running cockpit-in-a-container with systemd, but people have expressed interest in learning how to start this container automatically, with cloud-init and/or kickstart.

cloud-init and cockpit

Referencing the sample cockpitws.service file from Matt's post, and using cloud-init's cloud-config-write-files functionality, I started out with this service file:

[Unit]
Description=Cockpit Web Interface
Requires=docker.service
Vagrant.configure(2) do |config|

  config.vm.box = "centos/7"

  config.vm.provider "libvirt" do |libvirt, override|
    libvirt.cpus = 2
    libvirt.memory = 1024
    libvirt.driver = 'kvm'
    libvirt.storage :file, :size => '10G'

git clone https://github.com/kubernetes/kubernetes.git

cd kubernetes/contrib/ansible/vagrant/

vi ../group_vars/all.yml

change source_type: to nothing/blank

vi Vagrantfile

Vagrant.configure(2) do |config|

  config.vm.box = "centos/7"

  config.vm.provider "libvirt" do |libvirt, override|
    libvirt.cpus = 2
    libvirt.memory = 1024
    libvirt.driver = 'kvm'
 libvirt.storage :file, :size => '10G'