Giter Club home page Giter Club logo

linkerd-await's Introduction

linkerd-await

A command-wrapper that polls Linkerd for readiness until it becomes ready and only then executes a command.

Usage

linkerd-await 0.2.7
Wait for linkerd to become ready before running a program

USAGE:
    linkerd-await [OPTIONS] [ARGS]

ARGS:
    <CMD>        The command to run after linkerd is ready
    <ARGS>...    Arguments to pass to CMD if specified

OPTIONS:
    -b, --backoff <BACKOFF>    Time to wait after a failed readiness check [default: 1s]
    -h, --help                 Print help information
    -p, --port <PORT>          The port of the local Linkerd proxy admin server [default: 4191]
    -S, --shutdown             Forks the program and triggers proxy shutdown on completion
    -t, --timeout <TIMEOUT>    Causes linked-await to fail when the timeout elapses before the proxy
                               becomes ready
    -v, --verbose              Causes linkerd-await to print an error message when disabled [env:
                               LINKERD_AWAIT_VERBOSE=]
    -V, --version              Print version information

Examples

Dockerfile

# Create a base layer with linkerd-await from a recent release.
FROM docker.io/curlimages/curl:latest as linkerd
ARG LINKERD_AWAIT_VERSION=v0.2.7
RUN curl -sSLo /tmp/linkerd-await https://github.com/linkerd/linkerd-await/releases/download/release%2F${LINKERD_AWAIT_VERSION}/linkerd-await-${LINKERD_AWAIT_VERSION}-amd64 && \
    chmod 755 /tmp/linkerd-await

# Build your application with whatever environment makes sense.
FROM myapp-build as app
WORKDIR /app
RUN make build

# Package the application wrapped by linkerd-await. Note that the binary is
# static so it can be used in `scratch` images:
FROM scratch
COPY --from=linkerd /tmp/linkerd-await /linkerd-await
COPY --from=app /app/myapp /myapp
# In this case, we configure the proxy to be shutdown after `myapp` completes
# running. This is only really needed for jobs where the application is
# expected to complete on its own (namely, `Jobs` and `Cronjobs`)
ENTRYPOINT ["/linkerd-await", "--shutdown", "--"]
CMD  ["/myapp"]

Disabling linkerd-await at runtime

The LINKERD_AWAIT_DISABLED (or LINKERD_DISABLED) environment variable can be set to bypass linkerd-await's readiness checks. This way, linkerd-await may be controlled by overriding a default environment variable:

    # ...
    spec:
      containers:
        - name: myapp
          env:
            - name: LINKERD_AWAIT_DISABLED
              value: "Linkerd is disabled ;("
          # ...

linkerd-await's People

Contributors

dependabot[bot] avatar olix0r avatar kleimkuhler avatar adleong avatar cristicbz avatar hawkw avatar naseemkullah avatar nickvollmar avatar enrico2 avatar wmorgan avatar bohrasd avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.