Duffie Cooley
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- title: A kind workflow for contributing to Kubernetes tags: kind, main description: Deck for https://sched.co/Uaek slideOptions: theme: solarized center: false --- <!-- .slide: class="center" data-background-image="https://k8s.work/title.jpg" data-background-size="100%" --> ## A kind workflow ### for contributing to ## Kubernetes! slide: [kind.k8s.work](https://kind.k8s.work) `curl -L kind.k8s.work/fetch | bash` <!-- Note from session [patricklang] - the resulting /tmp/kind-cache.tar.gz wasn't accessible on the Windows OS side. Windows: `curl.exe -L kind.k8s.work/fetch | cmd` once that finishes, run `docker ps`, get the container ID, then `docker cp <containerid>:/tmp/kind-cache.tar.gz .` and last `docker load -i kind-cache.tar.gz` --> --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Go Get The BITS!! <br/> ##### This will download everything needed for the workshop! ``` curl -L kind.k8s.work/fetch | bash # Windows: curl.exe -L kind.k8s.work/fetch | cmd docker run --rm -i -v /tmp:/tmp --network=host quay.io/kind-workshop/kind-fetch ``` > Note: Using Windows? Be sure to use `curl.exe` and pipe to `cmd` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Who are we? | ![](https://k8s.work/ben.png) | ![](https://k8s.work/james.png) | | --------------------------------- | -------------------------------- | | ![](https://k8s.work/patrick.png) | ![](https://k8s.work/duffie.png) | | | :sparkles: 4 different companys, one team. :sparkles: | | |-|-|-| `curl -L kind.k8s.work/fetch | bash` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Welcome Everyone! ### Let's get to know one another! A few questions: * Did you bring a laptop? * Do you have docker installed? * Have you contributed to Kubernetes before? <br/> <br/> `curl -L kind.k8s.work/fetch | bash` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Agenda: * Get Docker installed! * Get "the bits!" * Overview of the Kind Project * Overview of contributing to Kubernetes * Sample Commit * Let's build from before the sample commit * Let's build our cloned version of the patch * Let's verify things work as work as expected! * Profit! --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Let's get docker installed. * For the MAC: https://docs.docker.com/docker-for-mac/install/ * For Windows: https://docs.docker.com/docker-for-windows/install/ * For linux: * Ubuntu: https://docs.docker.com/v17.12/install/linux/docker-ce/ubuntu/ * Fedora: https://docs.docker.com/v17.12/install/linux/docker-ce/fedora --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Check Docker Desktop settings #### https://kind.sigs.k8s.io/docs/user/quick-start/#settings-for-docker-desktop ![](https://github.com/kubernetes-sigs/kind/raw/master/site/content/docs/user/images/docker-pref-build-win.png =400x300) <!-- Note from session [patricklang]: This would have been a good "walk-in" slide along with the docker run ... kind-fetch. Some people were failing during fetch because disk image max size was too low. --> --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Start your wifi. Make some waves! ##### If you have already pulled `quay.io/kind-workshop/kind-cache` you don't need to do this! also THANKS! ``` curl -L kind.k8s.work/fetch | bash # Windows: curl.exe -L kind.k8s.work/fetch | cmd ``` This will download a flattened image that has all the bits needed for the workshop. It will do this using aria2 and will multiget it from 10 servers in us-west-1 --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Wait, what are we downloading? ##### These are all things you'll need to build & deploy with Kind in this workshop ``` What Size -------------------------------------- kind-buildenv:1.13 1.37GB kindest/base:latest 329MB etcd:3.3.10 258MB kube-cross:v1.12.7-1 1.75GB coredns:1.3.1 40.3MB kindnetd:0.5.0 81.8MB debian-iptables-amd64:v11.0.2 45.4MB debian-base-amd64:v1.0.0 42.3MB pause:3.1 742kB ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### This is *NOT* real life :) In real life you would have all of kubernetes checked out and would likely be running `kind` from you laptop via ``` brew install kind choco install kind ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### This lab is canned! Once all of the resources are downloaded we can do this entire lab offline. Note: We also provide a buildenv so that we can reduce the dependencies down to just the Docker Daemon! :) --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### go get kubernetes go get -d k8s.io/kubernetes This will take a minute Why not github.com/kubernetes/kubernetes? Note: When we go get the kubernetes codebase we want to check it out from k8s.io/kubernetes even tho it's hosted at github.com/kubernetes/kubernetes. This is important because the import paths make assumptions about where to go to find modules and all of the kubernetes specific import paths begin with k8s.io/ --- <!-- .slide: class="center" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ## What is kind? ![](https://i.imgur.com/la7Yafx.png=600x800) --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/kind1.png" data-background-size="100%" --> --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/kind2.png" data-background-size="100%" --> --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Contributors get free cache! For this session, we've asked everyone to download an image ahead of time. This isn't what you'd do at home, but it keeps us from waiting on wifi today :) Let's start up the cache, and get it's IP: ``` $ curl -L kind.k8s.work/cache docker run --rm --name kind-cache -v /var/run/docker.sock:/var/run/docker.sock quay.io/kind-workshop/kind-cache ``` > Note: Using PowerShell? Be sure to use `curl.exe` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Start up a build environment This has golang, git, bazel and all the other tools you need ready to go. ``` $ curl -L kind.k8s.work/buildenv docker run --rm -d --name buildenv --hostname buildenv -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp quay.io/kind-workshop/kind-buildenv:1.13 ``` Once that's started, shell into it ``` docker exec -it buildenv bash ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Let's see what we're testing ``` root@buildenv:/go/src/k8s.io/kubernetes# git log commit 97c4edaa4f28f914db45766330b6db8953720588 (HEAD -> fix) Author: louisssgong <louisssgong@tencent.com> Date: Sat Aug 3 17:44:12 2019 +0800 Fix a bug in the IPVS proxier where virtual servers are not cleaned up even though the corresponding Service object was deleted. ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Build before the change ``` kind build node-image --image=local:master ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Build a cluster ``` cd /go kind create cluster --config kind-config.yaml --image=local:master ``` ``` kind get kubeconfig --internal > ~/.kube/config kubectl get pods -Aw ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Testing it out ``` kubectl create deploy test --image=k8s.gcr.io/pause:3.1 kubectl expose deploy test --port 80 ``` ``` docker exec -ti kind-control-plane ip addr show dev kube-ipvs0 kubectl get svc -o wide ``` ``` kubectl delete svc test docker exec -ti kind-control-plane ip addr show dev kube-ipvs0 ``` > Hmm, the interface should have been removed, but it wasn't --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Cleaning up before testing the fix ``` kind delete cluster ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Build after the change ``` kind build node-image --image=local:fix ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Build a cluster with the fix ``` cd /go kind create cluster --config kind-config.yaml --image=local:fix ``` ``` kind get kubeconfig --internal > ~/.kube/config kubectl get pods -Aw ``` ``` kubectl delete svc test docker exec -ti kind-control-plane ip addr show dev kube-ipvs0 ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Testing the fix ``` kubectl create deploy test --image=k8s.gcr.io/pause:3.1 kubectl expose deploy test --port 80 ``` ``` docker exec -ti kind-control-plane ip addr show dev kube-ipvs0 kubectl get svc -o wide ``` --- <!-- .slide: style="text-align: left;" data-background-image="https://k8s.work/blank.jpg" data-background-size="100%" --> ### Cleaning up! `docker stop buildenv` `docker system prune --volumes` `docker system prune` --- <!-- .slide: class="center" data-background-image="https://k8s.work/endcap.jpg" data-background-size="100%" --> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> <br/> ### Thanks everyone! #### Keep Being `KinD`

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully