Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Added networking hack for CNI namespaced veth pairs #35

Merged
merged 3 commits into from
Oct 16, 2018
Merged

Conversation

lumjjb
Copy link
Member

@lumjjb lumjjb commented Oct 12, 2018

Added modifications to work with networking of k8s CNI plugin using network namespace for now.

apiVersion: apps/v1beta1
kind: Deployment
metadata:
  labels:
    app: nabla
  name: nabla
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: nabla
      name: nabla
      annotations:
        io.kubernetes.cri.untrusted-workload: "true"
    spec:
      containers:
        - name: nabla
          image: nablact/node-express-nabla:latest
          imagePullPolicy: Always
          ports:
          - containerPort: 8080

lumjjb@lumjjb-ThinkPad-P50:~/go/src/github.com/nabla-containers/runnc/runnc-cli$ cat ~/services/nabla.yaml
kind: Service
apiVersion: v1
metadata:
  name: nabla-service
spec:
  selector:
    app: nabla
  ports:
  - port: 8080
    targetPort: 8080
lumjjb@lumjjb-ThinkPad-P50:~/go/src/github.com/nabla-containers/runnc/runnc-cli$ k get services
NAME            TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)    AGE
kubernetes      ClusterIP   10.0.0.1     <none>        443/TCP    1h
nabla-service   ClusterIP   10.0.0.67    <none>        8080/TCP   4m
lumjjb@lumjjb-ThinkPad-P50:~/go/src/github.com/nabla-containers/runnc/runnc-cli$ k get pods
NAME                      READY   STATUS    RESTARTS   AGE
myubuntu-5ff9c565-54w29   1/1     Running   0          12m
myubuntu-5ff9c565-ssvk6   1/1     Running   0          12m
myubuntu-5ff9c565-v67gr   1/1     Running   0          12m
nabla-857c6d9b9-rqntw     1/1     Running   0          20s
lumjjb@lumjjb-ThinkPad-P50:~/go/src/github.com/nabla-containers/runnc/runnc-cli$ curl 10.0.0.67:8080
Nabla!

Signed-off-by: Brandon Lum [email protected]

@lumjjb lumjjb self-assigned this Oct 12, 2018
@lumjjb lumjjb requested a review from ricarkol October 12, 2018 21:41
@@ -18,9 +18,13 @@
# PERFORMANCE OF THIS SOFTWARE.

BIN_PATH=/usr/local/bin/
BIN_PATH2=/opt/runnc/bin/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this path needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since runnc is the only thing that the user is going to use, i was moving runnc-cont and nabla-run into a directory where the user would not be able to directly call it. As discussed, will add this as a comment.

} else if inK8s {
// The tap device will get the IP assigned to the Docker
// container veth pair.
ip, gw, mask, err = network.CreateTapInterfaceDocker(tapName, "eth0")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment (a XXX) mentioning the error you get when using macvtaps. It's kind of mysterious to me why this is working and the macvtap not when using k8.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok will do!

Signed-off-by: Brandon Lum <[email protected]>
Copy link
Contributor

@ricarkol ricarkol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@ricarkol ricarkol merged commit 61d33ec into master Oct 16, 2018
@lumjjb lumjjb deleted the k8s-network branch April 8, 2019 21:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants