Questions tagged [kubectl]
The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
3,028
questions
0
votes
0
answers
16
views
How to remove warning in kubectl with gcp auth plugin?
When I run any kubectl command I get following WARNING:
W0517 14:33:54.147340 46871 gcp.go:120] WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead.
To ...
0
votes
1
answer
20
views
Kubernetes application URL location?
I have run a basic example project and can confirm it is running, but I cannot identify its URL?
Kubectl describe service - gives me
NAME READY STATUS RESTARTS AGE
...
0
votes
2
answers
27
views
Copy files from remote kubernetes pod to unix machine
I want to copy files from remote kubernetes pod(source) to unix machine(target). Source & Target can be two different clusters. Earlier, openshift pods were used, so i have used rsync to copy ...
0
votes
0
answers
19
views
Kubernetes trigger job on condition
I would like to trigger a job on some condition:
if:
kubectl get jobs -n <namespace> --field-selector status.successful=1 | grep "export"
do another job: perform removal:
kubectl get ...
0
votes
1
answer
48
views
Service account secret is not listed. How to fix it?
I have used kubectl create serviceaccount sa1 to create service account. Then I used kubectl get serviceaccount sa1 -oyaml command to get service account info. But it returns as below.
apiVersion: v1
...
0
votes
1
answer
40
views
How to get token from service account?
I'm new to Kubernetes. I need to get token from service account which was created by me. I used kubectl get secrets command and I got "No resources found in default namespace." as return. ...
1
vote
2
answers
40
views
Docker-Desktop for MAC Kubernetes not creating secrets or token for serviceaccounts
I'm just trying to create a simple service account. Theoretically, kubectl automatically creates the secret and token for service accounts... But, not in my case... I've done this in kube-system, ...
0
votes
0
answers
14
views
How to display only positive change in Grafana graph?
I am using kube-stats-metrics with kube_pod_container_status_last_terminated_reason as a gauge. The gauge can be reporter for few minutes even hours. But I just want to see the change when it goes ...
-1
votes
2
answers
40
views
How can I mount Pv on one node and use that same PV for pods in another anode
I have attached an EBS volume to one of the nodes in my cluster and I want that whatever pod are coming up, irrespective of the nodes they are scheduled onto, should use that EBS volume. is this ...
0
votes
1
answer
50
views
Pod coredns stuck in ContainerCreating state with Weave on k8s
First of all, let me thank you for this amazing guide. I'm very new to kubernetes and having a guide like this to follow helps a lot when trying to setup my first cluster!
That said, I'm having some ...
1
vote
0
answers
22
views
Webhook failing in rabbtimq
I have install rabbitmq cluster using rabbitmq cluster operator. I have also added rabbitmq topology operator. I am trying to create queues using rabbitmq topology operator using following yml file
...
0
votes
2
answers
18
views
Can I filter by apiVersion in kubectl?
I want to find all the kubernetes ingresses that are still apiVersion: networking.k8s.io/v1beta1, because I'm upgraded my kubernetes cluster (EKS) from 1.21 to 1.22 and we should be using networking....
1
vote
1
answer
22
views
Improving Web Performance Deployed on Okteto
I'm new in website deployment. I have this assignment where I have to deploy an existing website using kubernetes and improve its performance by doing auto scaling. I choose this app https://github....
0
votes
2
answers
29
views
Specifying Which Kubernetes Namespaces to Display Resources from with the CLI Only
Is it possible to display Kubernetes (K8s) resources from multiple specified namespaces with only the CLI (kubectl)?
In other words, given two namespaces in a K8s cluster:
kubectl get namespaces \
--...
-1
votes
0
answers
23
views
K8s job .spec.activeDeadlineSeconds vs kubectl wait timeout
I'm building a k8s job container during a GitHub action:
- name: Build job container
if: startsWith(github.ref,'refs/heads/branch-name’)
run: docker build -f {path_to_dockerfile} -t job-name:...
0
votes
0
answers
20
views
i wrote this shell script using set -A with grep and now it's not working ( invalid output set )
i wrote this shell script using set -A with grep and now it's not working ( invalid output set) . the shell script is get command result of kubectl get rs --all-n and store is new txt and the setting ...
0
votes
2
answers
39
views
Move pods from one nodegroup of 2 nodes to another nodegroup of 3 nodes
we have an application deployed on AWS EKS, with these components:
Apache Artemis JMS
PostgreSQL
Kafka
and some application stateless pods made in node.js
Which is the best approach to move the ...
0
votes
0
answers
19
views
Failed to pull image : rpc error: code = Unknown desc = Error response from daemon: denied: access forbidden
I'm doing deployment into my kubernetes cluster. I have created secret for my private registry and deployment yaml file. I have applied them with kubectl apply -f deployment.yml with "...
0
votes
0
answers
27
views
Not able to exec into AKS pod
I'm trying to exec into one of the pods of my AKS instance using the following command: kubectl exec -n hermes --stdin --tty hermes-deployment-ddb88855b-dzgvt -- /bin/sh. I'm using just the regular ...
2
votes
1
answer
83
views
virtctl works when executed via command line but not from php exec()
I am trying to run kubectl virt commands to manage my virtual machine via PHP. First, I log in to my server with phpseclib with the following code:
$ssh = new SSH2('localhost');
if (!$ssh->login('...
-3
votes
2
answers
48
views
Kubernetes Deployments and Jobs [closed]
I am trying to run a single job which should wait for MySql deployment to start. And then there are several deployments where all deployments will wait for that single job to complete.
0
votes
2
answers
50
views
Permission denied using kubectl but able to run helm
I am facing permission denied errors when using kubectl for all commands, be get pods or apply, but I am able to use helm and login with k9s to perform destructive actions. I am using the same context ...
0
votes
1
answer
24
views
Minikube not showing CPU nor memory usage
I have successfully installed kubectl and minikube in my MacbookPro (core i9 with 64 Gb in ram) and I have successfully deployed a pod with a number of replicas. I have also started up the Kubernetes ...
0
votes
1
answer
49
views
How to create a Kubernetes cron job that delete secrets older then "x" days age and ignore the last 2 versions
I would like to create a kubectl cron job that auto delete secrets older than "x" days age, except the latest 2 versions. The Apps in the cluster use these secrets for config, but they get ...
0
votes
1
answer
37
views
Minikube start command taking long time
Going through blogs/official sites, I installed kubectl and minikube. After successful installation of both, I executed the following command.
minikube start --driver=hyperv
After executing the above ...
0
votes
1
answer
24
views
deleting minikube cluster so I can create a larger cluster with more CPUs
I need to run sudo minikube start --memory=4096 --cpus=2 for my use case. However it is running with 1 cpu already. Somehow I started it w/o creating an entry in ~/kube/config
so "kubectl ...
0
votes
0
answers
59
views
Docker: Error response from daemon: error creating overlay mount to /var/lib/docker/overlay2/ (Path here) /merged : too many levels of symbolic links
I am trying to run minikube with the following command:
minikube start --driver=docker
but it keeps giving me this error:
docker: Error response from daemon: error creating overlay mount to
/var/lib/...
0
votes
0
answers
21
views
agent node can't register external ip with server node
Here is server service unit:
ExecStart=/usr/local/bin/k3s \
server \
...
'--tls-san' \
'106.xxx.xxx.xxx' \
'--node-ip' \
'106.xxx.xxx.xxx' \
'--node-...
1
vote
2
answers
36
views
kubectl: create replicaset without a yml file
I am trying to create a replicaset with kubernetes. This time, I don't have a yml file and this is why I am trying to create the replicaset using a command line.
Why kubectl create replicaset somename ...
0
votes
3
answers
55
views
Is there an option to copy image between nodes in kubernetes cluster?
I have a case where we have to patch the docker image in k8s node and retag it to start over the old one. This process ain't so easy and obvious, because I have several nodes.
Therefore, could I do ...
0
votes
1
answer
36
views
Limit/Controlled kubectl exec command
I am still bit of kubernetes newbe. But I am looking for a way to give developers controlled access to kubectl exec command . I want to give them run most of the read-only command but prevent some ...
0
votes
0
answers
45
views
InvalidIdentityToken: Couldn't retrieve verification key from your identity provider
I am new to aws and kubectl, I need to deploy one of the app to aws. After deploying to eks cluster, I edited the ingress in the kubectl but unfortunately it returned 404 not found. (i am pretty sure ...
0
votes
1
answer
40
views
What does it mean "kubectl config set-cluster" what does it actually does?
While using this command for RBAC "kubectl config set-cluster test --server=https://127.0.0.1:52807" the IP here is from the kind-cluster that I am running after which I use "kubectl ...
0
votes
1
answer
62
views
kubernetes service won't expose external service ip
Related:
Kubernetes service external ip pending
Kubernetes (Minikube) external ip does not work
Initial state:
$ kubectl.exe get service -o wide
NAME TYPE CLUSTER-IP ...
0
votes
1
answer
23
views
unable to delete, modify or change the creationTimestamp in a Kubernetes CRD object
I am trying to update a custom resource:
kubectl edit ticketservice r134-4979a2f6-f46d-405d-97bc-ab1ba -n 2b9aea53dbfc47a
apiVersion: ticketservice.ias.alpha.com/v1alpha1
kind: TicketService
metadata:...
3
votes
2
answers
452
views
Unable to connect to AWS EKS cluster
I am configuring an EKS cluster using terraform in a private subnet and trying to access it using a VPN in a public subnet. When I configured it, it works fine but now when I run kubectl get pods or ...
0
votes
1
answer
30
views
What is the difference of writing to files using ">>" vs using linefeed character "\n" in a string when loading text to Kubernetes secret?
I have observed that kubectl inserts an additional \ to linefeed characters when using the --from-literal option. It works as expected when loading "the same" content from a file. Clearly, ...
0
votes
1
answer
21
views
Execute multiline query with Kubectl + exec + PSQL
I'm trying to run a query with Kubectl , as follows:
kubectl -n employeesns exec -ti employeedpoddb-0 -- psql -d db_people -U postgres
-c 'create extension if not exists dblink;'
-c 'SELECT ...
0
votes
1
answer
67
views
Kubernetes error when forwarding a port - Connection refused
I'm trying to port-forward my kubernetes service (through minikube) using the following command:
kubectl port-forward svc/hapi-fhir-server 8080:8080 --address=0.0.0.0
But after trying to reach ...
0
votes
1
answer
47
views
how to run a kubernetes cronjob with modified values at runtime
So I have a kubernetes cronjob object set to run periodically.
NAME SCHEDULE SUSPEND ACTIVE LAST SCHEDULE AGE
ticketing-job-lifetime-manager 45 */4 * * * ...
1
vote
1
answer
34
views
Can I use flags , while performing the kubectl scale deployment commands?
I am having a small shell script . it has the following snippet of code
kubectl scale deployment sample1 --replicas=0 -n sb1
kubectl scale deployment sample1 --replicas-3 -n sb1
The first command ...
1
vote
1
answer
53
views
Why K8s automounted service account token in a pod is different from the token retrieved directly from a service account?
Lets say I create a service account and retrieve the token associated to it:
kubectl -n myexample describe sa myexample-sa
kubectl describe secret myexample-sa-token-xxxxx
Value of the token:
token: ...
2
votes
1
answer
48
views
Kubernetes Service account token ignored in Jupyter
I am spinning up a new Jupyter notebook instance from Jupiter hub and wish to have Kubernetes API access from inside the spun up container. According to the docs, I added the parameter for service ...
0
votes
1
answer
66
views
kubectl get secrets: Error from server (Forbidden)
I have installed the Upbound CLI locally and since then I (I think) am receiving Error from server (Forbidden) error message when I try to execute different commands using kubectl:
kubectl get secrets
...
-3
votes
1
answer
59
views
can i install kubernetes on amazon linux 2
I'm having trouble Installing kubeadm on my amazon linux 2 instance specifically when i try to create a cluster,
when i try Installing runtime i get to chose which one to use :
containerd
CRI-O
Docker ...
-1
votes
1
answer
29
views
EKS cluster not reachable through kubectl during major scale up
I have a cluster running on aws EKS with Kubernetes Cluster Autoscaler.
A few days ago I had a major scale up in which my cluster got to 50 nodes in a very short period of time. When that happened I ...
-1
votes
1
answer
30
views
Is there a DRY way to patch multiple resources using kubectl v1.17?
I'm working under some restrictions, outside of my control, namely the CI/CD pipeline and the infrastructure in general.
I've been testing my kustomizations on my local console which has v1.21, but my ...
1
vote
3
answers
40
views
Setting absolute path does not work in Go for kubeconfig
I am making a call to kubectl from with a Go module like so:
getNsCmd := cmd.NewCmd("kubectl", "--kubeconfig", "~/.kube/<kube-config-file>", "get", "...
1
vote
2
answers
48
views
kubectl run not creating deployment
I'm running Kubernetes with docker desktop on windows. DD is up-to-date, and the kubectl version command returns 1.22 as both the client and server version.
I executed kubectl run my-apache --image ...
0
votes
0
answers
15
views
timed out waiting for the condition on deployments/gatekeeper-controller-manager
I am in K8S, trying my best to explain the issue here
I have followed this link to complete the installation
1 https://open-policy-agent.github.io/gatekeeper/website/docs/install
2 deploy gatekeeper ...