-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for using Calico pod networking instead of flannel * Add variable "networking" which may be "calico" or "flannel" * Users MUST move the contents of assets_dir/manifests-networking into the assets_dir/manifests directory before running bootkube start. This is needed because Terraform cannot generate conditional files into a template_dir because other resources write to the same directory and delete. hashicorp/terraform-provider-template#10
- Loading branch information
Showing
17 changed files
with
323 additions
and
16 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 |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.tfvars | ||
.terraform | ||
*.tfstate* | ||
assets |
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
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
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,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
description: Calico BGP Peers | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: bgppeers.crd.projectcalico.org | ||
spec: | ||
scope: Cluster | ||
group: crd.projectcalico.org | ||
version: v1 | ||
names: | ||
kind: BGPPeer | ||
plural: bgppeers | ||
singular: bgppeer |
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,12 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
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 |
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,53 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: ClusterRole | ||
metadata: | ||
name: calico-node | ||
namespace: kube-system | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- namespaces | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: [""] | ||
resources: | ||
- pods/status | ||
verbs: | ||
- update | ||
- apiGroups: [""] | ||
resources: | ||
- pods | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: [""] | ||
resources: | ||
- nodes | ||
verbs: | ||
- get | ||
- list | ||
- update | ||
- watch | ||
- apiGroups: ["extensions"] | ||
resources: | ||
- networkpolicies | ||
verbs: | ||
- get | ||
- list | ||
- watch | ||
- apiGroups: ["crd.projectcalico.org"] | ||
resources: | ||
- globalfelixconfigs | ||
- bgppeers | ||
- globalbgpconfigs | ||
- ippools | ||
- globalnetworkpolicies | ||
verbs: | ||
- create | ||
- get | ||
- list | ||
- update | ||
- watch |
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,28 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: calico-config | ||
namespace: kube-system | ||
data: | ||
# The CNI network configuration to install on each node. | ||
cni_network_config: |- | ||
{ | ||
"name": "k8s-pod-network", | ||
"cniVersion": "0.3.0", | ||
"type": "calico", | ||
"log_level": "debug", | ||
"datastore_type": "kubernetes", | ||
"nodename": "__KUBERNETES_NODE_NAME__", | ||
"ipam": { | ||
"type": "host-local", | ||
"subnet": "usePodCidr" | ||
}, | ||
"policy": { | ||
"type": "k8s", | ||
"k8s_auth_token": "__SERVICEACCOUNT_TOKEN__" | ||
}, | ||
"kubernetes": { | ||
"k8s_api_root": "https://__KUBERNETES_SERVICE_HOST__:__KUBERNETES_SERVICE_PORT__", | ||
"kubeconfig": "__KUBECONFIG_FILEPATH__" | ||
} | ||
} |
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,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
description: Calico Global Felix Configuration | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: globalfelixconfigs.crd.projectcalico.org | ||
spec: | ||
scope: Cluster | ||
group: crd.projectcalico.org | ||
version: v1 | ||
names: | ||
kind: GlobalFelixConfig | ||
plural: globalfelixconfigs | ||
singular: globalfelixconfig |
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,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
description: Calico Global BGP Configuration | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: globalbgpconfigs.crd.projectcalico.org | ||
spec: | ||
scope: Cluster | ||
group: crd.projectcalico.org | ||
version: v1 | ||
names: | ||
kind: GlobalBGPConfig | ||
plural: globalbgpconfigs | ||
singular: globalbgpconfig |
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,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
description: Calico IP Pools | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: ippools.crd.projectcalico.org | ||
spec: | ||
scope: Cluster | ||
group: crd.projectcalico.org | ||
version: v1 | ||
names: | ||
kind: IPPool | ||
plural: ippools | ||
singular: ippool |
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,13 @@ | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
description: Calico Global Network Policies | ||
kind: CustomResourceDefinition | ||
metadata: | ||
name: globalnetworkpolicies.crd.projectcalico.org | ||
spec: | ||
scope: Cluster | ||
group: crd.projectcalico.org | ||
version: v1 | ||
names: | ||
kind: GlobalNetworkPolicy | ||
plural: globalnetworkpolicies | ||
singular: globalnetworkpolicy |
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,5 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: calico-node | ||
namespace: kube-system |
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,117 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: DaemonSet | ||
metadata: | ||
name: calico-node | ||
namespace: kube-system | ||
labels: | ||
k8s-app: calico-node | ||
spec: | ||
selector: | ||
matchLabels: | ||
k8s-app: calico-node | ||
template: | ||
metadata: | ||
labels: | ||
k8s-app: calico-node | ||
annotations: | ||
scheduler.alpha.kubernetes.io/critical-pod: '' | ||
spec: | ||
hostNetwork: true | ||
serviceAccountName: calico-node | ||
tolerations: | ||
- key: node-role.kubernetes.io/master | ||
effect: NoSchedule | ||
- key: "CriticalAddonsOnly" | ||
operator: "Exists" | ||
containers: | ||
- name: calico-node | ||
image: quay.io/calico/node:v2.5.1 | ||
env: | ||
- name: DATASTORE_TYPE | ||
value: "kubernetes" | ||
- name: FELIX_LOGSEVERITYSCREEN | ||
value: "info" | ||
- name: CLUSTER_TYPE | ||
value: "k8s,bgp" | ||
- name: CALICO_DISABLE_FILE_LOGGING | ||
value: "true" | ||
- name: FELIX_DEFAULTENDPOINTTOHOSTACTION | ||
value: "ACCEPT" | ||
- name: FELIX_IPV6SUPPORT | ||
value: "false" | ||
- name: WAIT_FOR_DATASTORE | ||
value: "true" | ||
- name: CALICO_IPV4POOL_CIDR | ||
value: "${pod_cidr}" | ||
- name: CALICO_IPV4POOL_IPIP | ||
value: "always" | ||
- name: NODENAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
- name: IP | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: status.podIP | ||
- name: FELIX_HEALTHENABLED | ||
value: "true" | ||
securityContext: | ||
privileged: true | ||
resources: | ||
requests: | ||
cpu: 250m | ||
livenessProbe: | ||
httpGet: | ||
path: /liveness | ||
port: 9099 | ||
periodSeconds: 10 | ||
initialDelaySeconds: 10 | ||
failureThreshold: 6 | ||
readinessProbe: | ||
httpGet: | ||
path: /readiness | ||
port: 9099 | ||
periodSeconds: 10 | ||
volumeMounts: | ||
- mountPath: /lib/modules | ||
name: lib-modules | ||
- mountPath: /var/run/calico | ||
name: var-run-calico | ||
readOnly: false | ||
- name: install-cni | ||
image: quay.io/calico/cni:v1.10.0 | ||
command: ["/install-cni.sh"] | ||
env: | ||
- name: CNI_NETWORK_CONFIG | ||
valueFrom: | ||
configMapKeyRef: | ||
name: calico-config | ||
key: cni_network_config | ||
- name: CNI_NET_DIR | ||
value: "/etc/kubernetes/cni/net.d" | ||
- name: KUBERNETES_NODE_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: spec.nodeName | ||
volumeMounts: | ||
- mountPath: /host/opt/cni/bin | ||
name: cni-bin-dir | ||
- mountPath: /host/etc/cni/net.d | ||
name: cni-net-dir | ||
volumes: | ||
- name: lib-modules | ||
hostPath: | ||
path: /lib/modules | ||
- name: var-run-calico | ||
hostPath: | ||
path: /var/run/calico | ||
- name: cni-bin-dir | ||
hostPath: | ||
path: /opt/cni/bin | ||
- name: cni-net-dir | ||
hostPath: | ||
path: /etc/kubernetes/cni/net.d | ||
updateStrategy: | ||
rollingUpdate: | ||
maxUnavailable: 1 | ||
type: RollingUpdate |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.