{"id":13676376,"url":"https://github.com/kvaps/kube-fencing","last_synced_at":"2025-04-09T15:00:21.667Z","repository":{"id":33537323,"uuid":"145985440","full_name":"kvaps/kube-fencing","owner":"kvaps","description":"Fencing implementation for Kubernetes","archived":false,"fork":false,"pushed_at":"2025-02-25T11:02:00.000Z","size":167,"stargazers_count":130,"open_issues_count":12,"forks_count":22,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-02T13:02:14.995Z","etag":null,"topics":["fencing","ha","kubernetes","node","stonith","storage"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kvaps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-24T11:53:51.000Z","updated_at":"2025-03-12T15:36:06.000Z","dependencies_parsed_at":"2024-01-14T14:31:13.874Z","dependency_job_id":"ab4f1449-2c56-40c3-9ab5-e926ad58cf65","html_url":"https://github.com/kvaps/kube-fencing","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkube-fencing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkube-fencing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkube-fencing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kvaps%2Fkube-fencing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kvaps","download_url":"https://codeload.github.com/kvaps/kube-fencing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055272,"owners_count":21040153,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fencing","ha","kubernetes","node","stonith","storage"],"created_at":"2024-08-02T13:00:24.319Z","updated_at":"2025-04-09T15:00:21.642Z","avatar_url":"https://github.com/kvaps.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# kube-fencing\n\nFencing implementation for Kubernetes\n\n\n| Image                          | Build Status                       |\n|--------------------------------|------------------------------------|\n| **[kube-fencing-controller]**  | ![kube-fencing-controller-status]  |\n| **[kube-fencing-switcher]**    | ![kube-fencing-switcher-status]    |\n| **[kube-fencing-agents]**      | ![kube-fencing-agents-status]      |\n\n\n[kube-fencing-controller]: https://hub.docker.com/r/kvaps/kube-fencing-controller/\n[kube-fencing-switcher]: https://hub.docker.com/r/kvaps/kube-fencing-switcher/\n[kube-fencing-agents]: https://hub.docker.com/r/kvaps/kube-fencing-agents/\n[kube-fencing-controller-status]: https://img.shields.io/docker/build/kvaps/kube-fencing-controller.svg\n[kube-fencing-switcher-status]:  https://img.shields.io/docker/build/kvaps/kube-fencing-switcher.svg\n[kube-fencing-agents-status]:  https://img.shields.io/docker/build/kvaps/kube-fencing-agents.svg\n\n\n## Overview\n\nThis project designed to solve the problem of cleaning resources from the failed nodes that's blocks any further operation and recovery.\n\nFencing is neccesary if you want to have redundancy for your StatefulSet pods.\n\nIf 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.\n\nKube-fencing includes three containers:\n\n### fencing-controller\n\nThe main controller which watches for the node states, and if one of them becomes to the `NotReady` due `NodeStatusUnknown` reason, runs fencing procedure.\n\n### fencing-switcher\n\nThis 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.\n\n### fencing-agents\n\nThis container contains installed `fence-agents` package.\n\nWhen fencing procedure is called **fencing-controller** creates Job which can use **fencing-agents** image to execute specific fencing agent.\nIf fencing was successful it will celanup (or delete) the node from the kubernetes.\n\nThe next fencing agents are included:\n\n```\nfence_ack_manual      fence_brocade         fence_dummy           fence_idrac           fence_ilo4_ssh        fence_ipmilan         fence_ovh             fence_rsb             fence_vmware          \nfence_alom            fence_cisco_mds       fence_eaton_snmp      fence_ifmib           fence_ilo_moonshot    fence_ironic          fence_powerman        fence_sanbox2         fence_vmware_soap     \nfence_amt             fence_cisco_ucs       fence_emerson         fence_ilo             fence_ilo_mp          fence_kdump           fence_pve             fence_sbd             fence_wti             \nfence_apc             fence_compute         fence_eps             fence_ilo2            fence_ilo_ssh         fence_ldom            fence_raritan         fence_scsi            fence_xenapi          \nfence_apc_snmp        fence_docker          fence_hds_cb          fence_ilo3            fence_imm             fence_lpar            fence_rcd_serial      fence_tripplite_snmp  fence_zvmip           \nfence_azure_arm       fence_drac            fence_hpblade         fence_ilo3_ssh        fence_intelmodular    fence_mpath           fence_rhevm           fence_vbox            \nfence_bladecenter     fence_drac5           fence_ibmblade        fence_ilo4            fence_ipdu            fence_netio           fence_rsa             fence_virsh           \n```\n\n## Quick Start\n\n### Install kube-fencing\n```bash\nkubectl apply -f https://github.com/kvaps/kube-fencing/raw/master/deploy/kube-fencing.yaml\n```\n\n### Apply example PodTemplate\n\n```bash\n# Simple notify example (with after-hook)\nkubectl apply -f https://github.com/kvaps/kube-fencing/raw/master/deploy/examples/after-hook.yaml\n\n# HP iLO example\nkubectl apply -f https://github.com/kvaps/kube-fencing/raw/master/deploy/examples/hp-ilo.yaml\n```\n\n### Prepare own fencing template\n\nPrepare your own fencing PodTemplate using the examples above.\n\nFencing-controller will spawn this PodTemplate every time when node going to unknown state.  \nIt also appends `fencing/node` and `fencing/id` annotations to the pod, thus allows you to use this information in your fencing command.\n\nThe specified command must ends with `0` exit-code when fencing was successful and return `1` exit-code when failed.\n\nYou can create multiple PodTemplates for different nodes, but `fencing` will be used by default.\n\n## Configuration parameters\n\nAll configuration is reduced to the specific annotations.\n\nYou can specify the needed annotations for specific node or commonly for PodTemplate, hovewer node annotations take precedence.\n\n| Annotation | Description | Default  |\n|:-|:-|:-|\n| `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` |\n| `fencing/id`      | Specify the device id which will be used to fence the node. | *same as node name* |\n| `fencing/template`| Specify PodTemplate which be used to fence the node. | `fencing` |\n| `fencing/mode`    | Specify cleanup mode for the node: \u003cul\u003e\u003cli\u003e\u003ccode\u003enone\u003c/code\u003e - do nothing after successful fencing.\u003c/li\u003e\u003cli\u003e\u003ccode\u003eflush\u003c/code\u003e - remove all pods and volumeattachments from the node after successful fencing.\u003c/li\u003e\u003cli\u003e\u003ccode\u003etaint\u003c/code\u003e - remove all pods and volumeattachments from the node with \"node.kubernetes.io/out-of-service\" taint for k8s v1.24+. \u003c/li\u003e\u003cli\u003e\u003ccode\u003edelete\u003c/code\u003e - remove the node after successful fencing.\u003c/li\u003e\u003c/ul\u003e  | `flush` |\n| `fencing/after-hook` | Specific PodTemplate which will be spawned after successful fencing. | *unspecified* |\n| `fencing/timeout` | Timeout in seconds to wait for the node recovery before starting fencing procedure. | `0` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fkube-fencing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkvaps%2Fkube-fencing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkvaps%2Fkube-fencing/lists"}