Skip to content

Instantly share code, notes, and snippets.

View rootfs's full-sized avatar
🎯
Focusing

Huamin Chen rootfs

🎯
Focusing
View GitHub Profile
@rootfs
rootfs / sidecar.yaml
Last active August 27, 2015 13:20
rbd sidecar
apiVersion: v1
kind: ReplicationController
metadata:
labels:
name: web
name: web
spec:
replicas: 1
selector:
name: web-rc
@rootfs
rootfs / recycler.sh
Created November 5, 2015 18:03
nfs recycler
#!/bin/bash
# 'recycler' performs an 'rm -rf' on a volume to scrub it clean before it's
# reused as a cluster resource. This script is intended to be used in a pod that
# performs the scrub. The container in the pod should succeed or fail based on
# the exit status of this script.
set -e -o pipefail
shopt -s dotglob nullglob
@rootfs
rootfs / .md
Last active December 17, 2015 22:22
kubernetes on azure

Azure Image

I use OpenLogic 7.1

Prerequisite

yum install -y git golang cifs-utils etcd docker-io
systemctl enable docker
systemctl start docker
@rootfs
rootfs / .md
Last active January 14, 2016 19:25
kubernetes code walkthrough

Cloud provider

Cloud provider is the abstraction of Cloud operations including:

// Interface is an abstract, pluggable interface for cloud providers.
type Interface interface {
	// LoadBalancer returns a balancer interface. Also returns true if the interface is supported, false otherwise.
	LoadBalancer() (LoadBalancer, bool)
	// Instances returns an instances interface. Also returns true if the interface is supported, false otherwise.
	Instances() (Instances, bool)
@rootfs
rootfs / .md
Last active March 17, 2016 18:02
ds-mount

Use DaemonSet to Mount Filesystems on Host

                 +- - - - - - - - - - - - - - - - - - +
                 '                   Master           '
                 '                                    '
                 '          +-----------------------+ '
                 '          |       ConfigMap       | '
                 '          +-----------------------+ '
                 '                                    '
                 +- - - - - - - - - - - - - - - - - - +
apiVersion: v1
kind: Pod
metadata:
name: gluster-1
labels:
name: gluster-1
spec:
hostNetwork: true
nodeSelector:
name: worker-1
@rootfs
rootfs / e2e.md
Last active April 28, 2016 16:07

matrix

Test cases AWS EBS GCE PD OpenStack Cinder Azure File NFS iSCSI Glusterfs Ceph RBD Ceph FS Fibre Channel Notes
SELinux and FSGroup N N Y N Y Y Y Y Y N
Attach/Detach Y Only GCE PD has tests
PV/PVC Y Only NFS has tests
Dynamic Provisioning Y Y Y Only AWS/GCE/Cinder have tests

feedback

#RFC: Adding test cases to e2e/volumes.go

Background

As we are developing features and new volume plugins, the e2e test cases are not catching up at the same pace. This proposal aims to cover the security context and more volume plugins.

Existing test cases in e2e/volumes.go

A storage server Pod that runs one of Glusterfs, NFS, Ceph RBD, Ceph FS, iSCSI, and OpenStack Cinder exports a file share. The file share containers a sample file. The test passes if a client Pod can mount the file share and test passes and read the sample file.

Since the client Pod has SELinux label and fsGroup in securityContext, securityContext must be enabled. The server container runs in privileged mode, so kubelet must allow privileged mode.

---
dummy:
fsid: 4a158d27-f750-41d5-9e7f-26ce4c9d2d45
fetch_directory: fetch/
rbd_client_admin_socket_path: /var/lib/ceph
dir_owner: root
dir_group: root
dir_mode: 777

RFC: Adding test cases to e2e/persistent_volumes.go

Existing test cases

e2e/persistent_volumes.go creates an NFS PV with recycle policy and an PVC to claim the PV. After the PVC is bound, it is deleted and PV is recycled.

Proposed test cases

Create Pod that uses multiple PVCs. Verify all PVCs are successfully bound and mounted.