Skip to content

Instantly share code, notes, and snippets.

View zufardhiyaulhaq's full-sized avatar
:octocat:
Hi

Zufar Dhiyaulhaq zufardhiyaulhaq

:octocat:
Hi
View GitHub Profile
@zufardhiyaulhaq
zufardhiyaulhaq / install-p4-tools.sh
Created January 1, 2019 13:57
P4 Lab Environment Bootstrap Script
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# Builds and installs all tools needed for developing and testing P4 support in
# ONOS.
#
# Tested on Ubuntu 14.04, 16.04 and 18.04.
#
# Recommended minimum system requirements:
# 4 GB of RAM
# 2 cores
@zufardhiyaulhaq
zufardhiyaulhaq / p4-onm.sh
Created January 3, 2019 11:01
P4 Open Networking Meetup
git clone https://github.com/p4lang/behavioral-model.git
cd behavioral-model
bash install_deps.sh
cd ..
git clone https://github.com/p4lang/p4c-bm.git
cd p4c-bm
sudo pip install -r requirements.txt
sudo python setup.py install
cd ..

Server Requirement

  • Ubuntu 16.04 64-bit OS
  • 4 GB of memory with swap enabled (8 GB of memory is better)
  • Quad-core 2.6 GHZ CPU (or faster)
  • TCP ports 80, 443,and 1935 are accessible
  • TCP port 7443 is accessible if you intend to configure SSL (recommended), otherwise port
  • 5066 is accessible
  • UDP ports 16384 - 32768 are accessible
  • Port 80 is not in use by another application
#1 Install Helm
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
cat > /tmp/helm.yaml <<EOF
apiVersion: v1
kind: ServiceAccount
metadata:
name: helm
namespace: kube-system
---

Load Balancer:

  • Octavia load balancer is working normally

Load Balancer for Service Kubernetes:

  • network for services : 10.2.0.0/16

  • network for pods : 10.1.0.0/16

  • Octavia amphora VM for service kubernetes is created

  • Haproxy is created in amphora VM

journalctl -f -u kuryr-kubernetes.service

May 28 21:06:09 zu-kuryr-kubernetes-master kuryr-k8s-controller[13937]: 2019-05-28 21:06:09.737 13937 ERROR kuryr_kubernetes.controller.drivers.lbaasv2 [-] Error when creating listener: {"debuginfo": null, "faultcode": "Client", "faultstring": "Another Listener on this Load Balancer is already using protocol_port 53"}
May 28 21:06:11 zu-kuryr-kubernetes-master kuryr-k8s-controller[13937]: 2019-05-28 21:06:11.867 13937 ERROR kuryr_kubernetes.handlers.logging [-] Failed to handle event {u'object': {u'kind': u'Endpoints', u'subsets': [{u'ports': [{u'protocol': u'UDP', u'name': u'dns', u'port': 53}, {u'protocol': u'TCP', u'name': u'dns-tcp', u'port': 53}], u'addresses': [{u'ip': u'10.1.0.148', u'targetRef': {u'kind': u'Pod', u'resourceVersion': u'52208', u'namespace': u'kube-system', u'name': u'coredns-6c868f76bc-qdhd7', u'uid': u'41ad9eb5-8167-11e9-9b1c-525400e3dab3'}, u'nodeName': u'zu-kuryr-kubernetes-worker0'}], u'notReadyAddresses': [{u'ip': u'10.1.3.207', u'targ
@zufardhiyaulhaq
zufardhiyaulhaq / log-1.md
Created June 14, 2019 18:13
Kuryr-kubernetes error pod cannot contact service network
root@zu-kuryr-kubernetes-master:~# kubectl get pod -o wide
NAME                        READY   STATUS    RESTARTS   AGE   IP           NODE                          NOMINATED NODE   READINESS GATES
nginx-lb-6779c778bd-9hkdt   1/1     Running   0          13m   10.1.0.95    zu-kuryr-kubernetes-worker0   <none>           <none>
nginx-lb-6779c778bd-mlv94   1/1     Running   0          13m   10.1.2.14    zu-kuryr-kubernetes-worker0   <none>           <none>
nginx-lb-6779c778bd-v5bq5   1/1     Running   0          13m   10.1.1.216   zu-kuryr-kubernetes-worker0   <none>           <none>
nginx-lb-6779c778bd-wtqfg   1/1     Running   0          13m   10.1.2.157   zu-kuryr-kubernetes-worker1   <none>           <none>
nginx-lb-6779c778bd-znb7v   1/1     Running   0          13m   10.1.0.169   zu-kuryr-kubernetes-worker1   <none>           <none>

root@zu-kuryr-kubernetes-master:~# curl 10.1.0.95
  • master node
root@zu-sona-cni-master:~/sona-cni# kubectl get svc
NAME         TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1      <none>        443/TCP   7h25m
nginx        ClusterIP   10.101.84.72   <none>        80/TCP    10m
root@zu-sona-cni-master:~/sona-cni# kubectl get pod -o wide
NAME                     READY   STATUS    RESTARTS   AGE   IP           NODE                  NOMINATED NODE   READINESS GATES
nginx-65f88748fd-xjpws   1/1     Running   0          10m   20.20.2.44   zu-sona-cni-worker1   <none>           <none>
root@zu-sona-cni-master:~/sona-cni# ovs-ofctl dump-flows kbr-int | grep 20.20.2.44
#!/usr/bin/env python3
"""A MQTT to InfluxDB Bridge
This script receives MQTT data and saves those to InfluxDB.
"""
import re
from typing import NamedTuple
influxdb==5.2.1
paho-mqtt==1.4.0