Kubernetes: Up & Running: Dive into the Future of Infrastructure
Rate it:
10%
Flag icon
In general, you want to order your layers from least likely to change to most likely to change in order to optimize the image size for pushing and pulling.
Mark Turner
Worth mentioning explicit in internal docs.
11%
Flag icon
We can’t think of anything more tedious than managing Docker images this way.
14%
Flag icon
Running Kubernetes on Raspberry Pi If you want to experiment with a realistic Kubernetes cluster but don’t want to pay a lot, a very nice Kubernetes cluster can be built on top of Raspberry Pi computers for a relatively small cost. The details of building such a cluster are out of scope for this chapter, but they are given in Appendix A at the end of this book.
14%
Flag icon
Checking Cluster Status The first thing you can do is check the version of the cluster that you are running: $ kubectl version
Mark Turner
Internal docs
14%
Flag icon
Note Don’t worry if these versions are different. The Kubernetes tools are backward- and forward-compatible with different versions of the Kubernetes API, so long as you stay within two minor versions of the tools and the cluster and don’t try to use newer features on an older cluster. Kubernetes follows the semantic versioning specification, and this minor version is the middle number (e.g., the 5 in 1.5.2).
Mark Turner
Internal doc
14%
Flag icon
kubectl get componentstatuses
Mark Turner
todo
16%
Flag icon
Kubernetes Proxy
16%
Flag icon
Kubernetes DNS
16%
Flag icon
Kubernetes UI
19%
Flag icon
kubectl cp
Mark Turner
Todo
20%
Flag icon
declarative configuration. Declarative configuration means that you write down the desired state of the world in a configuration and then submit that configuration to a service that takes actions to ensure the desired state becomes the actual state.
20%
Flag icon
Declarative configuration is different from imperative configuration, where you simply take a series of actions (e.g., apt-get install foo) to modify the world. Years of production experience have taught us that maintaining a written record of the system’s desired state leads to a more manageable, reliable system. Declarative configuration enables numerous advantages, including code review for configurations as well as documenting the current state of the world for distributed teams. Additionally, it is the basis for all of the self-healing behaviors in Kubernetes that keep applications ...more
23%
Flag icon
When you run: $ kubectl port-forward kuard 8080:8080 a secure tunnel is created from your local machine, through the Kubernetes master, to the instance of the Pod running on one of the worker nodes. As long as the port-forward command is still running, you can access the Pod (in this case the kuard web interface) on http://localhost:8080.
27%
Flag icon
Mounting the host filesystem Other applications don’t actually need a persistent volume, but they do need some access to the underlying host filesystem. For example, they may need access to the /dev filesystem in order to perform raw block-level access to a device on the system. For these cases, Kubernetes supports the hostDir volume, which can mount arbitrary locations on the worker node into the container. The previous example uses the hostDir volume type. The volume created is /var/lib/kuard on the host.
29%
Flag icon
Labels have simple syntax. They are key/value pairs where both the key and value are represented by strings. Label keys can be broken down into two parts: an optional prefix and a name, separated by a slash. The prefix, if specified, must be a DNS subdomain with a 253-character limit. The key name is required and must be shorter than 63 characters. Names must also start and end with an alphanumeric character and permit the use of dashes (-), underscores (_), and dots (.) between characters. Label values are strings with a maximum length of 63 characters. The contents of the label values follow ...more
31%
Flag icon
Extend data about the last tool to update the resource and how it was updated (used for detecting changes by other tools and doing a smart merge).
Mark Turner
Todo
31%
Flag icon
Provide extra data to enhance the visual quality or usability of a UI. For example, objects could include a link to an icon (or a base64-encoded version of an icon).
32%
Flag icon
Users should avoid using the Kubernetes API server as a general-purpose database. Annotations are good for small bits of data that are highly associated with a specific resource. If you want to store data in Kubernetes but you don’t have an obvious object to associate it with, consider storing that data in some other, more appropriate database.
32%
Flag icon
Labels are used to identify and optionally group objects in a Kubernetes cluster. Labels are also used in selector queries to provide flexible runtime grouping of objects such as pods. Annotations provide object-scoped key/value storage of metadata that can be used by automation tooling and client libraries. Annotations can also be used to hold configuration data for external tools such as third-party schedulers and monitoring tools. Labels and annotations are key to understanding how key components in a Kubernetes cluster work together to ensure the desired cluster state. Using labels and ...more
38%
Flag icon
In addition, using just environment variables seems strange to many users.
38%
Flag icon
The actual act of managing the replicated Pods is an example of a reconciliation loop. Such loops are fundamental to most of the design and implementation of Kubernetes. Reconciliation Loops
39%
Flag icon
It is an inherently goal-driven, self-healing system, yet it can often be easily expressed in a few lines of code.
39%
Flag icon
This notion of “coming in the front door” is another central design concept in Kubernetes.
39%
Flag icon
Adopting Existing Containers
39%
Flag icon
Quarantining Containers
41%
Flag icon
Finding a ReplicaSet from a Pod
41%
Flag icon
Note that such annotations are best-effort; they are only created when the Pod is created by the ReplicaSet, and can be removed by a Kubernetes user at any time.
41%
Flag icon
Hopefully, this illustrates the need to ensure that any imperative changes are immediately followed by a declarative change in source control. Indeed, if the need is not acute, we generally recommend only making declarative changes as described in the following section.