Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introducing Knative to Small Teams

Introducing Knative to Small Teams

Knative is a powerful and small serverless platform you can install into any Kubernetes cluster to allow developers to build, deploy, scale up and down, and even consume/publish events.

https://starkandwayne.com/blog/introduction-to-knative/

Other links mentioned in slide deck:

https://cloud.google.com/knative/
https://github.com/cppforlife/knctl
https://github.com/cppforlife/kwt
https://github.com/starkandwayne/knative-env
https://github.com/drnic/ruby-meetup-2018-11-27

Dr Nic Williams

November 27, 2018
Tweet

More Decks by Dr Nic Williams

Other Decks in Technology

Transcript

  1. Title Text
    Body Level One
    Body Level Two
    Body Level Three
    Body Level Four
    Body Level Five
    Introducing Knative
    to Small Teams
    Dr Nic Williams @drnic

    View full-size slide

  2. Knative
    @drnic
    Build

    Source code to Docker
    ɑ
    Serving

    Run containers; Route traffic
    Eventing

    Publish & subscribe to events
    Kubernetes

    Containers on any cloud

    View full-size slide

  3. https://starkandwayne.com/blog/introduction-to-knative/

    View full-size slide

  4. knctl deploy -s meetup --image drnic/meetup:v1
    Serving

    Run containers; Route traffic
    myblog.com/first-post Routing 3+ Pods
    https://starkandwayne.com/blog/deploying-12factor-apps-to-knative/
    ɂ

    View full-size slide

  5. Autoscaling

    No traffic, no containers
    __
    https://starkandwayne.com/blog/deploying-12factor-apps-to-knative/
    myblog.com/post Routing 3 Pods
    ɂ
    Routing 0 Pods
    ɂ

    View full-size slide

  6. knctl deploy -s meetup --image drnic/meetup:v1
    Serving

    Revisions have separate routing
    knctl deploy -s meetup --image drnic/meetup:v2
    myblog.com/post Routing v2 - 3 Pods
    ɂ
    v1 - 0 Pods

    View full-size slide

  7. knctl deploy -s meetup --image drnic/meetup:v2 \
    --env TARGET="revision 3"
    Serving

    Revisions have separate routing
    myblog.com/post Routing v3 - 3 Pods
    ɂ
    v1 - 0 Pods
    v2 - 0 Pods

    View full-size slide

  8. Serving

    Rollout new revisions gradually
    $ knctl revisions list
    Service Name Tags Conditions Age Traffic
    meetup meetup-00003 latest 4 OK / 4 48s 100% -> meetup.default.example.com
    ~ meetup-00002 previous 4 OK / 4 1m -
    ~ meetup-00001 - 4 OK / 4 10m -
    $ knctl deploy -s meetup --image drnic/meetup:v2 --env TARGET="revision 4" \
    --managed-route=false
    $ knctl rollout --route meetup -p meetup:previous=50% -p meetup:latest=50%
    $ knctl revisions list
    Service Name Tags Conditions Age Traffic
    meetup meetup-00004 latest 4 OK / 4 4m 50% -> meetup.default.example.com
    ~ meetup-00003 previous 4 OK / 4 6m 50% -> meetup.default.example.com

    View full-size slide

  9. Local traffic

    kwt is your friend
    $ sudo -E kwt net start --dns-map-exec='knctl dns-map'
    $ curl meetup.default.example.com
    $ watch -n1 curl -sS meetup.default.example.com
    https://github.com/cppforlife/kwt

    View full-size slide

  10. Build & Serving

    Deploy from Dockerfile
    git clone https://github.com/cppforlife/simple-app
    cd simple-app
    cat Dockerfile
    knctl deploy \
    --service simple-app \
    --directory . \
    --service-account build \
    --image drnic/simple-app \
    --env SIMPLE_MSG="Hello Ruby people"

    View full-size slide

  11. Build & Serving

    Deploy from Buildpack
    git clone https://github.com/starkandwayne/knative-env
    cd knative-env
    knctl deploy -d . \
    --service knative-env \
    --service-account build \
    --template buildpack \
    --image drnic/knative-env

    View full-size slide

  12. Installation

    Knative on Kubernetes
    kubectl version
    knctl install
    Ingress

    DNS to ingress gateway
    https://starkandwayne.com/blog/public-traffic-into-knative-on-gke/
    https://starkandwayne.com/blog/adding-a-custom-domain-for-knative-services/

    View full-size slide

  13. Knative
    @drnic
    Build

    Source code to Docker
    ɑ
    Serving

    Run containers; Route traffic
    Eventing

    Publish & subscribe to events

    View full-size slide

  14. https://starkandwayne.com/blog/introduction-to-knative/
    https://github.com/cppforlife/knctl
    https://github.com/cppforlife/kwt
    https://cloud.google.com/knative/
    https://github.com/starkandwayne/knative-env
    https://github.com/drnic/ruby-meetup-2018-11-27

    View full-size slide