2 min read
To change a container's image we can:
Let's check how to use kubectl set image
14/05/2021
Read more...2 min read
When we want to access services that run inside a kubernetes cluster that are not supposed to be normally accessed we can temporally run kubectl port-forward to forward traffic to our workstation. To be able to use it, the node must have socat installed.
13/05/2021
Read more...3 min read
With terraform taint we are telling terraform that a particular object has become degraded so it will propose to replace it in the next plan. This command is going to be deprecated on terraform v1.0 since now we have the -replace flag on the apply command
$ terraform taint kubernetes_namespace.pet2cattle_namespace
Acquiring state lock. This may take a few moments...
Resource instance kubernetes_namespace.pet2cattle_namespace has been marked as tainted.
Releasing state lock. This may take a few moments...
12/05/2021
Read more...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...