-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml: add support for generating static Kubernetes manifest
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
Showing
4 changed files
with
180 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,46 @@ | ||
# Install Calico VPP using static Kubernetes manifest | ||
|
||
The recommended way to install Calico VPP is using operator. However, it is possible | ||
to bypass the operator and install Calico VPP using the Kubernetes manifests directly. | ||
To be able to do so, one would need the static Calico VPP manifest. | ||
|
||
Here's how to generate the static Kubernetes manifest: | ||
|
||
* Go to the `vpp-dataplane/yaml/static` dir: | ||
|
||
```bash | ||
cd vpp-dataplane/yaml/static | ||
``` | ||
|
||
* Download the appropriate Calico Kubernetes manifest file: | ||
|
||
```bash | ||
wget https://raw.githubusercontent.com/projectcalico/calico/release-v3.28/manifests/calico.yaml | ||
``` | ||
|
||
* Copy the appropriate generated Calico VPP manifest and rename it to `calico-vpp-daemonset.yaml`. | ||
For example, to install in EKS: | ||
|
||
```bash | ||
cp vpp-dataplane/yaml/generated/calico-vpp-eks.yaml ./calico-vpp-daemonset.yaml | ||
``` | ||
|
||
* If installing in EKS, add the following to the `calico-node` env definitions | ||
in the `calico-vpp-daemonset.yaml` file: | ||
|
||
``` | ||
- name: FELIX_AWSSRCDSTCHECK | ||
value: "Disable" | ||
``` | ||
|
||
* Run kustomize | ||
|
||
```bash | ||
kubectl kustomize . > calico-vpp-eks.yaml | ||
``` | ||
|
||
Now, you can install Calico VPP using the above manifest: | ||
|
||
```bash | ||
kubectl create -f calico-vpp-eks.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,46 @@ | ||
# Install Calico VPP using static Kubernetes manifest | ||
|
||
The recommended way to install Calico VPP is using operator. However, it is possible | ||
to bypass the operator and install Calico VPP using the Kubernetes manifests directly. | ||
To be able to do so, one would need the static Calico VPP manifest. | ||
|
||
Here's how to generate the static Kubernetes manifest: | ||
|
||
* Go to the `vpp-dataplane/yaml/static` dir: | ||
|
||
```bash | ||
cd vpp-dataplane/yaml/static | ||
``` | ||
|
||
* Download the appropriate Calico Kubernetes manifest file: | ||
|
||
```bash | ||
wget https://raw.githubusercontent.com/projectcalico/calico/release-v3.28/manifests/calico.yaml | ||
``` | ||
|
||
* Copy the appropriate generated Calico VPP manifest and rename it to `calico-vpp-daemonset.yaml`. | ||
For example, to install in EKS: | ||
|
||
```bash | ||
cp vpp-dataplane/yaml/generated/calico-vpp-eks.yaml ./calico-vpp-daemonset.yaml | ||
``` | ||
|
||
* If installing in EKS, add the following to the `calico-node` env definitions | ||
in the `calico-vpp-daemonset.yaml` file: | ||
|
||
``` | ||
- name: FELIX_AWSSRCDSTCHECK | ||
value: "Disable" | ||
``` | ||
|
||
* Run kustomize | ||
|
||
```bash | ||
kubectl kustomize . > calico-vpp-eks.yaml | ||
``` | ||
|
||
Now, you can install Calico VPP using the above manifest: | ||
|
||
```bash | ||
kubectl create -f calico-vpp-eks.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 @@ | ||
# 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 |
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 @@ | ||
resources: | ||
- calico.yaml | ||
- calico-vpp-daemonset.yaml | ||
patchesStrategicMerge: | ||
- calico-patch.yaml |