mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
commit
bdb8e05b97
15
cluster/addons/calico-policy-controller/bgppeers-crd.yaml
Normal file
15
cluster/addons/calico-policy-controller/bgppeers-crd.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: bgppeers.crd.projectcalico.org
|
||||||
|
labels:
|
||||||
|
kubernetes.io/cluster-service: "true"
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
spec:
|
||||||
|
scope: Cluster
|
||||||
|
group: crd.projectcalico.org
|
||||||
|
version: v1
|
||||||
|
names:
|
||||||
|
kind: BGPPeer
|
||||||
|
plural: bgppeers
|
||||||
|
singular: bgppeer
|
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: blockaffinities.crd.projectcalico.org
|
||||||
|
labels:
|
||||||
|
kubernetes.io/cluster-service: "true"
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
spec:
|
||||||
|
scope: Cluster
|
||||||
|
group: crd.projectcalico.org
|
||||||
|
version: v1
|
||||||
|
names:
|
||||||
|
kind: BlockAffinity
|
||||||
|
plural: blockaffinities
|
||||||
|
singular: blockaffinity
|
@ -7,84 +7,129 @@ metadata:
|
|||||||
kubernetes.io/cluster-service: "true"
|
kubernetes.io/cluster-service: "true"
|
||||||
addonmanager.kubernetes.io/mode: Reconcile
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
rules:
|
rules:
|
||||||
|
# The CNI plugin needs to get pods, nodes, and namespaces.
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources:
|
resources:
|
||||||
|
- pods
|
||||||
|
- nodes
|
||||||
- namespaces
|
- namespaces
|
||||||
- serviceaccounts
|
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
|
||||||
- watch
|
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources:
|
resources:
|
||||||
- endpoints
|
- endpoints
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
- services
|
- services
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
# Used to discover service IPs for advertisement.
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
- pods/status
|
|
||||||
verbs:
|
|
||||||
- update
|
|
||||||
- patch
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
- nodes
|
|
||||||
verbs:
|
|
||||||
- get
|
|
||||||
- list
|
|
||||||
- update
|
|
||||||
- watch
|
- watch
|
||||||
|
- list
|
||||||
|
# Used to discover Typhas.
|
||||||
|
- 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"]
|
- apiGroups: ["networking.k8s.io"]
|
||||||
resources:
|
resources:
|
||||||
- networkpolicies
|
- networkpolicies
|
||||||
verbs:
|
verbs:
|
||||||
- watch
|
- watch
|
||||||
- list
|
- list
|
||||||
- apiGroups: ["crd.projectcalico.org"]
|
# Used by Calico for policy information.
|
||||||
resources:
|
|
||||||
- felixconfigurations
|
|
||||||
- bgppeers
|
|
||||||
- bgpconfigurations
|
|
||||||
- ippools
|
|
||||||
- globalnetworkpolicies
|
|
||||||
- globalnetworksets
|
|
||||||
- networkpolicies
|
|
||||||
- clusterinformations
|
|
||||||
- hostendpoints
|
|
||||||
verbs:
|
|
||||||
- create
|
|
||||||
- get
|
|
||||||
- list
|
|
||||||
- update
|
|
||||||
- watch
|
|
||||||
# Used in Calico v2.6 only - can be removed after upgrade.
|
|
||||||
- apiGroups: [""]
|
- apiGroups: [""]
|
||||||
resources:
|
resources:
|
||||||
- pods
|
- pods
|
||||||
|
- namespaces
|
||||||
|
- serviceaccounts
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
|
||||||
- list
|
- list
|
||||||
- watch
|
- watch
|
||||||
|
# The CNI plugin patches pods/status.
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources:
|
||||||
|
- pods/status
|
||||||
|
verbs:
|
||||||
- patch
|
- patch
|
||||||
|
# Calico monitors various CRDs for config.
|
||||||
|
# Note: Though we are not using ipam from calico, calico node still needs those permission
|
||||||
|
# to boot.
|
||||||
- apiGroups: ["crd.projectcalico.org"]
|
- apiGroups: ["crd.projectcalico.org"]
|
||||||
resources:
|
resources:
|
||||||
- globalfelixconfigs
|
- globalfelixconfigs
|
||||||
|
- felixconfigurations
|
||||||
|
- bgppeers
|
||||||
- globalbgpconfigs
|
- globalbgpconfigs
|
||||||
|
- bgpconfigurations
|
||||||
|
- ippools
|
||||||
|
- ipamblocks
|
||||||
|
- globalnetworkpolicies
|
||||||
|
- globalnetworksets
|
||||||
|
- networkpolicies
|
||||||
|
- networksets
|
||||||
|
- clusterinformations
|
||||||
|
- hostendpoints
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- list
|
||||||
|
- watch
|
||||||
|
# Calico must create and update some CRDs on startup.
|
||||||
|
- apiGroups: ["crd.projectcalico.org"]
|
||||||
|
resources:
|
||||||
|
- ippools
|
||||||
|
- felixconfigurations
|
||||||
|
- clusterinformations
|
||||||
verbs:
|
verbs:
|
||||||
- create
|
- create
|
||||||
- get
|
|
||||||
- list
|
|
||||||
- update
|
- update
|
||||||
- watch
|
# Calico stores some configuration information on the node.
|
||||||
- apiGroups: ["extensions"]
|
- apiGroups: [""]
|
||||||
resources:
|
resources:
|
||||||
- networkpolicies
|
- nodes
|
||||||
verbs:
|
verbs:
|
||||||
- get
|
- get
|
||||||
- list
|
- list
|
||||||
- watch
|
- 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
|
||||||
|
@ -28,12 +28,60 @@ spec:
|
|||||||
# Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
|
# Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
|
||||||
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
|
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
|
||||||
terminationGracePeriodSeconds: 0
|
terminationGracePeriodSeconds: 0
|
||||||
|
initContainers:
|
||||||
|
- name: install-cni
|
||||||
|
image: gcr.io/projectcalico-org/cni:v3.7.4
|
||||||
|
command: ["/install-cni.sh"]
|
||||||
|
env:
|
||||||
|
- name: CNI_CONF_NAME
|
||||||
|
value: "10-calico.conflist"
|
||||||
|
- name: CNI_NETWORK_CONFIG
|
||||||
|
value: |-
|
||||||
|
{
|
||||||
|
"name": "k8s-pod-network",
|
||||||
|
"cniVersion": "0.3.0",
|
||||||
|
"plugins": [
|
||||||
|
{
|
||||||
|
"type": "calico",
|
||||||
|
"log_level": "info",
|
||||||
|
"datastore_type": "kubernetes",
|
||||||
|
"nodename": "__KUBERNETES_NODE_NAME__",
|
||||||
|
"ipam": {
|
||||||
|
"type": "host-local",
|
||||||
|
"subnet": "usePodCidr"
|
||||||
|
},
|
||||||
|
"policy": {
|
||||||
|
"type": "k8s"
|
||||||
|
},
|
||||||
|
"kubernetes": {
|
||||||
|
"kubeconfig": "__KUBECONFIG_FILEPATH__"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "portmap",
|
||||||
|
"capabilities": {"portMappings": true},
|
||||||
|
"snat": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
- name: KUBERNETES_NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
# Prevents the container from sleeping forever.
|
||||||
|
- name: SLEEP
|
||||||
|
value: "false"
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /host/opt/cni/bin
|
||||||
|
name: cni-bin-dir
|
||||||
|
- mountPath: /host/etc/cni/net.d
|
||||||
|
name: cni-net-dir
|
||||||
containers:
|
containers:
|
||||||
# Runs calico/node container on each Kubernetes node. This
|
# Runs calico/node container on each Kubernetes node. This
|
||||||
# container programs network policy and routes on each
|
# container programs network policy and routes on each
|
||||||
# host.
|
# host.
|
||||||
- name: calico-node
|
- name: calico-node
|
||||||
image: gcr.io/projectcalico-org/node:v3.3.1
|
image: gcr.io/projectcalico-org/node:v3.7.4
|
||||||
env:
|
env:
|
||||||
- name: CALICO_DISABLE_FILE_LOGGING
|
- name: CALICO_DISABLE_FILE_LOGGING
|
||||||
value: "true"
|
value: "true"
|
||||||
@ -57,6 +105,8 @@ spec:
|
|||||||
value: "0"
|
value: "0"
|
||||||
- name: FELIX_TYPHAK8SSERVICENAME
|
- name: FELIX_TYPHAK8SSERVICENAME
|
||||||
value: "calico-typha"
|
value: "calico-typha"
|
||||||
|
- name: USE_POD_CIDR
|
||||||
|
value: "true"
|
||||||
- name: IP
|
- name: IP
|
||||||
value: ""
|
value: ""
|
||||||
- name: NO_DEFAULT_POOLS
|
- name: NO_DEFAULT_POOLS
|
||||||
@ -96,52 +146,9 @@ spec:
|
|||||||
- mountPath: /var/lib/calico
|
- mountPath: /var/lib/calico
|
||||||
name: var-lib-calico
|
name: var-lib-calico
|
||||||
readOnly: false
|
readOnly: false
|
||||||
# This container installs the Calico CNI binaries
|
- mountPath: /run/xtables.lock
|
||||||
# and CNI network config file on each node.
|
name: xtables-lock
|
||||||
- name: install-cni
|
readOnly: false
|
||||||
image: gcr.io/projectcalico-org/cni:v3.3.1
|
|
||||||
command: ["/install-cni.sh"]
|
|
||||||
env:
|
|
||||||
- name: CNI_CONF_NAME
|
|
||||||
value: "10-calico.conflist"
|
|
||||||
- name: CNI_NETWORK_CONFIG
|
|
||||||
value: |-
|
|
||||||
{
|
|
||||||
"name": "k8s-pod-network",
|
|
||||||
"cniVersion": "0.3.0",
|
|
||||||
"plugins": [
|
|
||||||
{
|
|
||||||
"type": "calico",
|
|
||||||
"log_level": "info",
|
|
||||||
"datastore_type": "kubernetes",
|
|
||||||
"nodename": "__KUBERNETES_NODE_NAME__",
|
|
||||||
"ipam": {
|
|
||||||
"type": "host-local",
|
|
||||||
"subnet": "usePodCidr"
|
|
||||||
},
|
|
||||||
"policy": {
|
|
||||||
"type": "k8s"
|
|
||||||
},
|
|
||||||
"kubernetes": {
|
|
||||||
"kubeconfig": "__KUBECONFIG_FILEPATH__"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "portmap",
|
|
||||||
"capabilities": {"portMappings": true},
|
|
||||||
"snat": true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
- 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:
|
volumes:
|
||||||
# Used to ensure proper kmods are installed.
|
# Used to ensure proper kmods are installed.
|
||||||
- name: lib-modules
|
- name: lib-modules
|
||||||
@ -165,6 +172,10 @@ spec:
|
|||||||
- name: var-lib-calico
|
- name: var-lib-calico
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /var/lib/calico
|
path: /var/lib/calico
|
||||||
|
- name: xtables-lock
|
||||||
|
hostPath:
|
||||||
|
path: /run/xtables.lock
|
||||||
|
type: FileOrCreate
|
||||||
tolerations:
|
tolerations:
|
||||||
# Make sure calico/node gets scheduled on all nodes.
|
# Make sure calico/node gets scheduled on all nodes.
|
||||||
- effect: NoSchedule
|
- effect: NoSchedule
|
||||||
|
15
cluster/addons/calico-policy-controller/ipamblock-crd.yaml
Normal file
15
cluster/addons/calico-policy-controller/ipamblock-crd.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: ipamblocks.crd.projectcalico.org
|
||||||
|
labels:
|
||||||
|
kubernetes.io/cluster-service: "true"
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
spec:
|
||||||
|
scope: Cluster
|
||||||
|
group: crd.projectcalico.org
|
||||||
|
version: v1
|
||||||
|
names:
|
||||||
|
kind: IPAMBlock
|
||||||
|
plural: ipamblocks
|
||||||
|
singular: ipamblock
|
15
cluster/addons/calico-policy-controller/ipamconfig-crd.yaml
Normal file
15
cluster/addons/calico-policy-controller/ipamconfig-crd.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: ipamconfigs.crd.projectcalico.org
|
||||||
|
labels:
|
||||||
|
kubernetes.io/cluster-service: "true"
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
spec:
|
||||||
|
scope: Cluster
|
||||||
|
group: crd.projectcalico.org
|
||||||
|
version: v1
|
||||||
|
names:
|
||||||
|
kind: IPAMConfig
|
||||||
|
plural: ipamconfigs
|
||||||
|
singular: ipamconfig
|
15
cluster/addons/calico-policy-controller/ipamhandle-crd.yaml
Normal file
15
cluster/addons/calico-policy-controller/ipamhandle-crd.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: ipamhandles.crd.projectcalico.org
|
||||||
|
labels:
|
||||||
|
kubernetes.io/cluster-service: "true"
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
spec:
|
||||||
|
scope: Cluster
|
||||||
|
group: crd.projectcalico.org
|
||||||
|
version: v1
|
||||||
|
names:
|
||||||
|
kind: IPAMHandle
|
||||||
|
plural: ipamhandles
|
||||||
|
singular: ipamhandle
|
15
cluster/addons/calico-policy-controller/networkset-crd.yaml
Normal file
15
cluster/addons/calico-policy-controller/networkset-crd.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: apiextensions.k8s.io/v1beta1
|
||||||
|
kind: CustomResourceDefinition
|
||||||
|
metadata:
|
||||||
|
name: networksets.crd.projectcalico.org
|
||||||
|
labels:
|
||||||
|
kubernetes.io/cluster-service: "true"
|
||||||
|
addonmanager.kubernetes.io/mode: Reconcile
|
||||||
|
spec:
|
||||||
|
scope: Namespaced
|
||||||
|
group: crd.projectcalico.org
|
||||||
|
version: v1
|
||||||
|
names:
|
||||||
|
kind: NetworkSet
|
||||||
|
plural: networksets
|
||||||
|
singular: networkset
|
@ -26,7 +26,7 @@ spec:
|
|||||||
hostNetwork: true
|
hostNetwork: true
|
||||||
serviceAccountName: calico
|
serviceAccountName: calico
|
||||||
containers:
|
containers:
|
||||||
- image: gcr.io/projectcalico-org/typha:v3.3.1
|
- image: gcr.io/projectcalico-org/typha:v3.7.4
|
||||||
name: calico-typha
|
name: calico-typha
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5473
|
- containerPort: 5473
|
||||||
@ -53,6 +53,8 @@ spec:
|
|||||||
value: "1"
|
value: "1"
|
||||||
- name: TYPHA_HEALTHENABLED
|
- name: TYPHA_HEALTHENABLED
|
||||||
value: "true"
|
value: "true"
|
||||||
|
- name: USE_POD_CIDR
|
||||||
|
value: "true"
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- mountPath: /etc/calico
|
- mountPath: /etc/calico
|
||||||
name: etc-calico
|
name: etc-calico
|
||||||
|
Loading…
Reference in New Issue
Block a user