2 min read
The /etc/hosts file is a Kubernetes-managed file so we cannot add entries freely to it. If we want to add entries to it we will have to use the hostAliases field in the Pod's spec.
$ kubectl exec -it demo-pod -- cat /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters
10.103.198.74 demo-pod
11/05/2021
Read more...3 min read
On a AWS EKS cluster, at the time of this writing, by default you cannot resize volumes provisioned with the default gp2 StorageClass. This is because on the default StorageClass the allowVolumeExpansion is set to false, preventing the volume expansion:
$ kubectl get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
gp2 (default) kubernetes.io/aws-ebs Delete WaitForFirstConsumer false 78d
10/05/2021
Read more...1 min read
To be able to get a list of resources managed by terraform we can use terraform state list for listing all the resources on the terraform state:
07/05/2021
Read more...2 min read
One of the nicest functions terraform has is terraform fmt: Just as go fmt would do with Go code, it will rewrite Terraform configuration files (.tf and .tfvars files) to a canonical format and style. This will improve it's readability, helping making the code more consistent.
06/05/2021
Read more...2 min read
On Kubernetes we can configure using the Pod manifest under which conditions we want to query the container registry to pull images by using the imagePullPolicy setting. We can configure the it on several objects like Deployment, StatefulSet, Pod, Job... In fact, we can set it on any object that includes a Pod template
apiVersion: v1
kind: Pod
metadata:
name: test-pod
namespace: demo
spec:
containers:
- image: alpine
imagePullPolicy: IfNotPresent
(...)
05/05/2021
Read more...