Skip to content

Commit

Permalink
Updated RE chart in Controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymongib committed Sep 10, 2018
1 parent 199eb81 commit 11487d9
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
description: Gateway helm chart for Kubernetes
description: Remote Environment helm chart for Kubernetes
name: gateway
version: 0.0.1
version: 0.0.1
Original file line number Diff line number Diff line change
@@ -1,70 +1,35 @@
```
_ _ _ _ _____ _
/\ | (_) | | (_) / ____| | |
/ \ _ __ _ __ | |_ ___ __ _| |_ _ ___ _ __ | | ___ _ __ _ __ ___ ___| |_ ___ _ __
/ /\ \ | '_ \| '_ \| | |/ __/ _` | __| |/ _ \| '_ \ | | / _ \| '_ \| '_ \ / _ \/ __| __/ _ \| '__|
/ ____ \| |_) | |_) | | | (_| (_| | |_| | (_) | | | | | |___| (_) | | | | | | | __/ (__| || (_) | |
/_/ \_\ .__/| .__/|_|_|\___\__,_|\__|_|\___/|_| |_| \_____\___/|_| |_|_| |_|\___|\___|\__\___/|_|
| | | |
|_| |_|
_____ _ ______ _ _
| __ \ | | | ____| (_) | |
| |__) |___ _ __ ___ ___ | |_ ___ | |__ _ ____ ___ _ __ ___ _ __ _ __ ___ ___ _ __ | |_ ___
| _ // _ \ '_ ` _ \ / _ \| __/ _ \ | __| | '_ \ \ / / | '__/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __/ __|
| | \ \ __/ | | | | | (_) | || __/ | |____| | | \ V /| | | | (_) | | | | | | | | | __/ | | | |_\__ \
|_| \_\___|_| |_| |_|\___/ \__\___| |______|_| |_|\_/ |_|_| \___/|_| |_|_| |_| |_|\___|_| |_|\__|___/
```

## Overview

An Application Connector connects an external solution to Kyma.
A Remote Environment (RE) is a representation of an external solution connected to Kyma. The Application Connector manages the traffic, connection, security, and Events of REs. It is a proprietary implementation that consists of four services.
Read the [Application Connector documentation](../../docs/application-connector/docs/001-overview-application-connector.md) for more details regarding the implementation.

## Details

An Application Connector contains a Remote Environment Custom Resource Definition (CRD) and the Gateway service, exposed over the Ingress-Nginx controller, which handles the connection between Kyma and the external solution.
This directory contains the Remote Environment Helm chart that creates a new RE. Additionally, the chart installs the Gateway Service and all of the Ingresses required to access Application Connector services in the context of the created RE. A single RE allows to connect a single external solution to Kyma.

### Remote Environment CRD
### Customize the Gateway Service installation

The CRD contains the information about a given Remote Environment, as well as the connected external solution and the Event Bus configuration. For more information, see the [Remote Environment definition](https://github.com/kyma-project/kyma/blob/master/docs/application-connector/docs/014-details-remote-environment.md) document.

### Gateway

Gateway is a Kyma core component that proxies events and HTTP requests to and from Kyma.
To define ports, adjust the `values.yaml` file.

The Gateway has the following parameters:
Edit the [`values`](./values.yaml) file to customize the installation of the Gateway Service.
You can adjust these parameters:

- **proxyPort** - This port proxies calls from services and lambdas to an external solution. The default port is `8080`.
- **externalAPIPort** - This port exposes the Gateway API to an external solution. The default port is `8081`.
- **eventsTargetURL** - The URL to proxy incoming events. The default URL is `http://localhost:9000`.
- **remoteEnvironment** - The Remote Environment to read and write information about the services. The default Remote Environment is `default-ec`.
- **remoteEnvironment** - The RE to read and write information about the services. The default RE is `default-ec`.
- **namespace** - The Namespace to which you deploy the Gateway. The default Namespace is `kyma-system`.
- **requestTimeout** - A time-out for requests sent through the Gateway. Provide it in seconds. The default time-out is `1`.
- **skipVerify** - The flag to skip the verification of certificates for the proxy targets. The default value is `false`.

The Gateway has the parameters for the Event API which correspond to the fields in the [Remote Environment](https://github.com/kyma-project/kyma/blob/master/docs/application-connector/docs/014-details-remote-environment.md):

Additionally, you can adjust the parameters used in the communication with the Event Service:
- **sourceEnvironment** - The Event source environment name.
- **sourceType** - The Event source type.
- **sourceNamespace** - The organization that publishes the Event.

### Installation

By default, Kyma comes with these Application Connector installed in the `kyma-integration` Namespace:

- ec-default
- hmc-default

#### Install an Application Connector manually

Use the Helm chart to install an additional Application Connector.

``` bash
helm install --name remote-environment-name --set deployment.args.sourceType=commerce --set global.isLocalEnv=false --namespace kyma-integration ./resources/remote-environments
```

For installations on Minikube, provide the NodePort as shown in this example:

``` bash
helm install --name remote-environment-name --set deployment.args.sourceType=commerce --set global.isLocalEnv=true --set service.externalapi.nodePort=32001 --namespace kyma-integration ./resources/remote-environments
```

The user can override the following parameters:

- **sourceEnvironment**
- **sourceType**
- **sourceNamespace**
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,12 @@ spec:
- "/gateway"
- "--proxyPort={{ .Values.deployment.args.proxyPort }}"
- "--externalAPIPort={{ .Values.deployment.args.externalAPIPort }}"
- "--eventsTargetURL={{ .Values.deployment.args.eventsTargetURL }}"
- "--remoteEnvironment={{ .Release.Name }}"
- "--namespace={{ .Release.Namespace }}"
- "--requestTimeout={{ .Values.deployment.args.requestTimeout }}"
- "--skipVerify={{ .Values.deployment.args.skipVerify }}"
- "--proxyTimeout={{ .Values.deployment.args.proxyTimeout }}"
- "--proxyCacheTTL={{ .Values.deployment.args.proxyCacheTTL }}"
- "--sourceNamespace={{ .Values.deployment.args.sourceNamespace }}"
- "--sourceType={{ .Values.deployment.args.sourceType }}"
- "--sourceEnvironment={{ .Values.deployment.args.sourceEnvironment }}"
- "--requestLogging={{ .Values.deployment.args.requestLogging }}"
readinessProbe:
httpGet:
Expand All @@ -56,3 +52,54 @@ spec:
name: proxy-port
- containerPort: {{ .Values.deployment.args.externalAPIPort }}
name: ext-api-port
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Release.Name }}-event-service
labels:
app: {{ .Release.Name }}-event-service
release: {{ .Release.Name }}-event-service
heritage: {{ .Release.Service }}-event-service
spec:
replicas: 1
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
template:
metadata:
annotations:
sidecar.istio.io/inject: "true"
labels:
app: {{ .Release.Name }}-event-service
release: {{ .Release.Name }}-event-service
spec:
containers:
- name: {{ .Release.Name }}-event-service
image: "{{ .Values.global.containerRegistry.path }}/{{ .Values.eventService.deployment.image.name }}:{{ .Values.eventService.deployment.image.tag }}"
imagePullPolicy: {{ .Values.eventService.deployment.image.pullPolicy }}
args:
- "/eventservice"
- "--externalAPIPort={{ .Values.eventService.deployment.args.externalAPIPort }}"
- "--eventsTargetURL={{ .Values.eventService.deployment.args.eventsTargetURL }}"
- "--requestTimeout={{ .Values.eventService.deployment.args.requestTimeout }}"
- "--requestLogging={{ .Values.eventService.deployment.args.requestLogging }}"
- "--sourceNamespace={{ .Values.eventService.deployment.args.sourceNamespace }}"
- "--sourceType={{ .Values.eventService.deployment.args.sourceType }}"
- "--sourceEnvironment={{ .Values.eventService.deployment.args.sourceEnvironment }}"
readinessProbe:
httpGet:
path: /v1/health
port: {{ .Values.eventService.deployment.args.externalAPIPort }}
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
httpGet:
path: /v1/health
port: {{ .Values.eventService.deployment.args.externalAPIPort }}
initialDelaySeconds: 10
periodSeconds: 10
ports:
- containerPort: {{ .Values.eventService.deployment.args.externalAPIPort }}
name: http-api-port
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
paths:
- path: /{{ .Release.Name }}/v1/events
backend:
serviceName: {{ .Release.Name }}-gateway-external-api
serviceName: {{ .Release.Name }}-event-service-external-api
servicePort: 8081
- path: /{{ .Release.Name }}/v1/metadata
backend:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,24 @@ spec:
selector:
app: {{ .Release.Name }}-gateway
release: {{ .Release.Name }}-gateway
---
apiVersion: v1
kind: Service
metadata:
annotations:
"auth.istio.io/{{ .Values.eventService.service.externalapi.port }}": NONE
name: {{ .Release.Name }}-event-service-external-api
labels:
remoteEnvironment: {{ .Release.Name }}
app: {{ .Release.Name }}-event-service
release: {{ .Release.Name }}-event-service
heritage: {{ .Release.Service }}-event-service
spec:
type: ClusterIP
ports:
- port: {{ .Values.eventService.service.externalapi.port }}
protocol: TCP
name: http-api-port
selector:
app: {{ .Release.Name }}-event-service
release: {{ .Release.Name }}-event-service
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apiVersion: v1
kind: Pod
metadata:
name: test-{{.Release.Name }}-acceptance
name: test-{{.Release.Name }}-event-service-acceptance
annotations:
"helm.sh/hook": test-success
labels:
"helm-chart-test": "true"
spec:
containers:
- name: test-{{.Release.Name }}-acceptance
- name: test-{{.Release.Name }}-event-service-acceptance
image: "{{ .Values.global.containerRegistry.path }}/{{ .Values.acceptanceTest.image.name }}:{{ .Values.acceptanceTest.image.tag }}"
imagePullPolicy: {{ .Values.acceptanceTest.image.pullPolicy }}
resources:
Expand All @@ -18,7 +18,7 @@ spec:
memory: 900Mi
env:
- name: GATEWAY_URL
value: http://{{.Release.Name }}-gateway-external-api.{{ .Release.Namespace }}.svc.cluster.local:8081
value: http://{{.Release.Name }}-event-service-external-api.{{ .Release.Namespace }}.svc.cluster.local:8081
- name: NAMESPACE
value: {{ .Release.Namespace }}
- name: REMOTE_ENVIRONMENT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,15 @@ global:
deployment:
image:
name: gateway
tag: 0.2.19
tag: 0.3.308
pullPolicy: IfNotPresent
args:
proxyPort: &proxyPort 8080
externalAPIPort: &externalAPIPort 8081
eventsTargetURL: http://core-publish.kyma-system.svc.cluster.local:8080/v1/events
requestTimeout: 10
skipVerify: false
proxyTimeout: 10
proxyCacheTTL: 120
sourceNamespace: com.org
sourceType: commerce
sourceEnvironment: stage
requestLogging: false

service:
Expand All @@ -38,3 +34,21 @@ acceptanceTest:
name: gateway-acceptance-tests
tag: 0.2.19
pullPolicy: IfNotPresent

eventService:
deployment:
image:
name: event-service
tag: 0.3.271
pullPolicy: IfNotPresent
args:
externalAPIPort: &eventServiceExternalAPIPort 8081
eventsTargetURL: http://core-publish.kyma-system.svc.cluster.local:8080/v1/events
requestTimeout: 10
requestLogging: false
sourceNamespace: com.org
sourceType: commerce
sourceEnvironment: stage
service:
externalapi:
port: *eventServiceExternalAPIPort

0 comments on commit 11487d9

Please sign in to comment.