Skip to content

Commit c335f6a

Browse files
committed
CLOUD-845 Added a doc how to troubleshoot Operator installation
1 parent 8514763 commit c335f6a

File tree

2 files changed

+160
-0
lines changed

2 files changed

+160
-0
lines changed

docs/environment-troubleshoot.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Installation troubleshooting
2+
3+
This section provides information on how to troubleshoot installation issues for Percona Operator for PostgreSQL.
4+
5+
For troubleshooting, we will use `kubectl` – the command-line tool for interacting with the Kubernetes API.
6+
7+
Let’s start with these basic troubleshooting steps.
8+
9+
## Check connection to Kubernetes cluster
10+
11+
It may happen that `kubectl` you installed locally is not connected to your Kubernetes cluster.
12+
13+
1. To verify it, run the following command:
14+
15+
```{.bash data-prompt="$"}
16+
$ kubectl cluster-info
17+
```
18+
19+
If you see the following output, it means that `kubectl` is connected to your Kubernetes cluster:
20+
21+
??? example "Sample output"
22+
23+
```{.text .no-copy}
24+
Kubernetes control plane is running at https://127.0.0.1:49475
25+
CoreDNS is running at https://127.0.0.1:49475/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
26+
```
27+
28+
2. If you see the errors, do the following:
29+
30+
=== "Google Kubernetes Engine (GKE)"
31+
32+
1. Check if you have Google Cloud SDK installed and that you can interact with it by running `gcloud` in your terminal. If not, refer to the Google Cloud SDK Documentation for [installation instructions :octicons-link-external-16:](https://cloud.google.com/sdk/docs/install).
33+
2. In the Google Cloud Console, select your cluster and then click **Connect**. You will see the connect statement which configures the command-line access. After you have edited the statement, run the following command in your local shell replacing the `<project name>` with your project name:
34+
35+
```{.bash data-prompt="$"}
36+
$ gcloud container clusters get-credentials cluster-1 --zone us-central1-a --project <project name>
37+
```
38+
39+
3. Use your Cloud Identity and Access Management (Cloud IAM) to control the access to the cluster. The following command gives you the ability to create Roles and RoleBindings:
40+
41+
```{.bash data-prompt="$"}
42+
$ kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user $(gcloud config get-value core/account)
43+
```
44+
45+
!!! note ""
46+
47+
You may have the error like the following:
48+
49+
```{.text .no-copy}
50+
error: failed to create clusterrolebinding: Post “https://34.66.76.82/apis/rbac.authorization.k8s.io/v1/clusterrolebindings?fieldManager=kubectl-create&fieldValidation=Strict”: getting credentials: exec: executable gke-gcloud-auth-plugin not found
51+
```
52+
53+
In this case, follow these steps:
54+
55+
1. Install the `gke-gcloud-auth-plugin` using the following command:
56+
57+
```{.bash data-prompt="$"}
58+
$ gcloud components install gke-gcloud-auth-plugin
59+
```
60+
2. Authenticate to Google Cloud SDK using this command:
61+
62+
```{.bash data-prompt="$"}
63+
$ gcloud auth login
64+
```
65+
66+
3. Run the `kubectl create clusterrolebinding` command again.
67+
68+
69+
=== "Amazon Elastic Kubernetes Engine (AWS EKS)"
70+
71+
1. Check that you have installed the [Amazon EBS CSI driver :octicons-link-external-16:](https://docs.aws.amazon.com/eks/latest/userguide/ebs-csi.html). Otherwise install it using one of the suggested methods: [as an add-on :octicons-link-external-16:](https://docs.aws.amazon.com/eks/latest/userguide/managing-ebs-csi.html) or [as a self-managed installation :octicons-link-external-16:](https://github.com/kubernetes-sigs/aws-ebs-csi-driver)
72+
2. Enable `kubectl` to communicate with your cluster by adding a new context to the `kubectl` config file.
73+
74+
```{.bash data-prompt="$"}
75+
$ aws eks --region region update-kubeconfig --name cluster_name
76+
```
77+
78+
=== "Minikube"
79+
80+
1. When deploying Kubernetes locally using Minikube, you may need to allocate additional resources. The recommended minimum resources are 4 CPUs, 30 Gb disk size and 5 GB of RAM. To start Minikube with these resources, run the following command:
81+
82+
```{.bash data-prompt="$"}
83+
$ minikube start --memory=5120 --cpus=4 --disk-size=30g
84+
```
85+
86+
2. To check if your `kubectl` is connected to Minikube, use the following command to check the current context. The current context determines which cluster `kubectl` is interacting with. You can get the current context by running the command:
87+
88+
```{.bash data-prompt="$"}
89+
$ kubectl config current-context
90+
```
91+
92+
If the output is `minikube`, then `kubectl` is configured to interact with your Minikube cluster.
93+
94+
If the context is other, you need to switch to Minikube context by running the following command:
95+
96+
```{.bash data-prompt="$"}
97+
$ kubectl config use-context minikube
98+
```
99+
100+
101+
3. Run the `kubectl cluster-info` command again to verify that `kubectl` is connected to your Kubernetes cluster.
102+
103+
104+
## Check Kubernetes Nodes
105+
106+
Check that your Kubernetes cluster nodes are registered correctly. Run the following command:
107+
108+
```{.bash data-prompt="$"}
109+
$ kubectl get nodes
110+
```
111+
112+
All nodes must be listed and must have the `Ready` status that indicates that the node is healthy and can accept pods.
113+
114+
If you see the nodes in the `NotReady` status, it means that there are issues with the nodes. To get detailed information about a node, run the following commands:
115+
116+
```{.bash data-prompt="$"}
117+
$ kubectl describe node <node-name>
118+
```
119+
120+
Or, you can use the following command:
121+
122+
```{.bash data-prompt="$"}
123+
$ kubectl get node <node-name> -o yaml
124+
```
125+
126+
Both commands provide detailed information about the node, including the resources allocated to it, the pods running on the node, and the events related to the node.
127+
128+
## Check user permissions
129+
130+
It may happen that your user doesn’t have enough permissions for installing the Operator. To check it, use the following script:
131+
132+
```{.bash data-prompt="$"}
133+
$ bash <(curl -s https://gist.githubusercontent.com/cshiv/6048bdd0174275b48f633549c69d0844/raw/fd547b783a30b827362ee9f9ec03436f9bc79524/check_priviliges.sh)
134+
```
135+
136+
??? example "Sample output"
137+
138+
```{.text .no-copy}
139+
Checking privileges to install Percona Operators in kubernetes cluster...
140+
Warning: Unable to check the privileges for resource 'issuers', check if the resource 'issuers' is present in the cluster
141+
Warning: Unable to check the privileges for resource 'certificates', check if the resource 'certificates' is present in the cluster
142+
143+
Warning: Some resources are not found in the kubernetes cluster.Check the Warning messages before you proceed
144+
------------------------------------------------------------------------------------------
145+
GOOD TO INSTALL: Percona Operator for PostgreSQL
146+
https://docs.percona.com/percona-operator-for-postgresql/index.html
147+
------------------------------------------------------------------------------------------
148+
GOOD TO INSTALL: Percona Operator for MySQL based on Percona XtraDB Cluster
149+
https://docs.percona.com/percona-operator-for-postgresql/index.html
150+
------------------------------------------------------------------------------------------
151+
GOOD TO INSTALL: Percona Operator for MongoDB
152+
https://docs.percona.com/percona-operator-for-mongodb/index.html
153+
```
154+
155+
If you have insufficient permissions, the script will show you which ones are missing for installing a particular Operator. In this case, contact the Kubernetes cluster administrator.
156+
157+
158+
159+

mkdocs-base.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ nav:
220220
- "Monitor Kubernetes": monitor-kubernetes.md
221221
- "Use PostGIS extension": postgis.md
222222
- Troubleshooting:
223+
- "Environment troubleshooting": environment-troubleshoot.md
223224
- "Initial troubleshooting": debug.md
224225
- "Exec into the container": debug-shell.md
225226
- "Check the logs": debug-logs.md

0 commit comments

Comments
 (0)