Kubernetes how to make Deployment to update image

You can configure your pod with a grace period (for example 30 seconds or more, depending on container startup time and image size) and set “imagePullPolicy: “Always”. And use kubectl delete pod pod_name. A new container will be created and the latest image automatically downloaded, then the old container terminated. Example: spec: terminationGracePeriodSeconds: 30 containers: … Read more

Expose port in minikube

I am not exactly sure what you are asking as it seems you already know about the minikube service <SERVICE_NAME> –url command which will give you a url where you can access the service. In order to open the exposed service, the minikube service <SERVICE_NAME> command can be used: $ kubectl run hello-minikube –image=gcr.io/google_containers/echoserver:1.4 –port=8080 … Read more

How do I access the Kubernetes api from within a pod container?

In the official documentation I found this: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#accessing-the-api-from-a-pod Apparently I was missing a security token that I didn’t need in a previous version of Kubernetes. From that, I devised what I think is a simpler solution than running a proxy or installing golang on my container. See this example that gets the information, from the … Read more

Service located in another namespace

I stumbled over the same issue and found a nice solution which does not need any static ip configuration: You can access a service via it’s DNS name (as mentioned by you): servicename.namespace.svc.cluster.local You can use that DNS name to reference it in another namespace via a local service: kind: Service apiVersion: v1 metadata: name: … Read more

What’s the difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?

[*] A ClusterIP exposes the following: spec.clusterIp:spec.ports[*].port You can only access this service while inside the cluster. It is accessible from its spec.clusterIp port. If a spec.ports[*].targetPort is set it will route from the port to the targetPort. The CLUSTER-IP you get when calling kubectl get services is the IP assigned to this service within … Read more

Kubernetes: how to set VolumeMount user group and file permissions

The Pod Security Context supports setting an fsGroup, which allows you to set the group ID that owns the volume, and thus who can write to it. The example in the docs: apiVersion: v1 kind: Pod metadata: name: hello-world spec: containers: # specification of the pod’s containers # … securityContext: fsGroup: 1234 More info on … Read more