Qovery makes it easy to create an EKS cluster on your AWS account and manage the deployment of applications on it. But you still might want to execute operations on it via
kubectl like you would on any other Kubernetes cluster.
- You have an existing EKS cluster manages by Qovery
- You have deployed an application on this cluster with Qovery
This tutorial will show you how to access a Qovery managed cluster on AWS with
kubectl and shell into a running application container.
Install and configure your toolchain
To interact with your cluster, you will need
The AWS CLI must be installed and configured on your machine. https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
Add your IAM user to the Admin group
kubectlwill use IAM to authenticate, you need to add your IAM user (the one the AWS CLI is authenticated with) to the
Adminsgroup you created when setting up Qovery.
Download the Kubeconfig file
To connect to your EKS cluster you will need to set a context to
kubectl. This is done with a
When installing a new cluster, Qovery stores it in an S3 bucket on your account.
Go to S3, find the Qovery bucket, and download the file. The bucket should be named something like
Set the context for kubectl
To set the context for kubectl, run the following command:export KUBECONFIG=<path to the kubeconfig file you downloaded>
You can check that it works with a kubectl command. For example:kubectl get nodes
You are good to go if you see an output like the following:NAME STATUS ROLES AGE VERSIONzb81b1cd4-ub667 Ready <none> 14d v1.19.15zb81b1cd4-ujkm8 Ready <none> 24d v1.19.15zb81b1cd4-ujkmc Ready <none> 24d v1.19.15
Get your application namespace
When you deploy an application, Qovery will create a separate namespace for each environment on your Kubernetes cluster.
You can get the list of the namespaces on your cluster using the following command:kubectl get namespaces
You will get an output similar to this one:NAME STATUS AGEcert-manager Active 44ddefault Active 44dkube-node-lease Active 44dkube-public Active 44dkube-system Active 44dlogging Active 44dnginx-ingress Active 44dprometheus Active 44dqovery Active 44dz0121531e-zb2daee81 Active 35dz016bd165-zeb51c37e Active 31d
The Qovery application namespaces are the ones begining with
In case you have several environments running, to identify the right one:
- Go to the Qovery console
- Go to the right environment
In your URL bar you'll have something like:
https://console.qovery.com/platform/organization/<organisation id>/projects/<project id>/environments/<environment id>/applications
The environment namespace is defined the following way:
z<project short ID>-z<environment short ID>.
The short ID is the first section of the ID. For example, given the following ID:
e0aabc0d-99cb-4867-ad39-332d6162c32c, the short ID will be
The following environment URL:
https://console.qovery.com/platform/organization/<organisation ID>/projects/e0aabc0d-99cb-4867-ad39-332d6162c32c/environments/b91d2eb8-a850-49b5-8626-ade7afc4a28b/applicationswould translate to the following namespace:
Identify the right application pod(s)
To list the pods running in your environment namespace, run the following command:kubectl get pods --namespace <your namespace>
The output should be similar to this one:NAME READY STATUS RESTARTS AGEapp-z2fc29b74-5db6745975-nrw8v 1/1 Running 0 29happ-zabbcf976-74f969f848-kzp87 1/1 Running 0 29h
The same principle goes for finding the right application pod. Go to the application page on the Qovery console.
You'll get an URL looking like this:
https://console.qovery.com/platform/organization/<organisation ID>/projects/<project ID>/environments/<environment ID>/applications/abbcf976-27a1-4531-9cdd-e4d15d7b2c27/summary
Get the short ID of our application, in our case
abbcf976which means the application pod name will start with
In case you setup your app to run multiple replicas, it is possible that you see several pods begining with the same string. You can pick any of them.
In our case the right pod corresponding to our application would be
Shell into the container
To get a shell access to the container running inside the application pod, all you have to do is:kubectl exec -ti --namespace <your namespace> <your pod name> -- sh
This will open a shell inside of your application container. You can now execute any command you need.
Qovery helps you manage your Kubernetes cluster and deploy your applications on it while still giving you the power of a full access to your cluster.