Coder Social home page Coder Social logo

container-freezer's Introduction

container-freezer

STATUS Sponsoring WG
Alpha Serving

A standalone service for Knative to pause/unpause containers when request count drops to zero.

NOTE It is highly recommended to disable aggressive probing on your application when using the container-freezer. This can be done by setting periodSeconds: 0 on your application's readiness probe. See here for an example.

Installation

Install Knative Serving

In order to use the container-freezer, you will need a running installation of Knative Serving. Instructions for doing so can be found in the docs.

Note that your cluster will need to have the Service Account Token Volume Projection feature enabled. For details, see this link: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection

Next, you will need to label your nodes with the runtime used in your cluster:

  • For containerd: kubectl label nodes minikube knative.dev/container-runtime=containerd

  • For cri-o(version>=1.24.1): kubectl label nodes minikube knative.dev/container-runtime=crio

Install container-freezer

RUNTIME=containerd
RELEASE=v0.1.0
kubectl apply -f "https://github.com/knative-sandbox/container-freezer/releases/download/${RELEASE}/freezer-common.yaml"
kubectl apply -f "https://github.com/knative-sandbox/container-freezer/releases/download/${RELEASE}/freezer-${RUNTIME}.yaml"

Note: RUNTIME must be one of either containerd or crio.

Check the Releases page to get the most recent version.

Enable concurrency endpoint in Knative Serving

By default, Knative does not enable the freezing capability. We can enable it by providing a value for concurrency-state-endpoint in the Knative Serving deployment configmap:

data:
  concurrency-state-endpoint: "http://$HOST_IP:9696"

Alternatively, you can also patch the configmap using kubectl:

kubectl patch configmap/config-deployment -n knative-serving --type merge -p '{"data":{"concurrencyStateEndpoint":"http://$HOST_IP:9696"}}'

Sample application

See the sleeptalker application.

container-freezer's People

Contributors

knative-automation avatar psschwei avatar jwcesign avatar myrat92 avatar rhuss 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.