• Stars
    star
    103
  • Rank 333,046 (Top 7 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Fencing implementation for Kubernetes

kube-fencing

Fencing implementation for Kubernetes

Image Build Status
kube-fencing-controller kube-fencing-controller-status
kube-fencing-switcher kube-fencing-switcher-status
kube-fencing-agents kube-fencing-agents-status

Overview

This project designed to solve the problem of cleaning resources from the failed nodes that's blocks any further operation and recovery.

Fencing is neccesary if you want to have redundancy for your StatefulSet pods.

If any node falls, kube-fencing will guaranteed kill it via fence-agent, afterwards it will clear the node of all resources, that's make Kubernetes possible to schedule pods on the rest nodes.

Kube-fencing includes three containers:

fencing-controller

The main controller which watches for the node states, and if one of them becomes to the NotReady due NodeStatusUnknown reason, runs fencing procedure.

fencing-switcher

This is small container which can be deployed as daemonset, it will enable fencing during start, and disable fencing when node is gracefully shutdowns or reboots.

fencing-agents

This container contains installed fence-agents package.

When fencing procedure is called fencing-controller creates Job which can use fencing-agents image to execute specific fencing agent. If fencing was successful it will celanup (or delete) the node from the kubernetes.

The next fencing agents are included:

fence_ack_manual      fence_brocade         fence_dummy           fence_idrac           fence_ilo4_ssh        fence_ipmilan         fence_ovh             fence_rsb             fence_vmware          
fence_alom            fence_cisco_mds       fence_eaton_snmp      fence_ifmib           fence_ilo_moonshot    fence_ironic          fence_powerman        fence_sanbox2         fence_vmware_soap     
fence_amt             fence_cisco_ucs       fence_emerson         fence_ilo             fence_ilo_mp          fence_kdump           fence_pve             fence_sbd             fence_wti             
fence_apc             fence_compute         fence_eps             fence_ilo2            fence_ilo_ssh         fence_ldom            fence_raritan         fence_scsi            fence_xenapi          
fence_apc_snmp        fence_docker          fence_hds_cb          fence_ilo3            fence_imm             fence_lpar            fence_rcd_serial      fence_tripplite_snmp  fence_zvmip           
fence_azure_arm       fence_drac            fence_hpblade         fence_ilo3_ssh        fence_intelmodular    fence_mpath           fence_rhevm           fence_vbox            
fence_bladecenter     fence_drac5           fence_ibmblade        fence_ilo4            fence_ipdu            fence_netio           fence_rsa             fence_virsh           

Quick Start

Install kube-fencing

kubectl apply -f https://github.com/kvaps/kube-fencing/raw/master/deploy/kube-fencing.yaml

Apply example PodTemplate

# Simple notify example (with after-hook)
kubectl apply -f https://github.com/kvaps/kube-fencing/raw/master/deploy/examples/after-hook.yaml

# HP iLO example
kubectl apply -f https://github.com/kvaps/kube-fencing/raw/master/deploy/examples/hp-ilo.yaml

Prepare own fencing template

Prepare your own fencing PodTemplate using the examples above.

Fencing-controller will spawn this PodTemplate every time when node going to unknown state.
It also appends fencing/node and fencing/id annotations to the pod, thus allows you to use this information in your fencing command.

The specified command must ends with 0 exit-code when fencing was successful and return 1 exit-code when failed.

You can create multiple PodTemplates for different nodes, but fencing will be used by default.

Configuration parameters

All configuration is reduced to the specific annotations.

You can specify the needed annotations for specific node or commonly for PodTemplate, hovewer node annotations take precedence.

Annotation Description Default
fencing/enabled Fencing-switcher automatically sets this annotation to enable or disable fencing for the node. (can be specified only for node, usually you don't need to configure it). false
fencing/id Specify the device id which will be used to fence the node. same as node name
fencing/template Specify PodTemplate which be used to fence the node. fencing
fencing/mode Specify cleanup mode for the node:
  • none - do nothing after successful fencing.
  • flush - remove all pods and volumeattachments from the node after successful fencing.
  • delete - remove the node after successful fencing.
flush
fencing/after-hook Specific PodTemplate which will be spawned after successful fencing. unspecified
fencing/timeout Timeout in seconds to wait for the node recovery before starting fencing procedure. 0

More Repositories

1

kubectl-node-shell

Exec into node via kubectl
Shell
1,027
star
2

kubectl-build

Build dockerfiles directly in your Kubernetes cluster.
Shell
144
star
3

kube-linstor

Containerized LINSTOR SDS for Kubernetes, ready for production use.
Shell
129
star
4

zabbix-linux-container-template

Zabbix template for LXC container
46
star
5

keepass-url-overrides

Scripts for override urls in keepass2
Visual Basic
46
star
6

kube-opennebula

Helm chart and OpenNebula images ready to deploy on Kubernetes
Shell
43
star
7

docker-kolab

Kolab image with nginx, ssl, opendkim, amavis and fail2ban
Shell
40
star
8

bridget

Simple bridge network for kubernetes
Shell
39
star
9

docker-letsencrypt-webroot

Letsencrypt cert auto renewal for nginx base image
Shell
35
star
10

kubectl-use

Plugin for simple switch kubernetes contexts and namespaces
Shell
34
star
11

fake-systemd

Shell
34
star
12

pve-autosnap

Proxmox automatic snapshot tool
Shell
33
star
13

zenity-windows

Zenity for Windows
25
star
14

dotfiles

My configs
Lua
21
star
15

kube-lustre

High-available Lustre filesystem concept with DRBD for Kubernetes.
Shell
19
star
16

usbredirtools

Shell
18
star
17

helm-ensurecrds

Helm plugin to install and upgrade CRDs from the chart
Shell
18
star
18

krew-index

My krew index repo
Makefile
14
star
19

kubectl-proxy-port-forward

Proxy to remote host via Kubernetes
Shell
10
star
20

argocd-custom-tools

Custom argocd image with qbec and git-crypt binaries
Dockerfile
9
star
21

stolon-chart

Stolon Helm Chart
Mustache
8
star
22

docker-pulseaudio-bluetooth

Bluez5 and PulseAudio in a docker for recieve and send sound via a2dp
Shell
8
star
23

icecast-now-playing-script

Automatically exported from code.google.com/p/icecast-now-playing-script
HTML
8
star
24

opennebula-images

OpenNebula Images Generator
Shell
7
star
25

Telegraph-image-floder-upload

在使用telegram时发现了一个非常好用的博客网址,但是上传大量图片的时候不能批量选择,这个脚本提供了一种解决方法。
Python
6
star
26

livenetsquash

dracut-live-netroot
Shell
6
star
27

docker-mjpg-streamer

MJPG-streamer in a Docker
5
star
28

opennebula-addon-zfs

ZFS Storage Driver
Shell
5
star
29

docker-rspamd

Rspamd in a Docker container
Shell
4
star
30

argocd-git-crypt

Dockerfile
4
star
31

charts

My Helm charts
Makefile
4
star
32

opennebula-addon-zabbix

Zabbix template for monitoring OpenNebula cloud
Shell
4
star
33

Deckhouse-in-Deckhouse

Run Deckhouse in Deckhouse using virtualization module
Jsonnet
4
star
34

one-connect

Shell
3
star
35

fakewerf

fakewerf is a simple werf.yaml config renderer
Go
3
star
36

flexvolume-qemu-nbd

Kubernetes loop device flexvolume driver.
Shell
3
star
37

kvaps.github.io

HTML
3
star
38

nfs-server-provisioner-chart

Helm chart for nfs-server-provisioner
HTML
3
star
39

kube-pipework

Pipework for Kubernetes
Shell
3
star
40

docs.example.org

Trying new tools for building and automate the deployment in Kubernetes
Jsonnet
3
star
41

opennebula-addon-linstor_un

Community driven full-feature Linstor storage driver for OpenNebula
Shell
3
star
42

linstor-scheduler-extender

LINSTOR scheduler extender plugin for Kubernetes
Go
2
star
43

docker-rozofs

Shell
2
star
44

ansible-nsenter

Ansible connection plugin for configuring process namespaces with nsenter
Python
2
star
45

docker-seafile

Shell
2
star
46

docker-metronome

Metronome in docker for Kolab
Lua
2
star
47

vim_cheatsheet

Cheatsheet for vim
2
star
48

docker-clamd

Clamd in a Docker container
Shell
1
star
49

opennebula-ansible-modules

Ansible modules for OpenNebula configuration
Shell
1
star
50

opennebula-static-marketplace

OpenNebula Static Marketplace
HTML
1
star
51

ltsp5

LTSP: Linux Terminal Server Project (Unofficial)
Shell
1
star
52

linstor-ansible

Ansible roles to configure Linstor SDS
1
star
53

expect-bash

Expect script implementation on bash
Shell
1
star
54

flexvolume-block

Simple block device flexvolume implementation
Shell
1
star
55

docker-rmilter

rmilter in a Docker container
Shell
1
star
56

docker-external-ip

Configure external ip address on host for use with Kubernetes externalIP service
Shell
1
star
57

kube-iscsi-loop

Loop iSCSI interfaces and daemons for K8S.
Shell
1
star
58

opennebula-addon-tmsave-tmrestore

Experiment to add presave postsave prerestore postrestore actions to tm driver
Shell
1
star
59

opennebula-exporter

Yet another opennebula-exporter written on shell
Shell
1
star
60

kube-sheepdog

Sheepdog on kubernetes
1
star
61

opennebula-addon-3par

The 3PAR datastore driver enables OpenNebula to use a HPE 3PAR storage system for storing disk images.
Shell
1
star
62

kubectl-ssh

Tiny plugin for connecting to node in the cluster over SSH
Shell
1
star