├── kubeadm.md ├── namespace-sandbox.json ├── k8s-native-app.md ├── 006.md ├── new-day.md ├── gke.md ├── 009.md ├── 007.md ├── spark.md ├── todo.md ├── 003.md ├── dcos.md ├── 005.md ├── 001.md ├── 002.md ├── 008.md ├── README.md ├── 004.md ├── kubectl.md ├── LICENSE └── minikube.md /kubeadm.md: -------------------------------------------------------------------------------- 1 | # kubeadm 2 | 3 | `kubeadm` 4 | -------------------------------------------------------------------------------- /namespace-sandbox.json: -------------------------------------------------------------------------------- 1 | { 2 | "kind": "Namespace", 3 | "apiVersion": "v1", 4 | "metadata": { 5 | "name": "sandbox" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /k8s-native-app.md: -------------------------------------------------------------------------------- 1 | ## Kubernetes Native Applications 2 | 3 | **Kubernetes native applications** are both managed using the Kubernetes APIs (via `kubectl`) and ran on Kubernetes as containers. 4 | -------------------------------------------------------------------------------- /006.md: -------------------------------------------------------------------------------- 1 | # Day 6 — Kubernetes on DC/OS 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | 1. [Kubernetes on DC/OS](./dcos.md) 7 | 8 | ## Notes 9 | 10 | ... 11 | -------------------------------------------------------------------------------- /new-day.md: -------------------------------------------------------------------------------- 1 | # Day FIXME 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | * FIXME (Add the sections watched) 7 | 1. FIXME (other activities) 8 | 9 | ## Notes 10 | 11 | 1. FIXME (Add notes) 12 | -------------------------------------------------------------------------------- /gke.md: -------------------------------------------------------------------------------- 1 | # Google Kubernetes Engine 2 | 3 | [Google Kubernetes Engine](https://cloud.google.com/kubernetes-engine/) 4 | 5 | * Kubernetes on Google Cloud 6 | * Deploy, manage, and scale containerized applications on Kubernetes 7 | * You have $300.00 in credit and 351 days left in your free trial. 8 | * Pin Kubernetes Engine for an easier navigation 9 | -------------------------------------------------------------------------------- /009.md: -------------------------------------------------------------------------------- 1 | # Day 9 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | * Using curl to discover the API resources (05:15 mins) 7 | * Understanding namespaces (06:42 mins) 8 | * Defining quotas (04:01 mins) 9 | 1. https://cloud.digitalocean.com 10 | 11 | ## Notes 12 | 13 | 1. ... 14 | -------------------------------------------------------------------------------- /007.md: -------------------------------------------------------------------------------- 1 | # Day 7 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | 1. Creating Pod Manifest 7 | 8 | ## Notes 9 | 10 | * **application catalog** = catalog of cloud applications and development runtimes (ala DC/OS' Universe) 11 | * deployment templates using AWS Cloud Formation, Azure ARM, Hashicorp Terraform 12 | * Cloud providers: Amazon AWS, Google Cloud Platform (GCP), VMware vCloud, Microsoft Azure 13 | * [kubectl proxy](./kubectl.md) 14 | * Using `curl` or [httpie](https://httpie.org/) for HTTP REST APIs 15 | * Found `/Users/jacek/.kube/config` 16 | -------------------------------------------------------------------------------- /spark.md: -------------------------------------------------------------------------------- 1 | # Spark on Kubernetes 2 | 3 | * Running Spark in the Cloud with dynamic and fast moving cloud infrastructure 4 | * Kubernetes is the enterprise standard orchestration framework designed primarily for the cloud 5 | * Running Spark in containers 6 | * Started as a Kubernetes issue [Support Spark natively in Kubernetes](https://github.com/kubernetes/kubernetes/issues/34377) and moved to Apache Spark's [SPARK-18278 SPIP: Support native submission of spark jobs to a kubernetes cluster](https://issues.apache.org/jira/browse/SPARK-18278) 7 | * one generic K8S RM for all applications (aware of the overall cluster state and infrastructure) while Spark is addressing resource needs by accessing the K8S API, through a plugin developed by the Spark on K8S project. 8 | 9 | ## Articles 10 | 11 | 1. [Introduction to Spark on Kubernetes](https://banzaicloud.github.io/blog/spark-k8s/) 12 | -------------------------------------------------------------------------------- /todo.md: -------------------------------------------------------------------------------- 1 | # Tasks / TODO 2 | 3 | The list of tasks to do (should rather be in Issues at GitHub, _shouldn't it_). 4 | 5 | 1. Review the issues for Spark on Kubernetes 6 | * https://github.com/kubernetes/kubernetes/issues/34377 7 | * https://issues.apache.org/jira/browse/SPARK-18278 8 | 1. https://cloud.google.com/kubernetes-engine/docs/quickstart#deploying_an_application_to_the_cluster 9 | 1. https://cloud.google.com/sdk/gcloud/ 10 | 1. https://cloud.google.com/shell/docs/ 11 | 1. [Google Kubernetes Engine Documentation](https://cloud.google.com/kubernetes-engine/docs/) 12 | 1. https://console.cloud.google.com/ 13 | 1. Execute the Basic Commands (Beginner) of kubectl 14 | 1. https://www.reddit.com/r/kubernetes/ 15 | 1. https://stackoverflow.com/questions/tagged/kubernetes?sort=votes&pageSize=50&mixed=1 16 | 1. https://github.com/GoogleCloudPlatform/freshpod 17 | 1. [k8sPort](http://k8sport.org/) 18 | 1. How to manage `/Users/jacek/.kube/config`? 19 | -------------------------------------------------------------------------------- /003.md: -------------------------------------------------------------------------------- 1 | # Day 3 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | 1. Setting up Kubernetes on Google Cloud Platform 7 | 1. Execute the Basic Commands (Beginner) of kubectl 8 | 1. https://www.reddit.com/r/kubernetes/ 9 | 1. https://stackoverflow.com/questions/tagged/kubernetes?sort=votes&pageSize=50&mixed=1 10 | 1. https://github.com/GoogleCloudPlatform/freshpod 11 | 12 | ## Notes 13 | 14 | ### minikube 15 | 16 | minikube — 17 | 18 | ### kubectl — Kubernetes CLI 19 | 20 | **kubectl** controls the Kubernetes cluster manager 21 | 22 | ``` 23 | Basic Commands (Beginner): 24 | create Create a resource from a file or from stdin. 25 | expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes Service 26 | run Run a particular image on the cluster 27 | set Set specific features on objects 28 | ``` 29 | 30 | ### Pod 31 | 32 | 1. https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/ 33 | 34 | * Pod — the smallest deployable object in the Kubernetes object model 35 | * What are the other deployable objects? 36 | * What’s the Kubernetes object model? 37 | * the basic building block of Kubernetes 38 | * represents a running process on your cluster 39 | -------------------------------------------------------------------------------- /dcos.md: -------------------------------------------------------------------------------- 1 | # Kubernetes on DC/OS 2 | 3 | [Announcing: Kubernetes on DC/OS](https://mesosphere.com/blog/kubernetes-dcos/) 4 | * September 6th, 2017 5 | * beta availability of Kubernetes on DC/OS 6 | * initial release of Kubernetes on DC/OS 7 | * making DC/OS the best place to run K8s 8 | * Kubernetes is a **container orchestration tool** 9 | * Delivering a public cloud-like **Containers-as-a-Service** 10 | * Kubernetes on DC/OS is the 100% pure, official distribution 11 | * Running the pure mainline Kubernetes distribution 12 | * The Kubernetes community mainline distribution to DC/OS 13 | * Always have the latest version of Kubernetes available through DC/OS. 14 | * public cloud providers' container engines VS within our customers' data centers or across hybrid cloud 15 | * Running multiple Kubernetes clusters (of different versions) alongside each other 16 | * Deployed from the Universe and can be scaled up elastically to add capacity 17 | * Kubernetes on DC/OS will eventually support burst of stateless workloads to the cloud to add capacity to an on-premise deployment 18 | * hybrid cloud for containerized applications 19 | * a single platform and control plane, turning an elastically scalable collection of public cloud and datacenter resources into one logical computer 20 | * Controling where workloads run and where data resides 21 | -------------------------------------------------------------------------------- /005.md: -------------------------------------------------------------------------------- 1 | # Day 5 — Spark on Kubernetes and Kubernetes 1.9.3 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | 1. Upgrade to Kubernetes 1.9.3 7 | 1. Reading about [Spark on Kubernetes](./spark.md) 8 | 9 | ## Notes 10 | 11 | ### Kubernetes 1.9.3 12 | 13 | * [kubernetes-announce](https://groups.google.com/forum/#!topic/kubernetes-announce/62BycIRFoSE) has been built and pushed. 14 | 15 | * [Changelog](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG-1.9.md#v193) 16 | 17 | Upgrade to [Kubernetes CLI 1.9.3](http://formulae.brew.sh/formula/kubernetes-cli) (using brew) 18 | 19 | ``` 20 | $ brew update 21 | 22 | $ brew upgrade 23 | ==> Upgrading 1 outdated packages, with result: 24 | kubernetes-cli 1.9.3 25 | 26 | // Note that the Server Version is GKE (from the previous days) 27 | $ kubectl version 28 | Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-09T21:51:54Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"darwin/amd64"} 29 | Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.2-gke.1", GitCommit:"4ce7af72d8d343ea2f7680348852db641ff573af", GitTreeState:"clean", BuildDate:"2018-01-31T22:30:55Z", GoVersion:"go1.9.2b4", Compiler:"gc", Platform:"linux/amd64"} 30 | ``` 31 | -------------------------------------------------------------------------------- /001.md: -------------------------------------------------------------------------------- 1 | # Agenda 2 | 3 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 4 | 5 | 1. https://channel9.msdn.com/Shows/Azure-Friday/Container-Orchestration-Simplified-with-Managed-Kubernetes-in-Azure-Container-Service-AKS 6 | 7 | 1. https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes 8 | * Azure Container Service (AKS) 9 | * A managed Kubernetes on Azure 10 | * access and manage your cluster through "az aks" and "kubectl" 11 | * an Azure-hosted control plane, automated upgrades, self-healing, easy scaling, and a simple user experience 12 | * a fully managed Kubernetes container orchestration service or choose other orchestrators 13 | * deployment, management, and operations of Kubernetes 14 | * a container hosting environment 15 | * create, configure, and manage a cluster of virtual machines that are preconfigured to run containerized applications 16 | * deploy and manage container-based applications on Microsoft Azure 17 | * Kubernetes and the Docker image format 18 | * Creating a Kubernetes cluster using Azure Container Service (AKS) 19 | * expose the standard Kubernetes API endpoints 20 | * AKS reduces the complexity and operational overhead of managing a Kubernetes cluster by offloading much of that responsibility to Azure 21 | * a hosted Kubernetes service 22 | * Automated Kubernetes version upgrades and patching 23 | * Easy cluster scaling 24 | * Self-healing hosted control plane (masters) 25 | * Cost savings - pay only for running agent pool nodes 26 | * AKS does not provide direct access (such as with SSH) to the cluster 27 | -------------------------------------------------------------------------------- /002.md: -------------------------------------------------------------------------------- 1 | - container-based applications that span multi- and hybrid cloud environments, including physical, virtual, private cloud and public cloud platforms 2 | 3 | - CoreOS Inc. also offers the Quay container registry, a Kubernetes distribution known as Tectonic and maintains the etcd key-value store that is core to the operation of the Kubernetes open source container orchestration software. 4 | 5 | - a tiny Linux = Alpine Linux 6 | 7 | - Kube masters (VMs running kube-apiserver) https://kubernetes.io/docs/reference/generated/kube-apiserver/ 8 | 9 | - kube-apiservers were reading more than 500MB/s from etcd 10 | 11 | - We set up Prometheus to monitor the apiservers, and also set the --audit-log-path and --audit-log-maxbackup flags to enabled more logging on the apiserver. 12 | etcd cluster = the central store of state for the Kube masters. 13 | 14 | - We colocate the kube-apiserver, kube-controller-manager, and kube-scheduler processes on the same machines. For high availability, we always have at least 2 masters, and set the --apiserver-count flag to the number of apiservers we’re running (otherwise Prometheus monitoring can get confused between instances). 15 | 16 | - Our last Docker pull issue was due to the Google Container Registry. By default, kubelet pulls a special image from gcr.io (controlled by the --pod-infra-container-image flag) which is used when starting any new container. If that pull fails for any reason, like exceeding your quota, that node won’t be able to launch any containers. Because our nodes go through a NAT to reach gcr.io rather than having their own public IP, it’s quite likely that we’ll hit this per-IP quota limit. To fix this, we simply preloaded that Docker image in the machine image for our Kubernetes workers by using docker image save -o /opt/preloaded_docker_images.tar and docker image load -i /opt/preloaded_docker_images.tar. 17 | 18 | - Kubernetes Architecture 19 | 20 | * Head Node = the brain 21 | * API server 22 | * Scheduler 23 | * Controller manager 24 | * Etcd 25 | * kubelet / docker 26 | * Worker node 27 | * kubelet = Kubernetes agent 28 | * talks to local Docker daemon and API server 29 | * kube-proxy 30 | * docker 31 | 32 | --- 33 | 34 | Created on Jan 30th, 2018 in Evernote 35 | -------------------------------------------------------------------------------- /008.md: -------------------------------------------------------------------------------- 1 | # Day 8 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | * Using curl to discover the API resources (05:15 mins) 7 | * Understanding namespaces (06:42 mins) 8 | * Defining quotas (04:01 mins) 9 | 1. [Using httpie and jq](#using-httpie-and-jq) 10 | 11 | ## Notes 12 | 13 | ### Using httpie and jq 14 | 15 | Using [httpie](https://httpie.org/) and [jq](https://stedolan.github.io/jq/) work with Kubernetes REST API 16 | 17 | ``` 18 | $ minikube version 19 | minikube version: v0.25.0 20 | 21 | $ minikube start 22 | 23 | // Start proxy to "get authorized" 24 | $ kubectl proxy 25 | Starting to serve on 127.0.0.1:8001 26 | 27 | // List the namespaces 28 | $ http localhost:8001/api/v1/namespaces | jq -r '.items[].metadata.name' 29 | default 30 | kube-public 31 | kube-system 32 | 33 | // -v=9 to debug the connection 34 | // and learn the Request Body and the URL 35 | $ kubectl -v=9 create ns jacek 36 | ... 37 | Request Body: {"kind":"Namespace","apiVersion":"v1","metadata":{"name":"jacek","creationTimestamp":null},"spec":{},"status":{}} 38 | ... 39 | curl -k -v -XPOST -H "Content-Type: application/json" -H "User-Agent: kubectl/v1.9.3 (darwin/amd64) kubernetes/d283541" -H "Accept: application/json, */*" https://192.168.99.100:8443/api/v1/namespaces 40 | ... 41 | Response Body: {"kind":"Namespace","apiVersion":"v1","metadata":{"name":"jacek","selfLink":"/api/v1/namespaces/jacek","uid":"3c998908-128f-11e8-a9dd-080027beab3f","resourceVersion":"133410","creationTimestamp":"2018-02-15T20:31:44Z"},"spec":{"finalizers":["kubernetes"]},"status":{"phase":"Active"}} 42 | namespace "jacek" created 43 | 44 | // Let's simulate kubectl create ns sandbox 45 | // Create a JSON file 46 | // Find it as namespace-sandbox.json 47 | // BEGIN 48 | { 49 | "kind": "Namespace", 50 | "apiVersion": "v1", 51 | "metadata": { 52 | "name": "sandbox" 53 | } 54 | } 55 | // END 56 | 57 | $ http POST localhost:8001/api/v1/namespaces @namespace-sandbox.json 58 | HTTP/1.1 201 Created 59 | Content-Length: 289 60 | Content-Type: application/json 61 | Date: Thu, 15 Feb 2018 20:39:26 GMT 62 | ... 63 | 64 | $ kubectl get ns 65 | NAME STATUS AGE 66 | default Active 23d 67 | jacek Active 8m 68 | kube-public Active 23d 69 | kube-system Active 23d 70 | sandbox Active 38s 71 | 72 | $ minikube stop 73 | ``` 74 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes in 100 Days 2 | 3 | Notes from the 100 days with [Kubernetes](https://kubernetes.io/) — a container orchestration platform (for [Apache Spark](https://spark.apache.org/) and [Apache Kafka](https://kafka.apache.org/)). 4 | 5 | * [Kubernetes on DC/OS](./dcos.md) 6 | * [Spark on Kubernetes](./spark.md) 7 | * [Google Kubernetes Engine](./gke.md) 8 | * [Minikube — Single-Node Local Kubernetes Cluster](./minikube.md) 9 | * [kubectl — Kubernetes Command-Line Interface](./kubectl.md) 10 | * [kubeadm](./kubeadm.md) 11 | * [Kubernetes Native Applications](./k8s-native-app.md) 12 | * [Tasks / TODO](./todo.md) 13 | 14 | ## Daily Notes 15 | 16 | * [Day 9](./009.md) 17 | * [Day 8](./008.md) 18 | * [Day 7](./007.md) 19 | * [Day 6 — Kubernetes on DC/OS](./006.md) 20 | * [Day 5 — Spark on Kubernetes and Kubernetes 1.9.3](./005.md) 21 | * [Day 4 — Google Kubernetes Engine](./004.md) 22 | * [Day 3](./003.md) 23 | * [Day 2](./002.md) 24 | * [Day 1](./001.md) 25 | 26 | ## The Goal 27 | 28 | I've long been thinking about what is _my way of learning_ in a more effective way. I found taking notes in public (mainly on [gitbook](https://www.gitbook.com/@jaceklaskowski)) very effective to keep the learning pace, and wanted to explore other tools. 29 | 30 | Due to the following events I have finally been convinced that it's time to spend some time with Kubernetes. 31 | 32 | 1. [Apache Spark began supporting Kubernetes](https://issues.apache.org/jira/browse/SPARK-18278) (aka _Spark on Kubernetes_) 33 | 34 | 1. [Kubernetes in Action](https://www.manning.com/books/kubernetes-in-action) book was published and soon arrived as a printed book 35 | 36 | 1. [DC/OS announced support for Kubernetes](https://mesosphere.com/blog/kubernetes-dcos/) 37 | 38 | 1. [Apache Kafka](https://kafka.apache.org/) requires Zookeeper and one or more Kafka brokers (that begs for Docker Compose at the very least) 39 | 40 | 1. Docker announced support for Kubernetes ([Docker for Mac ](https://blog.docker.com/2018/01/docker-mac-kubernetes/) and [Docker Enterprise Edition](https://blog.docker.com/2018/01/docker-ee-kubernetes/)) 41 | 42 | 1. More and more projects I've been involved in (with Spark and Kafka) required some kind of container orchestration and mentioned Kubernetes 43 | 44 | On Jan 30th, 2018 I thought it'd be a very good time to make it happen and started taking notes in Evernote (locally on my laptop) to see where it'd lead me to. I put a daily task with priority 2 in Todoist right then. 45 | 46 | On Feb 7th, 2018, after 4 days of exploring Kubernetes (mainly reading articles, the book and toying with minikube), I thought about publishing the notes on GitHub so it is easier to collaborate with others. 47 | 48 | _And that's how the story began._ 49 | -------------------------------------------------------------------------------- /004.md: -------------------------------------------------------------------------------- 1 | # Day 4 — Google Kubernetes Engine 2 | 3 | ## Agenda 4 | 5 | 1. https://www.safaribooksonline.com/library/view/kubernetes-fundamentals/9781492032144/ 6 | 1. [Kubernetes Engine Quickstart](https://cloud.google.com/kubernetes-engine/docs/quickstart) 7 | 1. Setting up Kubernetes on Google Cloud Platform 8 | 1. Upgrading Kubernetes cluster to the most recent version 9 | * Upgrade Available link in Kubernetes clusters panel 10 | 11 | ## TODO 12 | 13 | 1. https://cloud.google.com/kubernetes-engine/docs/quickstart#deploying_an_application_to_the_cluster 14 | 1. https://cloud.google.com/sdk/gcloud/ 15 | 1. https://cloud.google.com/shell/docs/ 16 | 1. [Google Kubernetes Engine Documentation](https://cloud.google.com/kubernetes-engine/docs/) 17 | 1. https://console.cloud.google.com/ 18 | 1. Execute the Basic Commands (Beginner) of kubectl 19 | 1. https://www.reddit.com/r/kubernetes/ 20 | 1. https://stackoverflow.com/questions/tagged/kubernetes?sort=votes&pageSize=50&mixed=1 21 | 1. https://github.com/GoogleCloudPlatform/freshpod 22 | 23 | ## Notes 24 | 25 | ### Kubernetes Engine Quickstart 26 | 27 | [Kubernetes Engine Quickstart](https://cloud.google.com/kubernetes-engine/docs/quickstart) 28 | 29 | * Google Cloud Shell is a shell environment for managing resources hosted on Google Cloud Platform (GCP) 30 | * Cloud Shell comes preinstalled with the gcloud and kubectl command-line tools. 31 | * gcloud provides the primary command-line interface for GCP, and kubectl provides the command-line interface for running commands against Kubernetes clusters. 32 | 33 | ### Google Cloud SDK 34 | 35 | * `gcloud config list` 36 | * `gcloud config get-value project` 37 | * `gcloud config set project` 38 | * `gcloud compute zones list` 39 | * `gcloud config set compute/zone europe-west3-a` 40 | 41 | ### Creating a Kubernetes Engine cluster using gcloud 42 | 43 | * A cluster consists of at least one cluster master machine and multiple worker machines called nodes. Nodes are Compute Engine virtual machine (VM) instances that run the Kubernetes processes necessary to make them part of the cluster. You deploy applications to clusters, and the applications run on the nodes. 44 | * Enable Google Kubernetes Engine API 45 | * `gcloud container clusters create hello-k8s` 46 | * Automatically configures `kubectl` to use the cluster 47 | * `gcloud container clusters list` 48 | * `kubectl get nodes` 49 | * `gcloud container clusters upgrade` 50 | * `gcloud container clusters resize hello-k8s --size=0` 51 | 52 | ### Install Google Cloud SDK 53 | 54 | [Install the Google Cloud SDK](https://cloud.google.com/sdk/docs/quickstart-macos) (with `gcloud` command-line tool) 55 | 56 | ``` 57 | $ python -V 58 | Python 2.7.10 59 | 60 | $ brew cask install google-cloud-sdk 61 | ... 62 | ==> Running installer script 'google-cloud-sdk/install.sh' 63 | ==> Welcome to the Google Cloud SDK! 64 | ==> 65 | ==> 66 | ==> Your current Cloud SDK version is: 188.0.1 67 | ==> Installing components from version: 188.0.1 68 | ==> 69 | ==> +----------------------------------------------------------------------------+ 70 | ==> | These components will be installed. | 71 | ==> +-----------------------------------------------------+------------+---------+ 72 | ==> | Name | Version | Size | 73 | ==> +-----------------------------------------------------+------------+---------+ 74 | ==> | BigQuery Command Line Tool | 2.0.28 | < 1 MiB | 75 | ==> | BigQuery Command Line Tool (Platform Specific) | 2.0.26 | < 1 MiB | 76 | ==> | Cloud SDK Core Libraries (Platform Specific) | 2017.09.15 | < 1 MiB | 77 | ==> | Cloud Storage Command Line Tool | 4.28 | 3.3 MiB | 78 | ==> | Cloud Storage Command Line Tool (Platform Specific) | 4.27 | < 1 MiB | 79 | ==> | Default set of gcloud commands | | | 80 | ==> | gcloud cli dependencies | 2017.10.20 | 1.4 MiB | 81 | ==> +-----------------------------------------------------+------------+---------+ 82 | ==> 83 | ==> For the latest full release notes, please visit: 84 | ==> https://cloud.google.com/sdk/release_notes 85 | ... 86 | ==> This will install all the core command line tools necessary for working with 87 | ==> the Google Cloud Platform. 88 | ==> 89 | ==> Update done! 90 | ==> 91 | ==> ==> Source [/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc] in your profile to enable shell command completion for gcloud. 92 | ==> ==> Source [/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc] in your profile to add the Google Cloud SDK command line tools to your $PATH. 93 | ==> 94 | ==> For more information on how to get started, please visit: 95 | ==> https://cloud.google.com/sdk/docs/quickstarts 96 | ==> 97 | ==> 98 | ==> Linking Binary 'bq' to '/usr/local/bin/bq'. 99 | ==> Linking Binary 'gcloud' to '/usr/local/bin/gcloud'. 100 | ==> Linking Binary 'git-credential-gcloud.sh' to '/usr/local/bin/git-credential-gcloud'. 101 | ==> Linking Binary 'gsutil' to '/usr/local/bin/gsutil'. 102 | 🍺 google-cloud-sdk was successfully installed! 103 | 104 | $ which gcloud 105 | /usr/local/bin/gcloud 106 | 107 | $ gcloud init 108 | Welcome! This command will take you through the configuration of gcloud. 109 | 110 | Your current configuration has been set to: [default] 111 | 112 | You can skip diagnostics next time by using the following flag: 113 | gcloud init --skip-diagnostics 114 | 115 | Network diagnostic detects and fixes local network connection issues. 116 | Checking network connection...done. 117 | Reachability Check passed. 118 | Network diagnostic (1/1 checks) passed. 119 | 120 | You must log in to continue. Would you like to log in (Y/n)? Y 121 | 122 | // In the browser 123 | You are now authenticated with the Google Cloud SDK! 124 | 125 | $ gcloud info 126 | 127 | $ gcloud projects create japila-k8s 128 | Create in progress for [https://cloudresourcemanager.googleapis.com/v1/projects/japila-k8s]. 129 | Waiting for [operations/pc.7497766497240024269] to finish...done. 130 | 131 | $ gcloud projects list 132 | PROJECT_ID NAME PROJECT_NUMBER 133 | japila-k8s japila-k8s 568266906839 134 | ``` 135 | -------------------------------------------------------------------------------- /kubectl.md: -------------------------------------------------------------------------------- 1 | # kubectl — Kubernetes Command-Line Interface 2 | 3 | `kubectl` is the command-line interface for [Kubernetes](https://kubernetes.io/). 4 | 5 | ``` 6 | $ kubectl get pod 7 | No resources found. 8 | ``` 9 | 10 | ## Configuration 11 | 12 | ``` 13 | $ kubectl -v=9 get pod 14 | Config loaded from file /Users/jacek/.kube/config 15 | ``` 16 | 17 | ## kubectl proxy 18 | 19 | ``` 20 | $ kubectl proxy 21 | Starting to serve on 127.0.0.1:8001 22 | 23 | $ http localhost:8001 24 | HTTP/1.1 200 OK 25 | Audit-Id: 0f57dd2e-2c00-4144-8ab8-dfb293855b5f 26 | Content-Length: 2327 27 | Content-Type: application/json 28 | Date: Tue, 13 Feb 2018 19:50:36 GMT 29 | 30 | { 31 | "paths": [ 32 | "/api", 33 | "/api/v1", 34 | "/apis", 35 | "/apis/", 36 | "/apis/admissionregistration.k8s.io", 37 | "/apis/admissionregistration.k8s.io/v1beta1", 38 | "/apis/apiextensions.k8s.io", 39 | "/apis/apiextensions.k8s.io/v1beta1", 40 | "/apis/apiregistration.k8s.io", 41 | "/apis/apiregistration.k8s.io/v1beta1", 42 | "/apis/apps", 43 | "/apis/apps/v1", 44 | "/apis/apps/v1beta1", 45 | "/apis/apps/v1beta2", 46 | "/apis/authentication.k8s.io", 47 | "/apis/authentication.k8s.io/v1", 48 | "/apis/authentication.k8s.io/v1beta1", 49 | "/apis/authorization.k8s.io", 50 | "/apis/authorization.k8s.io/v1", 51 | "/apis/authorization.k8s.io/v1beta1", 52 | "/apis/autoscaling", 53 | "/apis/autoscaling/v1", 54 | "/apis/autoscaling/v2beta1", 55 | "/apis/batch", 56 | "/apis/batch/v1", 57 | "/apis/batch/v1beta1", 58 | "/apis/certificates.k8s.io", 59 | "/apis/certificates.k8s.io/v1beta1", 60 | "/apis/extensions", 61 | "/apis/extensions/v1beta1", 62 | "/apis/metrics.k8s.io", 63 | "/apis/networking.k8s.io", 64 | "/apis/networking.k8s.io/v1", 65 | "/apis/policy", 66 | "/apis/policy/v1beta1", 67 | "/apis/rbac.authorization.k8s.io", 68 | "/apis/rbac.authorization.k8s.io/v1", 69 | "/apis/rbac.authorization.k8s.io/v1beta1", 70 | "/apis/storage.k8s.io", 71 | "/apis/storage.k8s.io/v1", 72 | "/apis/storage.k8s.io/v1beta1", 73 | "/healthz", 74 | "/healthz/SSH Tunnel Check", 75 | "/healthz/autoregister-completion", 76 | "/healthz/etcd", 77 | "/healthz/ping", 78 | "/healthz/poststarthook/apiservice-openapi-controller", 79 | "/healthz/poststarthook/apiservice-registration-controller", 80 | "/healthz/poststarthook/apiservice-status-available-controller", 81 | "/healthz/poststarthook/bootstrap-controller", 82 | "/healthz/poststarthook/ca-registration", 83 | "/healthz/poststarthook/generic-apiserver-start-informers", 84 | "/healthz/poststarthook/kube-apiserver-autoregistration", 85 | "/healthz/poststarthook/rbac/bootstrap-roles", 86 | "/healthz/poststarthook/start-apiextensions-controllers", 87 | "/healthz/poststarthook/start-apiextensions-informers", 88 | "/healthz/poststarthook/start-kube-aggregator-informers", 89 | "/healthz/poststarthook/start-kube-apiserver-informers", 90 | "/logs", 91 | "/metrics", 92 | "/swagger-2.0.0.json", 93 | "/swagger-2.0.0.pb-v1", 94 | "/swagger-2.0.0.pb-v1.gz", 95 | "/swagger.json", 96 | "/swaggerapi", 97 | "/ui", 98 | "/ui/", 99 | "/version" 100 | ] 101 | } 102 | 103 | $ http localhost:8001/version 104 | HTTP/1.1 200 OK 105 | Content-Length: 269 106 | Content-Type: application/json 107 | Date: Tue, 13 Feb 2018 19:51:10 GMT 108 | 109 | { 110 | "buildDate": "2018-01-31T22:30:55Z", 111 | "compiler": "gc", 112 | "gitCommit": "4ce7af72d8d343ea2f7680348852db641ff573af", 113 | "gitTreeState": "clean", 114 | "gitVersion": "v1.9.2-gke.1", 115 | "goVersion": "go1.9.2b4", 116 | "major": "1", 117 | "minor": "9+", 118 | "platform": "linux/amd64" 119 | } 120 | 121 | $ kubectl -v=9 version 122 | I0213 20:51:43.283357 44432 loader.go:357] Config loaded from file /Users/jacek/.kube/config 123 | I0213 20:51:43.285771 44432 round_trippers.go:417] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.9.3 (darwin/amd64) kubernetes/d283541" https://35.198.170.58/version 124 | I0213 20:51:43.431557 44432 round_trippers.go:436] GET https://35.198.170.58/version 200 OK in 145 milliseconds 125 | I0213 20:51:43.431586 44432 round_trippers.go:442] Response Headers: 126 | I0213 20:51:43.431594 44432 round_trippers.go:445] Content-Type: application/json 127 | I0213 20:51:43.431600 44432 round_trippers.go:445] Content-Length: 269 128 | I0213 20:51:43.431607 44432 round_trippers.go:445] Date: Tue, 13 Feb 2018 19:51:43 GMT 129 | I0213 20:51:43.434173 44432 request.go:873] Response Body: { 130 | "major": "1", 131 | "minor": "9+", 132 | "gitVersion": "v1.9.2-gke.1", 133 | "gitCommit": "4ce7af72d8d343ea2f7680348852db641ff573af", 134 | "gitTreeState": "clean", 135 | "buildDate": "2018-01-31T22:30:55Z", 136 | "goVersion": "go1.9.2b4", 137 | "compiler": "gc", 138 | "platform": "linux/amd64" 139 | } 140 | Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.3", GitCommit:"d2835416544f298c919e2ead3be3d0864b52323b", GitTreeState:"clean", BuildDate:"2018-02-09T21:51:54Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"darwin/amd64"} 141 | Server Version: version.Info{Major:"1", Minor:"9+", GitVersion:"v1.9.2-gke.1", GitCommit:"4ce7af72d8d343ea2f7680348852db641ff573af", GitTreeState:"clean", BuildDate:"2018-01-31T22:30:55Z", GoVersion:"go1.9.2b4", Compiler:"gc", Platform:"linux/amd64"} 142 | ``` 143 | 144 | ## Verbose Mode 145 | 146 | ``` 147 | $ kubectl -v=9 get pod 148 | I0210 22:29:50.514861 93045 loader.go:357] Config loaded from file /Users/jacek/.kube/config 149 | I0210 22:29:50.523648 93045 round_trippers.go:417] curl -k -v -XGET -H "Accept: application/json" -H "User-Agent: kubectl/v1.9.3 (darwin/amd64) kubernetes/d283541" https://35.198.170.58/api/v1/namespaces/default/pods?limit=500 150 | I0210 22:29:50.664355 93045 round_trippers.go:436] GET https://35.198.170.58/api/v1/namespaces/default/pods?limit=500 200 OK in 140 milliseconds 151 | I0210 22:29:50.664391 93045 round_trippers.go:442] Response Headers: 152 | I0210 22:29:50.664404 93045 round_trippers.go:445] Content-Length: 132 153 | I0210 22:29:50.664414 93045 round_trippers.go:445] Date: Sat, 10 Feb 2018 21:29:50 GMT 154 | I0210 22:29:50.664422 93045 round_trippers.go:445] Audit-Id: b85758a8-0869-48c1-ab6a-6ab1b14a5790 155 | I0210 22:29:50.664429 93045 round_trippers.go:445] Content-Type: application/json 156 | I0210 22:29:50.664481 93045 request.go:873] Response Body: {"kind":"PodList","apiVersion":"v1","metadata":{"selfLink":"/api/v1/namespaces/default/pods","resourceVersion":"88356"},"items":[]} 157 | No resources found. 158 | ``` 159 | 160 | ## Installation (macOS) 161 | 162 | [brew formula](http://formulae.brew.sh/formula/kubernetes-cli) 163 | 164 | ``` 165 | $ brew info kubernetes-cli 166 | kubernetes-cli: stable 1.9.3 (bottled), HEAD 167 | Kubernetes command-line interface 168 | https://kubernetes.io/ 169 | /usr/local/Cellar/kubernetes-cli/1.9.2 (172 files, 65.3MB) 170 | Poured from bottle on 2018-01-22 at 21:57:53 171 | /usr/local/Cellar/kubernetes-cli/1.9.3 (172 files, 65.4MB) * 172 | Poured from bottle on 2018-02-10 at 21:42:16 173 | From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/kubernetes-cli.rb 174 | ==> Dependencies 175 | Build: go ✔ 176 | ==> Options 177 | --HEAD 178 | Install HEAD version 179 | ==> Caveats 180 | Bash completion has been installed to: 181 | /usr/local/etc/bash_completion.d 182 | 183 | zsh completions have been installed to: 184 | /usr/local/share/zsh/site-functions 185 | ``` 186 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /minikube.md: -------------------------------------------------------------------------------- 1 | # Minikube — Single-Node Local Kubernetes Cluster 2 | 3 | **minikube** is a tool to set up a single-node Kubernetes cluster. 4 | 5 | * enough for exploring most topics 6 | 7 | Current version: Minikube [0.25.0](https://github.com/kubernetes/minikube/blob/v0.25.0/CHANGELOG.md#version-0250---1262018) with Kubernetes 1.9 8 | 9 | ## Update Check 10 | 11 | Use `minikube update-check` to print current and latest version number. 12 | 13 | ``` 14 | $ minikube update-check 15 | CurrentVersion: v0.25.0 16 | LatestVersion: v0.25.0 17 | ``` 18 | 19 | Use [Minikube Release Notes](https://github.com/kubernetes/minikube/blob/master/CHANGELOG.md) to know the latest version of minikube. 20 | 21 | ## Documentation 22 | 23 | 1. https://kubernetes.io/docs/getting-started-guides/minikube/ 24 | 25 | ## Running minikube on macOS 26 | 27 | ``` 28 | $ which minikube 29 | /usr/local/bin/minikube 30 | 31 | $ minikube version 32 | minikube version: v0.25.0 33 | 34 | $ minikube start 35 | Starting local Kubernetes v1.9.0 cluster... 36 | Starting VM... 37 | Getting VM IP address... 38 | Moving files into cluster... 39 | Downloading localkube binary 40 | 162.41 MB / 162.41 MB [============================================] 100.00% 0s 41 | 0 B / 65 B [----------------------------------------------------------] 0.00% 42 | 65 B / 65 B [======================================================] 100.00% 0sSetting up certs... 43 | Connecting to cluster... 44 | Setting up kubeconfig... 45 | Starting cluster components... 46 | Kubectl is now configured to use the cluster. 47 | Loading cached images from config file. 48 | 49 | $ minikube status 50 | minikube: Running 51 | cluster: Running 52 | kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100 53 | 54 | $ kubectl cluster-info 55 | Kubernetes master is running at https://192.168.99.100:8443 56 | 57 | To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. 58 | 59 | $ kubectl version 60 | Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.2", GitCommit:"5fa2db2bd46ac79e5e00a4e6ed24191080aa463b", GitTreeState:"clean", BuildDate:"2018-01-18T21:12:46Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"darwin/amd64"} 61 | Server Version: version.Info{Major:"", Minor:"", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2018-01-26T19:04:38Z", GoVersion:"go1.9.1", Compiler:"gc", Platform:"linux/amd64"} 62 | 63 | $ kubectl get nodes 64 | NAME STATUS ROLES AGE VERSION 65 | minikube Ready 15d v1.9.0 66 | 67 | $ kubectl describe node minikube 68 | Name: minikube 69 | Roles: 70 | Labels: beta.kubernetes.io/arch=amd64 71 | beta.kubernetes.io/os=linux 72 | kubernetes.io/hostname=minikube 73 | Annotations: alpha.kubernetes.io/provided-node-ip=192.168.99.100 74 | node.alpha.kubernetes.io/ttl=0 75 | volumes.kubernetes.io/controller-managed-attach-detach=true 76 | Taints: 77 | CreationTimestamp: Mon, 22 Jan 2018 22:09:48 +0100 78 | ... 79 | 80 | // Open http://192.168.99.100:30000 in the default browser 81 | $ minikube dashboard 82 | Opening kubernetes dashboard in default browser... 83 | 84 | $ eval $(minikube docker-env) 85 | 86 | $ docker ps 87 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 88 | 4f43c0e3addd fed89e8b4248 "/sidecar --v=2 --lo…" About an hour ago Up About an hour k8s_sidecar_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_3 89 | a59c7ed907b8 k8s.gcr.io/k8s-dns-kube-dns-amd64 "/kube-dns --domain=…" About an hour ago Up About an hour k8s_kubedns_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_3 90 | e4138d046670 459944ce8cc4 "/dnsmasq-nanny -v=2…" About an hour ago Up About an hour k8s_dnsmasq_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_3 91 | 03c7639e4a1b k8s.gcr.io/kubernetes-dashboard-amd64 "/dashboard --insecu…" About an hour ago Up About an hour k8s_kubernetes-dashboard_kubernetes-dashboard-77d8b98585-95z8f_kube-system_43425126-09ee-11e8-a4fb-080027beab3f_3 92 | f072c858c73d gcr.io/google-containers/kube-addon-manager "/opt/kube-addons.sh" About an hour ago Up About an hour k8s_kube-addon-manager_kube-addon-manager-minikube_kube-system_c4c3188325a93a2d7fb1714e1abf1259_3 93 | 033ca27a65c7 gcr.io/k8s-minikube/storage-provisioner "/storage-provisioner" About an hour ago Up About an hour k8s_storage-provisioner_storage-provisioner_kube-system_9854d9af-ffb8-11e7-bd26-080027beab3f_4 94 | b39b9a71a643 gcr.io/google_containers/pause-amd64:3.0 "/pause" About an hour ago Up About an hour k8s_POD_kubernetes-dashboard-77d8b98585-95z8f_kube-system_43425126-09ee-11e8-a4fb-080027beab3f_3 95 | 39ac50871bc7 gcr.io/google_containers/pause-amd64:3.0 "/pause" About an hour ago Up About an hour k8s_POD_storage-provisioner_kube-system_9854d9af-ffb8-11e7-bd26-080027beab3f_4 96 | 5c7f5b542eed gcr.io/google_containers/pause-amd64:3.0 "/pause" About an hour ago Up About an hour k8s_POD_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_3 97 | 622b981f6066 gcr.io/google_containers/pause-amd64:3.0 "/pause" About an hour ago Up About an hour k8s_POD_kube-addon-manager-minikube_kube-system_c4c3188325a93a2d7fb1714e1abf1259_3 98 | 99 | $ minikube stop 100 | Stopping local Kubernetes cluster... 101 | Machine stopped. 102 | ``` 103 | 104 | ## Inside minikube VM 105 | 106 | ``` 107 | $ minikube ssh 108 | _ _ 109 | _ _ ( ) ( ) 110 | ___ ___ (_) ___ (_)| |/') _ _ | |_ __ 111 | /' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\ 112 | | ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/ 113 | (_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____) 114 | 115 | $ uname -a 116 | Linux minikube 4.9.13 #1 SMP Thu Oct 19 17:14:00 UTC 2017 x86_64 GNU/Linux 117 | 118 | // Let’s look around and review the configuration (as if we were using the real Kubernetes head node) 119 | // systemctl status kubelet 120 | // /etc/systemd/system/kubelet.service.d/ 121 | $ systemctl status 122 | ● minikube 123 | State: running 124 | Jobs: 0 queued 125 | Failed: 0 units 126 | Since: Wed 2018-02-07 08:18:33 UTC; 46min ago 127 | CGroup: / 128 | ... 129 | 130 | $ systemctl status localkube 131 | ● localkube.service - Localkube 132 | Loaded: loaded (/etc/systemd/system/localkube.service; enabled; vendor preset: enabled) 133 | Active: active (running) since Wed 2018-02-07 08:18:58 UTC; 45min ago 134 | Docs: https://github.com/kubernetes/minikube/tree/master/pkg/localkube 135 | Main PID: 3200 (localkube) 136 | Tasks: 16 (limit: 4915) 137 | Memory: 387.5M 138 | CPU: 3min 18.720s 139 | CGroup: /system.slice/localkube.service 140 | └─3200 /usr/local/bin/localkube --dns-domain=cluster.local --node-ip=192.168.99.100 --generate-certs=false --logtostderr=true --enable-dns=false 141 | 142 | Feb 07 08:58:55 minikube localkube[3200]: store.index: compact 5229 143 | Feb 07 08:58:55 minikube localkube[3200]: finished scheduled compaction at 5229 (took 360.927µs) 144 | Feb 07 08:59:03 minikube localkube[3200]: E0207 08:59:03.130887 3200 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address 145 | Feb 07 09:00:03 minikube localkube[3200]: E0207 09:00:03.131343 3200 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address 146 | Feb 07 09:01:03 minikube localkube[3200]: E0207 09:01:03.131920 3200 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address 147 | Feb 07 09:02:03 minikube localkube[3200]: E0207 09:02:03.132321 3200 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address 148 | Feb 07 09:03:03 minikube localkube[3200]: E0207 09:03:03.133390 3200 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address 149 | Feb 07 09:03:55 minikube localkube[3200]: store.index: compact 5411 150 | Feb 07 09:03:55 minikube localkube[3200]: finished scheduled compaction at 5411 (took 508.142µs) 151 | Feb 07 09:04:03 minikube localkube[3200]: E0207 09:04:03.134138 3200 healthcheck.go:317] Failed to start node healthz on 0: listen tcp: address 0: missing port in address 152 | 153 | $ docker ps 154 | CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 155 | 57e7299e9762 fed89e8b4248 "/sidecar --v=2 --..." About a minute ago Up About a minute k8s_sidecar_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_4 156 | 00fb16c937ef k8s.gcr.io/k8s-dns-kube-dns-amd64 "/kube-dns --domai..." About a minute ago Up About a minute k8s_kubedns_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_4 157 | 23dc5d200f28 k8s.gcr.io/kubernetes-dashboard-amd64 "/dashboard --inse..." About a minute ago Up About a minute k8s_kubernetes-dashboard_kubernetes-dashboard-77d8b98585-95z8f_kube-system_43425126-09ee-11e8-a4fb-080027beab3f_4 158 | 308baba19572 459944ce8cc4 "/dnsmasq-nanny -v..." About a minute ago Up About a minute k8s_dnsmasq_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_4 159 | d5739b03dd46 gcr.io/google-containers/kube-addon-manager "/opt/kube-addons.sh" About a minute ago Up About a minute k8s_kube-addon-manager_kube-addon-manager-minikube_kube-system_c4c3188325a93a2d7fb1714e1abf1259_4 160 | db2ada38e57d gcr.io/google_containers/pause-amd64:3.0 "/pause" About a minute ago Up About a minute k8s_POD_kubernetes-dashboard-77d8b98585-95z8f_kube-system_43425126-09ee-11e8-a4fb-080027beab3f_4 161 | af0365a5313e gcr.io/k8s-minikube/storage-provisioner "/storage-provisioner" About a minute ago Up About a minute k8s_storage-provisioner_storage-provisioner_kube-system_9854d9af-ffb8-11e7-bd26-080027beab3f_5 162 | 7e2999a4df87 gcr.io/google_containers/pause-amd64:3.0 "/pause" About a minute ago Up About a minute k8s_POD_kube-dns-6777479f6b-5p6s2_kube-system_435953f7-09ee-11e8-a4fb-080027beab3f_4 163 | f2c3038f70e9 gcr.io/google_containers/pause-amd64:3.0 "/pause" About a minute ago Up About a minute k8s_POD_storage-provisioner_kube-system_9854d9af-ffb8-11e7-bd26-080027beab3f_5 164 | ada76588316e gcr.io/google_containers/pause-amd64:3.0 "/pause" About a minute ago Up About a minute k8s_POD_kube-addon-manager-minikube_kube-system_c4c3188325a93a2d7fb1714e1abf1259_4 165 | 166 | $ exit 167 | logout 168 | ``` 169 | 170 | ## Caching Docker Images 171 | 172 | ``` 173 | // https://github.com/kubernetes/minikube/pull/2272 174 | $ ./out/minikube cache add ubuntu:16.04 redis:3 175 | $ ./out/minikube cache list 176 | ``` 177 | 178 | ## Installing minikube on macOS 179 | 180 | Official docs: [Installing minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/) 181 | 182 | 1. Install a Hypervisor, e.g. VirtualBox 5.2.6 183 | 2. [brew install kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-with-homebrew-on-macos) 184 | 3. [brew cask install minikube](https://github.com/kubernetes/minikube/releases) 185 | 1. `brew cask reinstall minikube` to reinstall and **upgrade** minikube 186 | 1. https://github.com/kubernetes/minikube/blob/v0.25.0/README.md 187 | --------------------------------------------------------------------------------