Browse Source
Add support calico kubernetes datastore and typha. (#4498)
Add support calico kubernetes datastore and typha. (#4498)
* Add support calico kubernetes datastore and typha. * Add typha_enabled to kubespray-defaults.pull/4655/head
committed by
Kubernetes Prow Robot
12 changed files with 453 additions and 19 deletions
Unified View
Diff Options
-
9inventory/sample/group_vars/k8s-cluster/k8s-net-calico.yml
-
12roles/download/defaults/main.yml
-
2roles/kubernetes-apps/network_plugin/calico/tasks/main.yml
-
2roles/kubespray-defaults/defaults/main.yaml
-
7roles/network_plugin/calico/defaults/main.yml
-
22roles/network_plugin/calico/tasks/install.yml
-
7roles/network_plugin/calico/templates/calico-config.yml.j2
-
75roles/network_plugin/calico/templates/calico-cr.yml.j2
-
69roles/network_plugin/calico/templates/calico-node.yml.j2
-
123roles/network_plugin/calico/templates/calico-typha.yml.j2
-
11roles/network_plugin/calico/templates/cni-calico.conflist.j2
-
133roles/network_plugin/calico/templates/kdd-crds.yml.j2
@ -0,0 +1,123 @@ |
|||||
|
# This manifest creates a Service, which will be backed by Calico's Typha daemon. |
||||
|
# Typha sits in between Felix and the API server, reducing Calico's load on the API server. |
||||
|
|
||||
|
apiVersion: v1 |
||||
|
kind: Service |
||||
|
metadata: |
||||
|
name: calico-typha |
||||
|
namespace: kube-system |
||||
|
labels: |
||||
|
k8s-app: calico-typha |
||||
|
spec: |
||||
|
ports: |
||||
|
- port: 5473 |
||||
|
protocol: TCP |
||||
|
targetPort: calico-typha |
||||
|
name: calico-typha |
||||
|
selector: |
||||
|
k8s-app: calico-typha |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
# This manifest creates a Deployment of Typha to back the above service. |
||||
|
|
||||
|
apiVersion: apps/v1beta1 |
||||
|
kind: Deployment |
||||
|
metadata: |
||||
|
name: calico-typha |
||||
|
namespace: kube-system |
||||
|
labels: |
||||
|
k8s-app: calico-typha |
||||
|
spec: |
||||
|
# Number of Typha replicas. To enable Typha, set this to a non-zero value *and* set the |
||||
|
# typha_service_name variable in the calico-config ConfigMap above. |
||||
|
# |
||||
|
# We recommend using Typha if you have more than 50 nodes. Above 100 nodes it is essential |
||||
|
# (when using the Kubernetes datastore). Use one replica for every 100-200 nodes. In |
||||
|
# production, we recommend running at least 3 replicas to reduce the impact of rolling upgrade. |
||||
|
replicas: {{ typha_replicas }} |
||||
|
revisionHistoryLimit: 2 |
||||
|
template: |
||||
|
metadata: |
||||
|
labels: |
||||
|
k8s-app: calico-typha |
||||
|
annotations: |
||||
|
# This, along with the CriticalAddonsOnly toleration below, marks the pod as a critical |
||||
|
# add-on, ensuring it gets priority scheduling and that its resources are reserved |
||||
|
# if it ever gets evicted. |
||||
|
scheduler.alpha.kubernetes.io/critical-pod: '' |
||||
|
cluster-autoscaler.kubernetes.io/safe-to-evict: 'true' |
||||
|
spec: |
||||
|
nodeSelector: |
||||
|
beta.kubernetes.io/os: linux |
||||
|
hostNetwork: true |
||||
|
tolerations: |
||||
|
# Mark the pod as a critical add-on for rescheduling. |
||||
|
- key: CriticalAddonsOnly |
||||
|
operator: Exists |
||||
|
# Since Calico can't network a pod until Typha is up, we need to run Typha itself |
||||
|
# as a host-networked pod. |
||||
|
serviceAccountName: calico-node |
||||
|
containers: |
||||
|
# - image: calico/typha:v3.4.4 |
||||
|
- image: {{ calico_typha_image_repo }}:{{ calico_typha_image_tag }} |
||||
|
name: calico-typha |
||||
|
ports: |
||||
|
- containerPort: 5473 |
||||
|
name: calico-typha |
||||
|
protocol: TCP |
||||
|
env: |
||||
|
# Enable "info" logging by default. Can be set to "debug" to increase verbosity. |
||||
|
- name: TYPHA_LOGSEVERITYSCREEN |
||||
|
value: "info" |
||||
|
# Disable logging to file and syslog since those don't make sense in Kubernetes. |
||||
|
- name: TYPHA_LOGFILEPATH |
||||
|
value: "none" |
||||
|
- name: TYPHA_LOGSEVERITYSYS |
||||
|
value: "none" |
||||
|
# Monitor the Kubernetes API to find the number of running instances and rebalance |
||||
|
# connections. |
||||
|
- name: TYPHA_CONNECTIONREBALANCINGMODE |
||||
|
value: "kubernetes" |
||||
|
- name: TYPHA_DATASTORETYPE |
||||
|
value: "kubernetes" |
||||
|
- name: TYPHA_HEALTHENABLED |
||||
|
value: "true" |
||||
|
# Uncomment these lines to enable prometheus metrics. Since Typha is host-networked, |
||||
|
# this opens a port on the host, which may need to be secured. |
||||
|
#- name: TYPHA_PROMETHEUSMETRICSENABLED |
||||
|
# value: "true" |
||||
|
#- name: TYPHA_PROMETHEUSMETRICSPORT |
||||
|
# value: "9093" |
||||
|
livenessProbe: |
||||
|
exec: |
||||
|
command: |
||||
|
- calico-typha |
||||
|
- check |
||||
|
- liveness |
||||
|
periodSeconds: 30 |
||||
|
initialDelaySeconds: 30 |
||||
|
readinessProbe: |
||||
|
exec: |
||||
|
command: |
||||
|
- calico-typha |
||||
|
- check |
||||
|
- readiness |
||||
|
periodSeconds: 10 |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
# This manifest creates a Pod Disruption Budget for Typha to allow K8s Cluster Autoscaler to evict |
||||
|
|
||||
|
apiVersion: policy/v1beta1 |
||||
|
kind: PodDisruptionBudget |
||||
|
metadata: |
||||
|
name: calico-typha |
||||
|
namespace: kube-system |
||||
|
labels: |
||||
|
k8s-app: calico-typha |
||||
|
spec: |
||||
|
maxUnavailable: 1 |
||||
|
selector: |
||||
|
matchLabels: |
||||
|
k8s-app: calico-typha |
@ -0,0 +1,133 @@ |
|||||
|
# Create all the CustomResourceDefinitions needed for |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: felixconfigurations.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: FelixConfiguration |
||||
|
plural: felixconfigurations |
||||
|
singular: felixconfiguration |
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: bgppeers.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: BGPPeer |
||||
|
plural: bgppeers |
||||
|
singular: bgppeer |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: bgpconfigurations.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: BGPConfiguration |
||||
|
plural: bgpconfigurations |
||||
|
singular: bgpconfiguration |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: ippools.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: IPPool |
||||
|
plural: ippools |
||||
|
singular: ippool |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: hostendpoints.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: HostEndpoint |
||||
|
plural: hostendpoints |
||||
|
singular: hostendpoint |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: clusterinformations.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: ClusterInformation |
||||
|
plural: clusterinformations |
||||
|
singular: clusterinformation |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: globalnetworkpolicies.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: GlobalNetworkPolicy |
||||
|
plural: globalnetworkpolicies |
||||
|
singular: globalnetworkpolicy |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: globalnetworksets.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Cluster |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: GlobalNetworkSet |
||||
|
plural: globalnetworksets |
||||
|
singular: globalnetworkset |
||||
|
|
||||
|
--- |
||||
|
|
||||
|
apiVersion: apiextensions.k8s.io/v1beta1 |
||||
|
kind: CustomResourceDefinition |
||||
|
metadata: |
||||
|
name: networkpolicies.crd.projectcalico.org |
||||
|
spec: |
||||
|
scope: Namespaced |
||||
|
group: crd.projectcalico.org |
||||
|
version: v1 |
||||
|
names: |
||||
|
kind: NetworkPolicy |
||||
|
plural: networkpolicies |
||||
|
singular: networkpolicy |
Write
Preview
Loading…
Cancel
Save