-
Labels
Labels provide identifying metadata for objects. These are fundamental qualities of the object that will be used for grouping, viewing, and operating. If we want to list only Pods that have the ver label set to 2, we could use the –selector flag: In addition to enabling users to organize their infrastructure, labels play a critical role in linking various related Kubernetes…
-
Using Volumes with Pods
To add a volume to a Pod manifest, there are two new stanzas to add to our configuration. The first is a new spec.volumes section. This array defines all of the volumes that may be accessed by containers in the Pod manifest. It’s important to note that not all containers are required to mount all volumes defined…
-
Resource Management
Kubernetes allows users to specify two different resource metrics. Resource requests specify the minimum amount of a resource required to run the application. Resource limits specify the maximum amount of a resource that an application can consume. Requests are used when scheduling Pods to nodes. The Kubernetes scheduler will ensure that the sum of all requests of all Pods on a…
-
Cloud SQL Insights
Query Insights helps you detect, diagnose, and prevent query performance problems for Cloud SQL databases. It supports intuitive monitoring and provides diagnostic information that helps you go beyond detection to identify the root cause of performance problems.
-
Startup Probe
Startup probes have recently been introduced to Kubernetes as an alternative way of managing slow-starting containers. When a Pod is started, the startup probe is run before any other probing of the Pod is started. The startup probe proceeds until it either times out (in which case the Pod is restarted) or it succeeds, at which…
-
Readiness Probe
Of course, liveness isn’t the only kind of health check we want to perform. Kubernetes makes a distinction between liveness and readiness. Liveness determines if an application is running properly. Containers that fail liveness checks are restarted. Readiness describes when a container is ready to serve user requests. Containers that fail readiness checks are removed from service load balancers.…
-
Liveness Probe
Once the kuard process is up and running, we need a way to confirm that it is actually healthy and shouldn’t be restarted. Liveness probes are defined per container, which means each container inside a Pod is health checked separately. The preceding Pod manifest uses an httpGet probe to perform an HTTP GET request against the /healthy endpoint on port 8080 of the kuard container. The probe…
-
kubectl commands
print the IP address of the specified Pod: see the logs for a running container: use the exec command to execute a command in a running container: If you don’t have bash or some other terminal available within your container, you can always attach to the running process: You can also copy files to and from a container using the cp command: opens up…
-
Installing Kubernetes with GKE
Once you have gcloud installed, set a default zone: Then you can create a cluster: This will take a few minutes. When the cluster is ready, you can get credentials for the cluster using:
-
Transfers for Large Files
The previous recipe covered transfers with a large number of operations; this one is targeted at individual large files. Upload the file as several simultaneous chunks and observe transfer speed. If your previous upload saturated your link, you may not see a performance increase. You’ll notice we set the file size threshold that triggers parallel…