Skip to content

Commit

Permalink
add: example manifests
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Feb 24, 2020
1 parent 3a00310 commit 6e26eff
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 0 deletions.
42 changes: 42 additions & 0 deletions deploy/examples/after-hook.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1
kind: PodTemplate
metadata:
name: fencing
annotations:
fencing/after-hook: 'fencing-after'
fencing/mode: 'none'
template:
spec:
containers:
- name: fence
image: alpine:3.11
command: ["echo", "kill node $(FENCING_NODE) via $(FENCING_ID)"]
env:
- name: FENCING_NODE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['fencing/node']
- name: FENCING_ID
valueFrom:
fieldRef:
fieldPath: metadata.annotations['fencing/id']
---
apiVersion: v1
kind: PodTemplate
metadata:
name: fencing-after
template:
spec:
containers:
- name: fence
image: alpine:3.11
command: ["echo", "node $(FENCING_NODE) just fenced via $(FENCING_ID)"]
env:
- name: FENCING_NODE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['fencing/node']
- name: FENCING_ID
valueFrom:
fieldRef:
fieldPath: metadata.annotations['fencing/id']
19 changes: 19 additions & 0 deletions deploy/examples/hp-ilo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: PodTemplate
metadata:
name: fencing
template:
spec:
containers:
- name: fence
image: docker.io/kvaps/kube-fencing-agents:v2.0.0
command: ["fence_ilo", "-a", "$(FENCING_ID)", "-l", "user", "-p", "password"]
env:
- name: FENCING_NODE
valueFrom:
fieldRef:
fieldPath: metadata.annotations['fencing/node']
- name: FENCING_ID
valueFrom:
fieldRef:
fieldPath: metadata.annotations['fencing/id']
148 changes: 148 additions & 0 deletions deploy/kube-fencing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
---
# Source: kube-fencing/templates/controller-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: fencing-controller
---
# Source: kube-fencing/templates/switcher-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: fencing-switcher
---
# Source: kube-fencing/templates/controller-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fencing-controller
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["list", "watch", "get", "delete", "update", "patch"]
- apiGroups: [""]
resources: ["nodes/status"]
verbs: ["update", "patch"]
---
# Source: kube-fencing/templates/switcher-rbac.yaml
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fencing-switcher
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["patch"]
---
# Source: kube-fencing/templates/controller-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fencing-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: fencing-controller
subjects:
- kind: ServiceAccount
name: fencing-controller
namespace: test
---
# Source: kube-fencing/templates/switcher-rbac.yaml
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fencing-switcher
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: fencing-switcher
subjects:
- kind: ServiceAccount
name: fencing-switcher
namespace: test
---
# Source: kube-fencing/templates/controller-rbac.yaml
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fencing-controller
rules:
- apiGroups: ["batch", "extensions"]
resources: ["jobs"]
verbs: ["list", "watch", "get", "create", "update", "patch"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["get", "update", "patch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create"]
- apiGroups: [""]
resources: ["podtemplates"]
verbs: ["list", "watch", "get"]
---
# Source: kube-fencing/templates/controller-rbac.yaml
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: fencing-controller
subjects:
- kind: ServiceAccount
name: fencing-controller
namespace: test
roleRef:
kind: Role
name: fencing-controller
apiGroup: rbac.authorization.k8s.io
---
# Source: kube-fencing/templates/switcher-daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fencing-switcher
spec:
selector:
matchLabels:
app: fencing-switcher
template:
metadata:
labels:
app: fencing-switcher
spec:
serviceAccountName: fencing-switcher
hostNetwork: true
imagePullSecrets:
- name: regsecret
containers:
- name: switcher
image: docker.io/kvaps/kube-fencing-switcher:v2.0.0
imagePullPolicy: IfNotPresent
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
---
# Source: kube-fencing/templates/controller-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: fencing-controller
spec:
replicas:
selector:
matchLabels:
app: fencing-controller
template:
metadata:
labels:
app: fencing-controller
spec:
serviceAccountName: fencing-controller
hostNetwork: true
imagePullSecrets:
- name: regsecret
containers:
- name: controller
image: docker.io/kvaps/kube-fencing-controller:v2.0.0
imagePullPolicy: IfNotPresent

0 comments on commit 6e26eff

Please sign in to comment.