Questions tagged [kubectl]

Use this tag if a question is about kubectl

Filter by
Sorted by
Tagged with
1 vote
0 answers
12 views

How to colorize kubernetes logs?

It's easy enough to enable colorful logs on docker containers (by setting TERM=xterm-256color and running with tty: True). Still, I'm not getting any color when I run kubectl logs/stern on the ...
user avatar
  • 11
0 votes
0 answers
11 views

Kube MQ installation ways

(I am trying to install and use KubeMQ in a VM on a cloud, so no GUI is available.) Kube MQ has 3 ways of installing it: using kubectl using docker (standalone container) using binary files. Could ...
user avatar
  • 1
1 vote
1 answer
47 views

How to run short-lived command using kubectl

I was trying to measure pod startup time buy running the following: % kubectl run --image busybox --attach test -- date error: timed out waiting for the condition At first it seems like this command ...
user avatar
  • 121
0 votes
1 answer
832 views

It seems like the kubelet isn't running or healthy [closed]

What did I want to do here? I want to make 3 node Kubernetes cluster First I install Ubuntu server 20.04.3 LTS in my VMware and this way too I make 3 servers. After I install docker and Kubernetes and ...
user avatar
1 vote
0 answers
21 views

Can kubernetes `--force` delete of pods be disabled by administrators?

Using kubectl delete pods PODNAME --force removes the pod from the Kubernetes API without checking the underlying pod deleted successfully. In most cases this means resources are locked indefinitely, ...
user avatar
1 vote
2 answers
226 views

How to expose a service ( Experssjs Api ) deployed on minikube ( 192.168.49.2 ) to be able to access it from another device in the same network?

I've created a service inside minikube (expressjs API) running on my local machine, so when I launch the service using minikube service wedeliverapi --url i can access it from my browser with ...
user avatar
0 votes
1 answer
52 views

kubectl retrieve update time for the resource

I'm wondering whether it's possible to get the time where my resource was updated? e.g. via $ kubectl describe deployment/myapp I can see CreationTimestamp but I want to know the last time new ...
user avatar
2 votes
1 answer
113 views

How to get public key from cert-manager?

I need to get a public key from cert manager from bash. How to do it properly? I can see the private key in kubernetes secrets; how to get public key that can be safely shared?
user avatar
2 votes
1 answer
80 views

HAProxy Not Working with Kubernetes NodePort for Backend (Bare Metal)

I have a host running HAProxy already. It's been up and running since before I did anything with Kubernetes. It works flawlessly as a reverse proxy and SSL terminator for various web things in ...
user avatar
0 votes
1 answer
56 views

Change kubernetes resource requests after pod/job has started

I'd like to change my pod's CPU request value after a pod has started. Is this possible? In our shared kubernetes system there is a requirement that our actual resource usage be "reasonably close&...
user avatar
-2 votes
1 answer
23 views

How to read Kubernets secrets values

What could be the kubectl command to see k8s secret values I tried kubectl get secrets/<secrets-name> -n <namespace> It returns NAME TYPE DATA AGE secrets1 Opaque ...
user avatar
1 vote
1 answer
260 views

OIDC token invalid when put into kubeconfig

I can connect to the Kubernetes API from a container running inside the cluster with an OIDC token like so: kubectl —token $token get pod I would now like to prepare a kubeconfig such that other ...
user avatar
  • 141
1 vote
1 answer
45 views

Scheduling a build using Kubernetes

The doc https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html provides details of creating a cron job. To start a scheduled task that executes a build every 10 mins I use the ...
user avatar
  • 111
1 vote
3 answers
1k views

kubectl asking for username (k8s cluster created via kops)

I created a kubernetes cluster using kops and deployed it in AWS (not EKS manual cluster using kops). Then I export in my local machine the configuration like kops export kubecfg --state ${...
user avatar
1 vote
1 answer
290 views

Failed to install kubernetes on centos

Following the official documentation, I have an error when trying to install kubernetes cluster yum package. I am on Centos 7 using yum. So I run this commands: cat <<EOF | sudo tee /etc/yum....
user avatar
4 votes
2 answers
2k views

Kubernetes configuration with yaml anchors

I have a deployment.yaml file and want to reuse the environment for all my deployments like this: apiVersion: apps/v1 kind: Deployment metadata: name: beat spec: selector: matchLabels: ...
user avatar
1 vote
1 answer
371 views

How to get CPU and Memory usage of nodes in a specific Kubernetes instance group?

I have a couple separate instance groups, and kubectl top nodes will display the CPU and Memory usage of all nodes. I'd like to be able to just ask for the information for a specific instance group if ...
user avatar
  • 111
1 vote
1 answer
134 views

Get all Deployments referencing given ConfigMap by the ConfigMap's name

Suppose I have a ConfigMap: apiVersion: v1 kind: ConfigMap metadata: name: london-tz-config data: SERVER_TIMEZONE: "Europe/London" I also have about 50 distinct Deployments. Let's say ...
user avatar
  • 123
0 votes
1 answer
411 views

config.yaml is not setting up a new context

I have a kubernetes Config file such as: apiVersion: v1 kind: Config preferences: {} contexts: - context: cluster: test-sim-development namespace: test-sim user: developer name: test-sim ...
user avatar
  • 101
1 vote
2 answers
218 views

How do I list pod name/version across multiple clusters in Kubernetes

I have multiple clusters that I want to query and in each cluster I want to find and list the versions of the pods running in there. I've written a shell script that sets the namespace and then ...
user avatar
  • 111
1 vote
1 answer
56 views

kubectl create deployment not has the option containerPort

When I execute kubectl create deployment nginx --image nginx --dry-run=client -o yaml it does not have options --port or --containerPort. My yaml is: apiVersion: apps/v1 kind: Deployment metadata: ...
user avatar
1 vote
1 answer
31 views

Running Two infinite commands on single pod/image

I have a Dockerfile with a CMD, it calls a .sh file that runs a Django app ( makemigrations, migrate and uwsgi ) And that runs fine in a pod. There's a django admin script that runs infinitely that I'...
user avatar
  • 31
0 votes
1 answer
47 views

How to get server url from kub dashboard?

I have access to kubernetes dashboard on aws with token. And now I want to connect with kubectl, how to get server url for kubectl config?
user avatar
  • 101
0 votes
1 answer
277 views

Accessing k8s outside of VM

I am running k8s cluster for evaluation purposes inside some vagrant box. I have external kubectl access. I was able to get PostgreSQL helm template running on the cluster. But now let say I want to ...
user avatar
  • 101
1 vote
1 answer
1k views

Authentication Error in Kubernetes

I am new to Kubernetes. I am getting below error while creating deployments in Kubernetes. <!-- You are authenticated as: anonymous Groups that you are in: Permission you need to have (but didn'...
user avatar
1 vote
1 answer
115 views

Kops: How to delete the multiple SSHPublicKey

SSHPublicKey admin 2b:xx: SSHPublicKey admin 2c:yy How to remove one ssh key from the cluster ? when tried to delete via normal way, kops delete secret --name cluster-1.dev.transein.com ...
user avatar
0 votes
1 answer
377 views

error validating data: couldn't find type

I have following yaml file: --- apiVersion: v1 kind: pod metadata: name: Tesing_for_Image_pull.pod spec: containers: - name: mysql image: mysql ...
user avatar
1 vote
1 answer
581 views

Kubelet config file -- > clusterDNS

clusterDNS: - "10.32.0.10" The above is a flag passed to the kubelet file, i dont know what it refers to clsuter DNS ? Is it refers to VPC CIDR or any subnet CIDR ?
user avatar
1 vote
1 answer
27 views

Kubernetes api service unit file

i was going through the kubernetes the hard way(kelsey), i see in the API server unit file with a cluster ip range as --service-cluster-ip-range=10.32.0.0/24 \ is it a default ip range ? my VPC ...
user avatar
2 votes
1 answer
47 views

Weavenet for kubernetes is showing 0/2

I'm very new to kubernetes. I thought i would first get a basic by making hands dirty by "the hard way" I followed the Linux academy, but at the networking side using weave net i am now stuck ! ...
user avatar
0 votes
1 answer
43 views

kubernetes How to test if an operator has already been applied

How can I check if an operator has not changed, and then not apply it? usually, I would apply an operator like this kubectl apply -f openebs.yml In an automated script, I would like to test if ...
user avatar
  • 143
4 votes
2 answers
7k views

Kubernetes - How to show all service accounts

How do I show all service accounts In Kubernetes? I have tried kubectl get --all-namespaces all. It does not show service accounts. How can I use kubectl to list all service accounts?
user avatar
  • 1,153
0 votes
1 answer
187 views

use different kubectl configs in different terminal sessions

If I run kubectl get svc, it seems to be the same across terminal sessions - how can use a local configuration that's only loaded for my current terminal session? If the answer is a local config file ...
user avatar
17 votes
3 answers
13k views

Copy multiple files using * wildcard from kubernetes container

I have several files named out1, out2, ... in my Kubernetes container. I want to copy them to my local computer. I am using: $ kubectl cp pod:/path/out* . But I am getting an error: tar: Removing ...
user avatar