-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
139 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
docs/user/troubleshooting/03-70-cannot-connect-to-hana-db.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Issues with Connection to SAP HANA Database | ||
|
||
## Symptom | ||
|
||
You're unable to connect an application to a SAP HANA Database instance. | ||
|
||
## Troubleshooting | ||
|
||
The Istio module's default configuration does not restrict outbound traffic. This means that the application should have no issues connecting to the SAP HANA Database instance. | ||
To determine the cause of the connection issue, follow the troubleshooting steps. | ||
|
||
### Connect to the SAP HANA Database Instance from Outside of the Cluster | ||
1. Download SAP HANA Client for your operating system from the [SAP Development Tools](https://tools.hana.ondemand.com/#hanatools). | ||
2. Unpack the downloaded archive. | ||
3. Install SAP HANA Client. | ||
4. Connect to SAP HANA Database instance using the following command: | ||
```bash | ||
hdbsql -n {HANA_DB_INSTANCE_ADDRESS} -u {HANA_DB_USER} -p {HANA_DB_PASSWORD} | ||
``` | ||
For example: | ||
```bash | ||
hdbsql -n aaa.bbb.ccc.ddd:30015 -u my_user -p mypassword | ||
``` | ||
5. If the connection is successful and you can execute queries, the issue is not related to the SAP HANA Database instance. | ||
### Connect to the SAP HANA Database Instance from Inside of the Cluster | ||
1. Build a Docker image with the SAP HANA Client installed. You can use the following Dockerfile: | ||
```Dockerfile | ||
FROM eclipse-temurin:17 | ||
WORKDIR /build | ||
COPY client.tar client.tar | ||
RUN tar -xvf client.tar | ||
RUN echo "/usr/local/bin" | ./client/hdbinst | ||
ENTRYPOINT ["sleep", "8000"] | ||
``` | ||
Download the SAP HANA Client for Linux x86 64-bit from [SAP Development Tools](https://tools.hana.ondemand.com/#hanatools) and save it as `client.tar` in the same directory as the Dockerfile. Then, run the following command to build the image: | ||
```bash | ||
docker buildx build --platform=linux/amd64 -t hdbsql . | ||
``` | ||
2. To test your image, run the following command: | ||
```bash | ||
docker run --entrypoint "hdbsql" hdbsql -v | ||
``` | ||
You get an output similar to this example: | ||
``` | ||
HDBSQL version 2.20.20.1712178305, the SAP HANA Database interactive terminal. | ||
Copyright 2000-2024 by SAP SE. | ||
``` | ||
3. Publish the image to a container registry. | ||
4. Run the image in the Kubernetes cluster: | ||
```bash | ||
kubectl create deployment hdbsql --image={PUBLISHED_IMAGE_NAME} | ||
``` | ||
5. Attach to the Pod and try to connect to the SAP HANA Database instance using the following command: | ||
```bash | ||
hdbsql -n {HANA_DB_INSTANCE_ADDRESS} -u {HANA_DB_USER} -p {HANA_DB_PASSWORD} | ||
``` | ||
6. If the connection is successful and you can execute queries, the issue is not related to the setup of the cluster. | ||
7. Check the connection from a Pod that has the Istio sidecar injected. In that case, create the Deployment in a namespace with Istio sidecar injection enabled. The connection should be successful. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package pods_test | ||
|
||
import ( | ||
"context" | ||
"github.com/kyma-project/istio/operator/pkg/lib/sidecars/pods" | ||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
v1 "k8s.io/api/core/v1" | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
var _ = Describe("Evaluate restart", func() { | ||
It("should should return false when pod has custom image annotation", func() { | ||
pod := createPodWithProxySidecar("test-pod", "test-namespace", "1.21.0", map[string]string{"sidecar.istio.io/proxyImage": "istio/proxyv2:1.21.0"}) | ||
|
||
predicate := pods.NewRestartProxyPredicate(pods.NewSidecarImage("istio", "1.22.0"), v1.ResourceRequirements{}) | ||
evaluator, err := predicate.NewProxyRestartEvaluator(context.Background()) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(evaluator.RequiresProxyRestart(pod)).To(BeFalse()) | ||
|
||
}) | ||
|
||
It("should should return true when pod does not have custom image annotation", func() { | ||
pod := createPodWithProxySidecar("test-pod", "test-namespace", "1.21.0", map[string]string{}) | ||
|
||
predicate := pods.NewRestartProxyPredicate(pods.NewSidecarImage("istio", "1.22.0"), v1.ResourceRequirements{}) | ||
evaluator, err := predicate.NewProxyRestartEvaluator(context.Background()) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(evaluator.RequiresProxyRestart(pod)).To(BeTrue()) | ||
|
||
}) | ||
}) | ||
|
||
func createPodWithProxySidecar(name, namespace, proxyIstioVersion string, annotations map[string]string) v1.Pod { | ||
if annotations == nil { | ||
annotations = map[string]string{} | ||
} | ||
annotations["sidecar.istio.io/status"] = "true" | ||
return v1.Pod{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: name, | ||
Namespace: namespace, | ||
Annotations: annotations, | ||
}, | ||
Status: v1.PodStatus{ | ||
Phase: v1.PodRunning, | ||
Conditions: []v1.PodCondition{ | ||
{ | ||
Type: v1.PodReady, | ||
Status: v1.ConditionTrue, | ||
}, | ||
}, | ||
}, | ||
Spec: v1.PodSpec{ | ||
Containers: []v1.Container{ | ||
{ | ||
Name: "istio-proxy", | ||
Image: "istio/proxyv2:" + proxyIstioVersion, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters