Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Revert "calico-host-protection: Remove HostEndpoint Controller"
Browse files Browse the repository at this point in the history
This reverts commit 84c2ec76809c34789df23dd837a27d937ab7b17b.
  • Loading branch information
surajssd committed May 22, 2020
1 parent 68446fa commit a7a7213
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# manifests for component calico-hostendpoint-controller

---
# deployment.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: calico-hostendpoint-controller
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: calico-hostendpoint-controller
name: calico-hostendpoint-controller
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: calico-hostendpoint-controller
template:
metadata:
labels:
app: calico-hostendpoint-controller
spec:
serviceAccountName: calico-hostendpoint-controller
containers:
- image: kinvolk/calico-hostendpoint-controller:v0.0.3
name: calico-hostendpoint-controller
volumeMounts:
- mountPath: /tmp/
name: tmp-dir
volumes:
# mount in tmp so we can safely use from-scratch images and/or read-only containers
- name: tmp-dir
emptyDir: {}

---
# rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: calico-hostendpoint-controller-role
rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "watch", "list"]
- apiGroups: ["crd.projectcalico.org"]
resources: ["hostendpoints"]
verbs:
- create
- get
- list
- update
- delete
# To use kubectl apply on resources that already exist
- patch
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: calico-hostendpoint-controller-role-binding
subjects:
- kind: ServiceAccount
name: calico-hostendpoint-controller
namespace: kube-system
roleRef:
kind: ClusterRole
name: calico-hostendpoint-controller-role
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- range .Values.hostEndpoints }}
---
apiVersion: crd.projectcalico.org/v1
kind: HostEndpoint
metadata:
name: {{ .name }}
labels:
{{- range $key, $value := .labels }}
{{ $key }}: {{ $value }}
{{- end }}
spec:
interfaceName: {{ .interfaceName }}
node: {{ .nodeName }}
{{- end }}

0 comments on commit a7a7213

Please sign in to comment.