Skip to content

Commit

Permalink
yaml: add support for generating static Kubernetes manifest
Browse files Browse the repository at this point in the history
This patch provides a way to generate the static Kubernetes manifest
which can be used to install Calico VPP without using operator.
  • Loading branch information
onong authored and sknat committed Jun 20, 2024
1 parent ad70801 commit 9990175
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/manifest_based_install.md
54 changes: 54 additions & 0 deletions yaml/static/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
## Install Calico VPP using static Kubernetes manifest

The recommended way to install Calico VPP is using operator. However, it is also possible
to bypass the operator and install Calico VPP using the Kubernetes manifest directly.
To be able to do so, one would need the static Calico VPP manifest.

Here's how to generate the static Kubernetes manifest:

* Clone the Calico VPP repo and go to the `vpp-dataplane/yaml/static` dir:

```bash
cd vpp-dataplane/yaml/static
```

* Download the appropriate Calico Kubernetes manifest file. For example, to
install Calico VPP v3.28.0, download the corresponding Calico v3.28.0 manifest:

```bash
wget https://raw.githubusercontent.com/projectcalico/calico/release-v3.28/manifests/calico.yaml
```

* Copy the appropriate **generated** Calico VPP daemonset yaml and rename it to `calico-vpp-daemonset.yaml`.
For example, to install Calico VPP v3.28.0 in EKS:

```bash
git checkout release/v3.28.0
cp ../generated/calico-vpp-eks.yaml ./calico-vpp-daemonset.yaml
```

One can also download the same directly:

```bash
wget -O calico-vpp-daemonset.yaml https://raw.githubusercontent.com/projectcalico/vpp-dataplane/release/v3.28.0/yaml/generated/calico-vpp-eks.yaml
```

* Finally, run kustomize:

```bash
kubectl kustomize . > calico-vpp-eks.yaml
```

`calico-vpp-eks.yaml` is the static Kubernetes manifest that can be used to install Calico VPP in EKS directly.


Having generated the static manifest, one can then customize it per one's requirements and environment before installing.
Please refer to [Getting Started](https://docs.projectcalico.org/getting-started/kubernetes/vpp/getting-started) for more information.


**NOTE:** If installing in EKS, add the following to the `calico-node` env definitions:
```
- name: FELIX_AWSSRCDSTCHECK
value: "Disable"
```

83 changes: 83 additions & 0 deletions yaml/static/calico-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# calico-config configmap changes
kind: ConfigMap
apiVersion: v1
metadata:
name: calico-config
namespace: kube-system
data:
calico_backend: "none"
cni_network_config: |-
{
"name": "k8s-pod-network",
"cniVersion": "0.3.1",
"plugins": [
{
"type": "calico",
"log_level": "debug",
"datastore_type": "kubernetes",
"nodename": "__KUBERNETES_NODE_NAME__",
"mtu": __CNI_MTU__,
"ipam": {
"type": "calico-ipam"
},
"policy": {
"type": "k8s"
},
"kubernetes": {
"kubeconfig": "__KUBECONFIG_FILEPATH__"
},
"dataplane_options": {
"type": "grpc",
"socket": "unix:///var/run/calico/cni-server.sock"
}
},
{
"type": "portmap",
"snat": true,
"capabilities": {"portMappings": true}
}
]
}
---
kind: DaemonSet
apiVersion: apps/v1
metadata:
name: calico-node
namespace: kube-system
labels:
k8s-app: calico-node
spec:
template:
spec:
containers:
- name: calico-node
env:
- name: FELIX_USEINTERNALDATAPLANEDRIVER
value: "false"
- name: FELIX_DATAPLANEDRIVER
value: /usr/local/bin/felix-plugins/felix-api-proxy
- name: FELIX_XDPENABLED
value: "false"
# Cluster type to identify the deployment type
- name: CLUSTER_TYPE
value: "k8s,bgp,vpp"
# Remove bird from liveness and readiness probes
livenessProbe:
exec:
command:
- /bin/calico-node
- -felix-live
readinessProbe:
exec:
command:
- /bin/calico-node
- -felix-ready
volumeMounts:
- mountPath: /usr/local/bin/felix-plugins
name: felix-plugins
readOnly: true
volumes:
- name: felix-plugins
hostPath:
path: /var/lib/calico/felix-plugins
5 changes: 5 additions & 0 deletions yaml/static/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
- calico.yaml
- calico-vpp-daemonset.yaml
patchesStrategicMerge:
- calico-patch.yaml

0 comments on commit 9990175

Please sign in to comment.