Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate the polycubectl binary for pcn_k8s docker image #199

Merged
merged 2 commits into from
Aug 26, 2019

Conversation

goldenrye
Copy link
Contributor

@goldenrye goldenrye commented Jul 29, 2019

By default there is no polycubectl binary included in our official published pcn-k8s docker image: https://hub.docker.com/r/polycubenetwork/k8s-pod-network. We need this binary to help user to get more information of cubes running in the docker.

@goldenrye goldenrye requested a review from a team as a code owner July 29, 2019 23:27
@acloudiator
Copy link
Contributor

@goldenrye Could you please add some description to this PR?! Thanks!

@goldenrye
Copy link
Contributor Author

@goldenrye Could you please add some description to this PR?! Thanks!

Didn't realize there is no description, just add it and thanks for the reminding.

@@ -3,7 +3,7 @@ FROM ubuntu:18.04
ARG MODE=default
RUN --mount=target=/polycube cp -r /polycube /tmp/polycube && \
cd /tmp/polycube && \
SUDO="" WORKDIR="/tmp/dev" ./scripts/install.sh $MODE && \
SUDO="" USER="root" WORKDIR="/tmp/dev" ./scripts/install.sh $MODE && \
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to specify the user as "root"? If I'm not mistaken as long as the user have sudo privilege, it should be fine.
@mauriciovasquezbernal any thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the problem here is that without setting the USER environment variable, docker building will fail in this line silently,
install(CODE
"execute_process( COMMAND /bin/sh -c "mkdir -p /var/log/polycube && chown $ENV{USER} /var/log/polycube ")")

@acloudiator
Copy link
Contributor

By default there is no polycubectl binary included in our official published pcn-k8s docker image: https://hub.docker.com/r/polycubenetwork/k8s-pod-network. We need this binary to help user to get more information of cubes running in the docker.

@goldenrye Why do we want this inside the k8s-pod-network, isn't the polycubectl under "polycubenetwork/polycube" image.

Try this and let us know if this what you want.

sudo docker run -it polycubenetwork/polycube /usr/local/bin/polycubectl

@goldenrye
Copy link
Contributor Author

goldenrye commented Aug 7, 2019

By default there is no polycubectl binary included in our official published pcn-k8s docker image: https://hub.docker.com/r/polycubenetwork/k8s-pod-network. We need this binary to help user to get more information of cubes running in the docker.

@goldenrye Why do we want this inside the k8s-pod-network, isn't the polycubectl under "polycubenetwork/polycube" image.

Try this and let us know if this what you want.

sudo docker run -it polycubenetwork/polycube /usr/local/bin/polycubectl

This command works but need add option "--net=host", but you have to run it in each node and won't be able to do that via kubectl like,
$ kubectl exec polycube-sddh5 -n kube-system polycubectl show cubes

polycube-sddh5 is a pod running in a slave node

@frisso
Copy link
Contributor

frisso commented Aug 7, 2019

This relates to bug report #198.

@asimpleidea
Copy link
Contributor

asimpleidea commented Aug 7, 2019

Hi, in order to use polycubectl and check firewall lists I have always followed the quickstart part of the documentation on a worker node (which basically is @acloudiator's command):

docker pull polycubenetwork/polycube:latest
docker run  -it --rm --privileged --network host \
-v /lib/modules:/lib/modules:ro -v /usr/src:/usr/src:ro -v /etc/localtime:/etc/localtime:ro \
polycubenetwork/polycube:latest /bin/bash -c 'polycubed -d && /bin/bash'

It always worked fine.
Anyway, I see your point: entering inside a polycube pod like
kubectl exec -it polycube-pfzjn -n kube-system -c polycubed -- /bin/bash
and interacting with the polycubed of that node without leaving the k8s master could be a more convenient way than ssh-ing into the node and running a docker inside it.

@frisso
Copy link
Contributor

frisso commented Aug 19, 2019

To me this PR makes sense.
Just a question: is this causing the size of our dockers to grow? To me, this size is already a little bit big, so I would avoid further increases if not strictly needed.

@mauriciovasquezbernal
Copy link
Contributor

I didn't enable this at that time because we're worried about the size of the image. I don't think this is an issue anymore, also the polycubectl size is about 10MB, what I think is negligible at this point.

@frisso
Copy link
Contributor

frisso commented Aug 22, 2019

@goldenrye It looks there's a consensus to add this PR. I would suggest to add a brief text in the "troubleshooting" section here, so that people are aware of this possibility:
https://github.com/polycube-network/polycube/blob/master/Documentation/components/k8s/pcn-kubernetes.rst

Copy link
Collaborator

@palexster palexster left a comment

Choose a reason for hiding this comment

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

/lgtm

@frisso frisso merged commit 38f2fb4 into master Aug 26, 2019
@frisso frisso deleted the jpi-issue-198 branch August 26, 2019 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants