-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from pawan-deploy/main
Added Calico networking chart
- Loading branch information
Showing
8 changed files
with
3,863 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: calico | ||
description: Chart to deploy calico networking | ||
version: 0.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# This ConfigMap is used to configure a self-hosted Calico installation. | ||
kind: ConfigMap | ||
apiVersion: v1 | ||
metadata: | ||
name: calico-config | ||
namespace: kube-system | ||
data: | ||
# Typha is disabled. | ||
typha_service_name: "none" | ||
# Configure the backend to use. | ||
calico_backend: "vxlan" | ||
|
||
# Configure the MTU to use for workload interfaces and tunnels. | ||
# By default, MTU is auto-detected, and explicitly setting this field should not be required. | ||
# You can override auto-detection by providing a non-zero value. | ||
veth_mtu: "0" | ||
|
||
# The CNI network configuration to install on each node. The special | ||
# values in this config will be automatically populated. | ||
cni_network_config: |- | ||
{ | ||
"name": "k8s-pod-network", | ||
"cniVersion": {{ .Values.calicoConfig.cniVersion | quote }}, | ||
"plugins": [ | ||
{ | ||
"type": "calico", | ||
"log_level": "info", | ||
"log_file_path": "/var/log/calico/cni/cni.log", | ||
"datastore_type": "kubernetes", | ||
"nodename": "__KUBERNETES_NODE_NAME__", | ||
"mtu": __CNI_MTU__, | ||
"ipam": { | ||
"type": "calico-ipam" | ||
}, | ||
"policy": { | ||
"type": "k8s" | ||
}, | ||
"kubernetes": { | ||
"kubeconfig": "__KUBECONFIG_FILEPATH__" | ||
} | ||
}, | ||
{ | ||
"type": "portmap", | ||
"snat": true, | ||
"capabilities": {"portMappings": true} | ||
}, | ||
{ | ||
"type": "bandwidth", | ||
"capabilities": {"bandwidth": true} | ||
} | ||
] | ||
} |
83 changes: 83 additions & 0 deletions
83
charts/calico-networking/templates/calico-kube-controllers-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Include a clusterrole for the kube-controllers component, | ||
# and bind it to the calico-kube-controllers serviceaccount. | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: calico-kube-controllers | ||
rules: | ||
# Nodes are watched to monitor for deletions. | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
verbs: | ||
- watch | ||
- list | ||
- get | ||
# Pods are queried to check for existence. | ||
- apiGroups: [""] | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
# IPAM resources are manipulated when nodes are deleted. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- ippools | ||
verbs: | ||
- list | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- blockaffinities | ||
- ipamblocks | ||
- ipamhandles | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- update | ||
- delete | ||
- watch | ||
# kube-controllers manages hostendpoints. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- hostendpoints | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- update | ||
- delete | ||
# Needs access to update clusterinformations. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- clusterinformations | ||
verbs: | ||
- get | ||
- create | ||
- update | ||
# KubeControllersConfiguration is where it gets its config | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- kubecontrollersconfigurations | ||
verbs: | ||
# read its own config | ||
- get | ||
# create a default if none exists | ||
- create | ||
# update status | ||
- update | ||
# watch for changes | ||
- watch | ||
--- | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: calico-kube-controllers | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: calico-kube-controllers | ||
subjects: | ||
- kind: ServiceAccount | ||
name: calico-kube-controllers | ||
namespace: kube-system |
81 changes: 81 additions & 0 deletions
81
charts/calico-networking/templates/calico-kube-controllers.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# See https://github.com/projectcalico/kube-controllers | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: calico-kube-controllers | ||
namespace: kube-system | ||
labels: | ||
k8s-app: calico-kube-controllers | ||
spec: | ||
# The controllers can only have a single active instance. | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
k8s-app: calico-kube-controllers | ||
strategy: | ||
type: Recreate | ||
template: | ||
metadata: | ||
name: calico-kube-controllers | ||
namespace: kube-system | ||
labels: | ||
k8s-app: calico-kube-controllers | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
tolerations: | ||
# Mark the pod as a critical add-on for rescheduling. | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
serviceAccountName: calico-kube-controllers | ||
priorityClassName: system-cluster-critical | ||
containers: | ||
- name: calico-kube-controllers | ||
image: docker.io/calico/kube-controllers:v3.19.1 | ||
env: | ||
# Choose which controllers to run. | ||
- name: ENABLED_CONTROLLERS | ||
value: node | ||
- name: DATASTORE_TYPE | ||
value: kubernetes | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /usr/bin/check-status | ||
- -l | ||
periodSeconds: 10 | ||
initialDelaySeconds: 10 | ||
failureThreshold: 6 | ||
readinessProbe: | ||
exec: | ||
command: | ||
- /usr/bin/check-status | ||
- -r | ||
periodSeconds: 10 | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: calico-kube-controllers | ||
namespace: kube-system | ||
|
||
--- | ||
|
||
# This manifest creates a Pod Disruption Budget for Controller to allow K8s Cluster Autoscaler to evict | ||
|
||
apiVersion: policy/v1beta1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: calico-kube-controllers | ||
namespace: kube-system | ||
labels: | ||
k8s-app: calico-kube-controllers | ||
spec: | ||
maxUnavailable: 1 | ||
selector: | ||
matchLabels: | ||
k8s-app: calico-kube-controllers |
152 changes: 152 additions & 0 deletions
152
charts/calico-networking/templates/calico-node-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
# Include a clusterrole for the calico-node DaemonSet, | ||
# and bind it to the calico-node serviceaccount. | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
name: calico-node | ||
rules: | ||
# The CNI plugin needs to get pods, nodes, and namespaces. | ||
- apiGroups: [""] | ||
resources: | ||
- pods | ||
- nodes | ||
- namespaces | ||
verbs: | ||
- get | ||
- apiGroups: [""] | ||
resources: | ||
- endpoints | ||
- services | ||
verbs: | ||
# Used to discover service IPs for advertisement. | ||
- watch | ||
- list | ||
# Used to discover Typhas. | ||
- get | ||
# Pod CIDR auto-detection on kubeadm needs access to config maps. | ||
- apiGroups: [""] | ||
resources: | ||
- configmaps | ||
verbs: | ||
- get | ||
- apiGroups: [""] | ||
resources: | ||
- nodes/status | ||
verbs: | ||
# Needed for clearing NodeNetworkUnavailable flag. | ||
- patch | ||
# Calico stores some configuration information in node annotations. | ||
- update | ||
# Watch for changes to Kubernetes NetworkPolicies. | ||
- apiGroups: ["networking.k8s.io"] | ||
resources: | ||
- networkpolicies | ||
verbs: | ||
- watch | ||
- list | ||
# Used by Calico for policy information. | ||
- apiGroups: [""] | ||
resources: | ||
- pods | ||
- namespaces | ||
- serviceaccounts | ||
verbs: | ||
- list | ||
- watch | ||
# The CNI plugin patches pods/status. | ||
- apiGroups: [""] | ||
resources: | ||
- pods/status | ||
verbs: | ||
- patch | ||
# Calico monitors various CRDs for config. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- globalfelixconfigs | ||
- felixconfigurations | ||
- bgppeers | ||
- globalbgpconfigs | ||
- bgpconfigurations | ||
- ippools | ||
- ipamblocks | ||
- globalnetworkpolicies | ||
- globalnetworksets | ||
- networkpolicies | ||
- networksets | ||
- clusterinformations | ||
- hostendpoints | ||
- blockaffinities | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
# Calico must create and update some CRDs on startup. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- ippools | ||
- felixconfigurations | ||
- clusterinformations | ||
verbs: | ||
- create | ||
- update | ||
# Calico stores some configuration information on the node. | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
# These permissions are only required for upgrade from v2.6, and can | ||
# be removed after upgrade or on fresh installations. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- bgpconfigurations | ||
- bgppeers | ||
verbs: | ||
- create | ||
- update | ||
# These permissions are required for Calico CNI to perform IPAM allocations. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- blockaffinities | ||
- ipamblocks | ||
- ipamhandles | ||
verbs: | ||
- get | ||
- list | ||
- create | ||
- update | ||
- delete | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- ipamconfigs | ||
verbs: | ||
- get | ||
# Block affinities must also be watchable by confd for route aggregation. | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- blockaffinities | ||
verbs: | ||
- watch | ||
# The Calico IPAM migration needs to get daemonsets. These permissions can be | ||
# removed if not upgrading from an installation using host-local IPAM. | ||
- apiGroups: ["apps"] | ||
resources: | ||
- daemonsets | ||
verbs: | ||
- get | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: calico-node | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: calico-node | ||
subjects: | ||
- kind: ServiceAccount | ||
name: calico-node | ||
namespace: kube-system |
Oops, something went wrong.