Start with building the images locally, as described here. Once the build process finishes,
you should see a contivvpp/dev-vswitch
image with some specific tag, e.g.:
$ docker images | grep contivvpp/dev-vswitch
contivvpp/dev-vswitch 0.0.1-424-gd1a17e5 e6c9f12da183 About an hour ago 20.2GB
docker run -it contivvpp/dev-vswitch:0.0.1-424-gd1a17e5 bash
# if you are behind a proxy
export HTTPS_PROXY=http://proxy-wsa.esl.cisco.com:80/
export HTTP_PROXY=http://proxy-wsa.esl.cisco.com:80/
cd /opt/vpp-agent/dev/vpp/
git checkout master
git pull
(this will build the debug VPP binary we will actually use)
make build
If there haven't been any changes in the binary APIs since your last VPP update, you can continue with step 7.
(we need to install the new API JSON files into /usr/share/vpp/api/
)
rm build-root/*.deb
make pkg-deb
yes | apt remove vpp vpp-plugins vpp-lib vpp-dev
cd build-root && dpkg -i *.deb
Lookup the github.com/ligato/vpp-agent
commit ID in ~/go/src/github.com/contiv/vpp/glide.yaml
, e.g.:
cat ~/go/src/github.com/contiv/vpp/glide.yaml
...
- package: github.com/ligato/vpp-agent
version: dde9840771b6e59a72da20a83415c0453324c1f8
...
Use that version in the following step:
cd ~/go/src/github.com/ligato/vpp-agent/
git checkout dde9840771b6e59a72da20a83415c0453324c1f8
make generate
# review the changes in APIs files, edit the code if needed
git diff
# build - must be succesfull
make
cd ~/go/src/github.com/contiv/vpp/
rm -rf vendor/github.com/ligato/vpp-agent/
cp -r ~/go/src/github.com/ligato/vpp-agent/ vendor/github.com/ligato/
rm -rf vendor/github.com/ligato/vpp-agent/vendor/
make generate
make
make install
docker ps | grep vswitch
ba4e8b8b69d6 contivvpp/dev-vswitch:0.0.1-424-gd1a17e5 "bash" 2 minutes ago Up 2 minutes pensive_jepsen
docker commit --change='CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]' ba4e8b8b69d6 contivvpp/dev-vswitch:0.0.1-424-gd1a17e5
(the CMD statement would be overwritten, so we need to specify it. If you don't want to start supervisord by container startup, you can modify it to your needs)
Modify the contiv-vpp.yaml file to use your dev image instead of the
contivvpp/vswitch
image. Also, disable the readinessProbe
and livenessProbe
. The example
of the diff is below.
Then deploy the network plugin using the modified YAML file:
kubectl apply -f contiv-vpp.yaml
diff --git a/k8s/contiv-vpp.yaml b/k8s/contiv-vpp.yaml
index df94c82..47a40b4 100644
--- a/k8s/contiv-vpp.yaml
+++ b/k8s/contiv-vpp.yaml
@@ -134,7 +134,7 @@ spec:
initContainers:
# This init container extracts/copies VPP LD_PRELOAD libs and default VPP config to the host.
- name: vpp-init
- image: contivvpp/vswitch
+ image: contivvpp/dev-vswitch:0.0.1-424-gd1a17e5
imagePullPolicy: IfNotPresent
command:
- /bin/sh
@@ -160,7 +160,7 @@ spec:
# Runs contiv-vswitch container on each Kubernetes node.
# It contains the vSwitch VPP and its management agent.
- name: contiv-vswitch
- image: contivvpp/vswitch
+ image: contivvpp/dev-vswitch:0.0.1-424-gd1a17e5
imagePullPolicy: IfNotPresent
securityContext:
privileged: true
@@ -169,17 +169,17 @@ spec:
- containerPort: 5002
# readiness + liveness probe
- containerPort: 9191
- readinessProbe:
- httpGet:
- path: /readiness
- port: 9191
- periodSeconds: 1
- livenessProbe:
- httpGet:
- path: /liveness
- port: 9191
- periodSeconds: 1
- initialDelaySeconds: 15
+# readinessProbe:
+# httpGet:
+# path: /readiness
+# port: 9191
+# periodSeconds: 1
+# livenessProbe:
+# httpGet:
+# path: /liveness
+# port: 9191
+# periodSeconds: 1
+# initialDelaySeconds: 15
env:
- name: MICROSERVICE_LABEL
valueFrom: