openvnf / kube-vxlan-controller Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Hi,
I have tried to scale a deployment with replicas=2, unfortunately both replicas were assigned the same IP address, as set in the annotation;
apiVersion: v1
items:
- apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
run: a
vxlan.openvnf.org: "true"
name: a
spec:
progressDeadlineSeconds: 2147483647
replicas: 2
revisionHistoryLimit: 2147483647
selector:
matchLabels:
run: a
vxlan.openvnf.org: "true"
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
annotations:
vxlan.openvnf.org/networks: |
vxeth1
ip=**192.168.11.2/24**
route=192.168.12.0/29:192.168.11.1
creationTimestamp: null
labels:
run: a
vxlan.openvnf.org: "true"
After both replicas have deployed, I see the same IP address in both replicas:
k get pods
NAME READY STATUS RESTARTS AGE
**a-58b8f56785-56bgq** 2/2 Running 0 15m
**a-58b8f56785-8rrmx** 2/2 Running 0 15m
b-69f6578949-xrhw2 2/2 Running 0 15m
gw-85fcb84c48-fmh2w 2/2 Running 0 15m
k exec -it **a-58b8f56785-56bgq** -- ifconfig vxeth1
Defaulted container "a" out of: a, vxlan-controller-agent, vxlan-controller-agent-init (init)
vxeth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet **192.168.11.2** netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::d864:4bff:fe72:2db7 prefixlen 64 scopeid 0x20<link>
ether da:64:4b:72:2d:b7 txqueuelen 1000 (Ethernet)
RX packets 13 bytes 728 (728.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14 bytes 784 (784.0 B)
TX errors 0 dropped 6 overruns 0 carrier 0 collisions 0
k exec -it **a-58b8f56785-8rrmx** -- ifconfig vxeth1
Defaulted container "a" out of: a, vxlan-controller-agent, vxlan-controller-agent-init (init)
vxeth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1450
inet **192.168.11.2** netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::a021:fcff:feb8:57d1 prefixlen 64 scopeid 0x20<link>
ether a2:21:fc:b8:57:d1 txqueuelen 1000 (Ethernet)
RX packets 14 bytes 784 (784.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 14 bytes 784 (784.0 B)
TX errors 0 dropped 6 overruns 0 carrier 0 collisions 0
Is there a way to specify a subnet but not a hard-coded IP address in the annotation?
Thanks!
Good day,
We have noticed that there is problems assigning vxlan interfaces to pods which are deployed as “StatefulSets”, problem appears in case these statefuls set pods are upgraded or deleted and problem solves it self after vxlna controller has been restarted.
Has this kind of issue been noticed already and has a fix or will have?
kube-vxlan-controller not running correctly on kubernetes 1.16.1
kube-system kube-vxlan-controller-f4f4bb656-4kllq 0/1 CrashLoopBackOff 26 119m
ubuntu@worker-1a:~$ kubectl -nkube-system describe pod kube-vxlan-controller-f4f4bb656-4kllq
Name: kube-vxlan-controller-f4f4bb656-4kllq
Namespace: kube-system
Priority: 0
Node: worker-1a/10.123.76.16
Start Time: Thu, 09 Jan 2020 09:56:38 +0000
Labels: pod-template-hash=f4f4bb656
run=kube-vxlan-controller
Annotations: cni.projectcalico.org/podIP: 10.10.100.74/32
Status: Running
IP: 10.10.100.74
IPs:
IP: 10.10.100.74
Controlled By: ReplicaSet/kube-vxlan-controller-f4f4bb656
Containers:
kube-vxlan-controller:
Container ID: docker://f1e35789f19d64c5013bd2dc1a827696b41260f018b9c06f6d674c007ae3c20f
Image: openvnf/kube-vxlan-controller:latest
Image ID: docker-pullable://openvnf/kube-vxlan-controller@sha256:b989aa8106cee3a24eaf0058d7e8e69d78a32602cafed2835b0e0488aa4d6307
Port: <none>
Host Port: <none>
Args:
run
State: Waiting
Reason: CrashLoopBackOff
Last State: Terminated
Reason: Completed
Exit Code: 0
Started: Thu, 09 Jan 2020 11:52:10 +0000
Finished: Thu, 09 Jan 2020 11:52:26 +0000
Ready: False
Restart Count: 26
Environment: <none>
Mounts:
/etc/kube-vxlan-controller from kube-vxlan-controller-config (rw)
/usr/share/kube-vxlan-controller from kube-vxlan-controller-db (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-vxlan-controller-token-wdrlp (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-vxlan-controller-config:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: kube-vxlan-controller-config
Optional: false
kube-vxlan-controller-db:
Type: EmptyDir (a temporary directory that shares a pod's lifetime)
Medium:
SizeLimit: <unset>
kube-vxlan-controller-token-wdrlp:
Type: Secret (a volume populated by a Secret)
SecretName: kube-vxlan-controller-token-wdrlp
Optional: false
QoS Class: BestEffort
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Pulling 10m (x26 over 120m) kubelet, worker-1a Pulling image "openvnf/kube-vxlan-controller:latest"
Warning BackOff 37s (x515 over 120m) kubelet, worker-1a Back-off restarting failed container
Full manifest:
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-vxlan-controller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: kube-vxlan-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: kube-vxlan-controller
namespace: kube-system
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-vxlan-controller
namespace: kube-system
data:
vxeth0: id=100 up
vxeth1: id=101 up
vxeth2: id=102 up
vxeth3: id=103 up
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-vxlan-controller-config
namespace: kube-system
data:
config: |
[{'kube-vxlan-controller', [
{db_file, "/usr/share/kube-vxlan-controller/db"},
{selector, "vxlan.openvnf.org"},
{annotation, "vxlan.openvnf.org/networks"}
]}].
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
run: kube-vxlan-controller
name: kube-vxlan-controller
namespace: kube-system
spec:
selector:
matchLabels:
run: kube-vxlan-controller
template:
metadata:
labels:
run: kube-vxlan-controller
spec:
containers:
- name: kube-vxlan-controller
image: openvnf/kube-vxlan-controller:0.10.2
args:
- run
volumeMounts:
- name: kube-vxlan-controller-config
mountPath: /etc/kube-vxlan-controller
- name: kube-vxlan-controller-db
mountPath: /usr/share/kube-vxlan-controller
volumes:
- name: kube-vxlan-controller-config
configMap:
name: kube-vxlan-controller-config
- name: kube-vxlan-controller-db
emptyDir: {}
serviceAccount: kube-vxlan-controller
serviceAccountName: kube-vxlan-controller
ubuntu@worker-1a:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:18:23Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.4", GitCommit:"224be7bdce5a9dd0c2fd0d46b83865648e2fe0ba", GitTreeState:"clean", BuildDate:"2019-12-11T12:37:43Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.