Skip to content

Commit c88a4b1

Browse files
IliyanVidenovIliyanGVidenovMatKuhr
authored
refactor Kyma/Gardener on-premise connectivity based on the Transpare… (#2267)
* refactor Kyma/Gardener on-premise connectivity based on the Transparent Proxy Destination * apply comments in kyma.mdx Co-authored-by: Matthias Kuhr <[email protected]> * fix formatting --------- Co-authored-by: Videnov <[email protected]> Co-authored-by: Matthias Kuhr <[email protected]>
1 parent cbc4ffd commit c88a4b1

File tree

2 files changed

+38
-29
lines changed

2 files changed

+38
-29
lines changed

docs-java/environments/gardener.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ We generally recommend to go with approach (1) unless the given constraints appl
441441

442442
### 1. Using Transparent and Connectivity Proxies
443443

444+
#### Prerequisites
445+
446+
This guide assumes you have the Transparent Proxy and Connectivity Proxy already installed in your cluster.
447+
For Transparent Proxy installation, please refer to [Transparent Proxy Lifecycle Management](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-lifecycle-management).
448+
For Connectivity Proxy installation, please refer to [Connectivity Proxy Lifecycle Management](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/connectivity-proxy-lifecycle-management).
449+
450+
#### Usage
451+
444452
Using the SAP Cloud SDK with the Transparent Proxy on Gardener is identical to how it is used on Kyma.
445453
Please refer to [this documentation](/docs/java/environments/kubernetes-kyma#on-premise-connectivity).
446454

docs-java/environments/kyma.mdx

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -546,25 +546,26 @@ But, this would mean that access to your application would not be authenticated
546546
### Prerequisites
547547

548548
This guide assumes you have both the **Transparent Proxy** (version `>= 1.4.0`) and **Connectivity Proxy** (version `>= 2.11.0`) installed in your cluster.
549-
For Kyma the Transparent Proxy is available as a module that can be enabled as described [here](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-in-kyma-environment).
550-
The Connectivity Proxy can be installed as described [here](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/operations-via-helm).
549+
For Kyma, the Transparent Proxy is available as a module that can be added as described [here](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-in-kyma-environment).
550+
For Kyma, the Conectivity Proxy is available as a module that can be added as described [here](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/connectivity-proxy-in-kyma-environment).
551+
(optional) The Connectivity Proxy can alternatively be installed in _untrusted mode_ as described [here](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/operations-via-helm).
551552

552553
:::note Kyma Compatibility
553554
On Kyma, two scenarios are supported by the SAP Cloud SDK:
554555

555556
1. Using the Connecitivty Proxy together with the Transparent Proxy
556557
2. Using a custom Connecitivty Proxy instance in "untrusted mode" without the Transparent Proxy
557558

558-
The Connecitivty Proxy managed by Kyma is coming in "trusted mode", thus this guide covers scenario (1).
559+
The Connecitivty Proxy module in Kyma is coming in "trusted mode", thus this guide covers scenario (1).
559560
In case you want to run scenario (2) refer to [this guide](./kubernetes-gardener#2-using-the-connectivity-proxy) for using the Connectivity Proxy without Transparent Proxy.
560561
Other scenarios are currently not supported.
561562
:::
562563

563564
### Background Information
564565

565-
When using the Transparent Proxy your app performs requests against the Transparent Proxy without explicit authentication, relying on the secure network communication provided by Kyma via Istio.
566-
The Transparent Proxy will obtain the relevant destination from the destination service and use it to forward the request via the Connectivity Proxy to the On-Premise system.
567-
Consequently, your app itself does not interact with destination or connectivity service at all and thus your application pods do not require bindings to these two services.
566+
When using the Transparent Proxy, your app performs requests against the Transparent Proxy without explicit authentication, relying on the secure network communication provided by Kyma via Istio.
567+
The Transparent Proxy will obtain the relevant destination from the SAP Destination service and use it to forward the request via the Connectivity Proxy to the On-Premise system.
568+
Consequently, your app itself does not interact with Destination or Connectivity services at all and thus your application pods do not require bindings to these two services.
568569

569570
Please note that the current implementation of the Transparent Proxy does not yet cover all use cases.
570571

@@ -578,18 +579,19 @@ Please note that the current implementation of the Transparent Proxy does not ye
578579
:::tip
579580
This approach is conceptually different from what you may be used to from a CloufdFoundry environment.
580581
The official [documentation of the Transparent Proxy](https://help.sap.com/docs/CP_CONNECTIVITY/cca91383641e40ffbe03bdc78f00f681/e661713ef7d14373b57e3e26b0b03b86.html) gives more information on the architecture.
582+
581583
:::
582584

583585
### Create a Kubernetes Resource
584586

585-
You can either configure connectivity to individual destinations, or for arbitrary destinations in your destination service instance or subaccount (dynamic destinations).
587+
You can either configure connectivity to individual destinations, or for arbitrary destinations in your destination service instance or subaccount (via Destination Gateway).
586588

587589
<Tabs
588590
groupId="dynamic-dest"
589591
defaultValue="single"
590592
values={[
591593
{label: "Individual Destination", value: "single"},
592-
{label: "Dynamic Destinations", value: "dynamic"}
594+
{label: "Destination Gateway", value: "gateway"}
593595
]}>
594596
<TabItem value="single">
595597

@@ -621,15 +623,15 @@ For more information on how to restrict access to the destinations refer to [thi
621623
:::
622624

623625
</TabItem>
624-
<TabItem value="dynamic">
626+
<TabItem value="gateway">
625627

626628
Create the following YAML file:
627629

628630
```yaml title:"example-dest.yaml"
629631
apiVersion: destination.connectivity.api.sap/v1
630632
kind: Destination
631633
metadata:
632-
name: dynamic-destination
634+
name: gateway
633635
spec:
634636
destinationRef:
635637
name: '*'
@@ -664,36 +666,29 @@ In your application you can now configure a destination to execute requests:
664666
defaultValue="single"
665667
values={[
666668
{label: "Individual Destination", value: "single"},
667-
{label: "Dynamic Desitnations", value: "dynamic"}
669+
{label: "Destination Gateway", value: "gateway"}
668670
]}>
669671
<TabItem value="single">
670672

671673
```java
672-
DefaultHttpDestination destination = DefaultHttpDestination
673-
.builder("http://my-destination.namespace/")
674-
// for a subscriber tenant make sure to send the tenant header:
675-
// .header(new Header("X-Tenant-Id", TenantAccessor.getCurrentTenant().getTenantId()))
676-
// for principal propagation make sure to set the auth type to "TOKEN_FORWARDING":
677-
// .authenticationType(AuthenticationType.TOKEN_FORWARDING)
678-
.build();
674+
TransparentProxyDestination destination = TransparentProxyDestination
675+
.destination(<destination-custom-resource-name>.<destination-custom-resource-namespace>)
676+
.header("X-Custom-Header", "custom-value")
677+
.property("some-property-key", "some-value")
678+
.build();
679679
680680
List<SalesArea> execute = new DefaultSalesAreaService().getAllSalesArea() // example OData request
681681
.execute(destination);
682682
```
683683

684684
</TabItem>
685-
<TabItem value="dynamic">
685+
<TabItem value="gateway">
686686

687687
```java
688-
DefaultHttpDestination destination = DefaultHttpDestination
689-
.builder("http://dynamic-destination.namespace/")
690-
// use the name of the desitnation you configured in the BTP Cockpit
691-
.header(new Header("X-Destination-Name", "my-destination"))
692-
// for a subscriber tenant make sure to send the tenant header:
693-
// .header(new Header("X-Tenant-Id", TenantAccessor.getCurrentTenant().getTenantId()))
694-
// for principal propagation make sure to set the auth type to "TOKEN_FORWARDING":
695-
// .authenticationType(AuthenticationType.TOKEN_FORWARDING)
696-
.build();
688+
TransparentProxyDestination destination = TransparentProxyDestination
689+
.gateway("my-destination", <destination-custom-resource-name>.<destination-custom-resource-namespace>)
690+
.fragmentName("my-fragment")
691+
.build();
697692
698693
List<SalesArea> execute = new DefaultSalesAreaService().getAllSalesArea() // example OData request
699694
.execute(destination);
@@ -702,7 +697,9 @@ List<SalesArea> execute = new DefaultSalesAreaService().getAllSalesArea() // exa
702697
</TabItem>
703698
</Tabs>
704699

705-
- Replace `namespace` in the URL with the namespace you installed the Transparent Proxy into.
700+
:::info Destination Custom Resource access
701+
`<destination-custom-resource-namespace>` can be omitted if the destination custom resource is created in the same namespace as the application workload.
702+
:::
706703

707704
The code above shows an example how you can then use the `destination` object to perform an OData request against the system.
708705

@@ -739,3 +736,7 @@ try {
739736
- `X-Request-Id` is sent with the response in all requests, both successful and failed
740737

741738
</details>
739+
740+
## Related Documentation
741+
742+
[Transparent Proxy Integration with SAP Cloud SDK](/docs/java/features/connectivity/transparent-proxy)

0 commit comments

Comments
 (0)