Skip to main content
37 votes
Accepted

How to copy files recursively to a Kubernetes pod?

kubectl cp by default does recursive copies when given a directory, although it seems to be picky about trailing slashes. If foo/bar is the directory you'd like to copy, simply run kubectl cp /path/...
Xiong Chiamiov's user avatar
28 votes

How to get kubernetes pod network CIDR

This command will give you the pod CIDR addresses for each of the nodes in your cluster. kubectl get nodes -o jsonpath='{.items[*].spec.podCIDR}'
Marcus's user avatar
  • 401
27 votes
Accepted

What does "Does not have minimum availability" in k8s mean?

As @Tensibai indicated in one the comments, this could be caused as there is insufficient CPU or memory, but that is not always the case. For example, a helm chart was just deployed, it failed and the ...
030's user avatar
  • 13.2k
22 votes
Accepted

Docker In Kubernetes Deployment

Unverified as it sounds brittle to me to start a container outside of k8s supervision, but you should be able to mount /var/run/docker.sock with a hostPath volume. Example variation from the ...
Tensibai's user avatar
  • 11.4k
18 votes
Accepted

What functional differences are there between kubernetes, rancher and mesos?

First of all, Rancher actually contains implementations of both Kubernetes and Mesos within itself. However, they did make their own system called Cattle which is heavily based on Docker's Swarm. I'll ...
Peter G's user avatar
  • 1,102
18 votes
Accepted

Properly shutdown k3s on local machine

There is a systemd shutdown task (/etc/systemd/system/k3s.service) which stops the server, but not the k8s resources (pods, networks, etc). For this there is a utility script k3s-killall.sh which ...
Bruce Becker's user avatar
  • 3,603
18 votes
Accepted

Use one Helm chart for ALL microservices?

Subcharts are the way to go. I've done a very similar thing as follows: Create one or more base charts which cover microservices that have similar configuration (e.g. one for backend microservices, ...
emorris's user avatar
  • 296
16 votes
Accepted

how to check running containers with containerd

Try to namespace to list command ctr -n k8s.io containers list To list available namespaces run ctr ns ls For microk8s you have to prefix command with microk8s eg: microk8s ctr ns ls
fsp's user avatar
  • 176
15 votes
Accepted

Prometheus alert CPUThrottlingHigh raised but monitoring does not show it

The CPUThrottlingHigh is an alert created by the kubernetes-mixin project. There is an open issue (#108) to discuss this alert. I suggest that you read all the comments on this issue to better ...
Eduardo Baitello's user avatar
15 votes
Accepted

Kubernetes - How to show all service accounts

The command you listed will show you your resources. Instead try: kubectl get serviceAccounts
Wesley Rolnick's user avatar
15 votes
Accepted

How can I add an additional IP / hostname to my Kubernetes certificate?

To do this, you’ll first need your kubeadm configuration file. This creates a file named kubeadm.yaml: kubectl -n kube-system get configmap kubeadm-config -o jsonpath='{.data.ClusterConfiguration}' &...
Eduardo Baitello's user avatar
14 votes

How to get kubernetes pod network CIDR

This will show pod network CIDR which used by kube-proxy kubectl cluster-info dump | grep -m 1 cluster-cidr
SamBundy's user avatar
  • 141
14 votes

Copy multiple files using * wildcard from kubernetes container

You can do that using this command: kubectl cp -n [NAMESPACE] [POD_NAME]:/[POD_DIRECTORY]/. .
cookiedough's user avatar
13 votes
Accepted

Copy multiple files using * wildcard from kubernetes container

Wildcard support was added to kubectl cp in the #72641 pull request. It is merged but only available in Kubernetes v1.14.0. Take a look at the ChangeLog: Notable Features: [...] • kubectl supports ...
Eduardo Baitello's user avatar
12 votes
Accepted

What are the best practices for anti-virus / anti-malware when using containers?

This is an area where you will need to talk directly to and potentially help educate your auditors. What you have to remember is they are responsible for ensuring that adequate controls are applied, ...
Richard Slater's user avatar
11 votes

Combine Docker Swarm and Kubernetes

Update: Docker just released support for Kubernetes as scheduler, which changes the situation and makes Kubernetes just an alternative scheduler to Docker Swarm. TL;DR: DON'T DO IT. Engineers always ...
Jiri Klouda's user avatar
  • 5,807
11 votes

How to get kubernetes pod network CIDR

my version of kubeadm is 1.22 and the command to view defaults is kubeadm config print init-defaults, towards the bottom: networking: dnsDomain: cluster.local serviceSubnet: 10.96.0.0/12
Paul42's user avatar
  • 211
10 votes
Accepted

What is a minimal viable number of hosts for an experimental Kubernetes cluster?

I'd say the minimal viable configuration to test and get a good overview of pod placement would be 5 machines, 2 masters and 3 nodes. This allows you to play with a master failure, placement of ...
Tensibai's user avatar
  • 11.4k
10 votes
Accepted

What are spells of Kubernetes?

TL;DR: the "Canonical" version of Kubernetes has been customized by Canonical, the developers of Ubuntu, based upon their experiences of running Kubernetes. "Kubernetes Core" on the other hand is the ...
Richard Slater's user avatar
9 votes

Docker Container capacity planning

The same as any Linux load, consider no more processes in wait state than the number of CPU. The load on 1, 5 and 15 mins given by uptime should ideally be 1 less than number of cores. Containers ...
Tensibai's user avatar
  • 11.4k
9 votes

Kubernetes - How to show all service accounts

kubectl get sa --all-namespaces This will only provide the service accounts. In general, you can have a comma separated list of resources to display. Example: kubectl get pods,svc,sa,deployments [...
tnsh's user avatar
  • 106
9 votes

What's the relationship between ContainerD and Docker?

Containerd is a daemon for running containers. The Docker blog has a nice write up explaining how this fits into Docker. While containerd is used in Docker, it can also be used as a daemon for other ...
Wesley Rolnick's user avatar
9 votes
Accepted

How to run a single one-time command on a kubernetes instance/pod

A little more information is needed about specific operations you are doing, but generally your options are: For one-time operations: use kubectl exec to get into containers and do commands (works ...
taleodor's user avatar
  • 900
8 votes
Accepted

how to control pod termination speed in kubernetes

There is a default grace period for pod termination of 30 seconds. See: https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods. You can customize the grace period setting ...
Paidhi's user avatar
  • 326
8 votes
Accepted

Kubernetes configuration with yaml anchors

YAML anchors are supported, but only for the same YAML file. You can't create the anchor (&) on a deployment file and reference (*) the value on another one. If you want to share ENVs values ...
Eduardo Baitello's user avatar
8 votes

Use one Helm chart for ALL microservices?

Generally, a Helm chart would cover all your microservices - ideally, you should be able to deploy whole application in one chart. It may get a little messy if you include external 3rd party ...
taleodor's user avatar
  • 900
8 votes

ArgoCD Autosync based off of Docker Image `latest` Tag

This isn't really an ArgoCD thing. Keel is a good tool to help keep your images updated across the cluster and is super easy to implement. Basically, you'd just add some annotations to your manifest. ...
Josiah's user avatar
  • 363
8 votes
Accepted

Use a Kustomize image transformation on an Argo CronWorkflow

Kustomize offers a way to "hint" where to find image tags. Add a file called kustomconfig.yaml: images: - path: spec/templates[]/container/image kind: WorkflowTemplate - path: spec/...
crenshaw-dev's user avatar
7 votes
Accepted

How do I get Kubernetes to work when I get an error "the server could not find the requested resource"?

As per https://kubernetes.io/docs/tasks/tools/install-kubectl/#before-you-begin: You must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.2 ...
Map's user avatar
  • 186
7 votes
Accepted

What's the best complete DevOps setup?

Vagrant is for setting up test environments right? Ansible/Chef etc. seem good for servers you own, but what about cloud? Docker... great for standardizing app, so why use Ansible/Chef? Kubernentes.. ...
AnoE's user avatar
  • 4,886

Only top scored, non community-wiki answers of a minimum length are eligible