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

docs request: add info on auth when running telepresence in a container #180

Open
nicks opened this issue Mar 20, 2023 · 0 comments
Open

Comments

@nicks
Copy link

nicks commented Mar 20, 2023

There's currently a doc on running telepresence in a container:

https://github.com/telepresenceio/telepresence.io/blob/529193ba20a82485054739e4260283ee44866e1d/docs/pre-release/reference/inside-container.md

This will work if you use kubernetes token auth. This doc doesn't work if you use kubectl auth plugins. Each auth plugin will need a different approach.

Here are instructions for AWS:

Change your dockerfile to this:

FROM golang:1.20-alpine as auth-builder
RUN go install sigs.k8s.io/aws-iam-authenticator/cmd/[email protected]

# Dockerfile with telepresence and its prerequisites
FROM alpine:3.13

# Install Telepresence prerequisites
RUN apk add --no-cache curl iproute2 sshfs

# Download and install the telepresence binary
RUN curl -fL https://app.getambassador.io/download/tel2/linux/amd64/latest/telepresence -o telepresence && \
   install -o root -g root -m 0755 telepresence /usr/local/bin/telepresence

COPY --from=auth-builder /go/bin/aws-iam-authenticator ./aws-iam-authenticator
RUN install -o root -g root -m 0755 aws-iam-authenticator /usr/local/bin/aws-iam-authenticator && \
    rm aws-iam-authenticator

Change your docker run call to:

$ docker run \
  --cap-add=NET_ADMIN \
  --device /dev/net/tun:/dev/net/tun \
  --network=host \
  -v ~/.kube/config:/root/.kube/config \
  -v ~/.aws:/root/.aws \
  -it --rm tp-in-docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant