@@ -86,15 +86,20 @@ To add an existing Kubernetes cluster to your project:
...
@@ -86,15 +86,20 @@ To add an existing Kubernetes cluster to your project:
1. Click **Add Kubernetes cluster**.
1. Click **Add Kubernetes cluster**.
1. Click **Add an existing Kubernetes cluster** and fill in the details:
1. Click **Add an existing Kubernetes cluster** and fill in the details:
-**Kubernetes cluster name** (required) - The name you wish to give the cluster.
-**Kubernetes cluster name** (required) - The name you wish to give the cluster.
-**Environment scope** (required)- The
-**Environment scope** (required)- The
[associated environment](#setting-the-environment-scope) to this cluster.
[associated environment](#setting-the-environment-scope) to this cluster.
-**API URL** (required) -
-**API URL** (required) -
It's the URL that GitLab uses to access the Kubernetes API. Kubernetes
It's the URL that GitLab uses to access the Kubernetes API. Kubernetes
exposes several APIs, we want the "base" URL that is common to all of them,
exposes several APIs, we want the "base" URL that is common to all of them,
e.g., `https://kubernetes.example.com` rather than `https://kubernetes.example.com/api/v1`.
e.g., `https://kubernetes.example.com` rather than `https://kubernetes.example.com/api/v1`.
-**CA certificate** (optional) -
-**CA certificate** (requried) - A valid Kubernetes certificate is needed to authenticate to the EKS cluster. We will use the certificate created by default.
If the API is using a self-signed TLS certificate, you'll also need to include
- List the secrets with `kubectl get secrets`, and one should named similar to
the `ca.crt` contents here.
`default-token-xxxxx`. Copy that token name for use below.
- Get the certificate by running this command:
```sh
kubectl get secret <secret name> -o jsonpath="{['data']['ca\.crt']}" | base64 --decode
```
- **Token** -
- **Token** -
GitLab authenticates against Kubernetes using service tokens, which are
GitLab authenticates against Kubernetes using service tokens, which are
scoped to a particular `namespace`.
scoped to a particular `namespace`.
...
@@ -102,36 +107,81 @@ To add an existing Kubernetes cluster to your project:
...
@@ -102,36 +107,81 @@ To add an existing Kubernetes cluster to your project:
2. Using a web-based tool (ie. postman, restlet, etc)
![function exection](img/function-execution.png)
## Deploying Serverless applications
## Deploying Serverless applications
> Introduced in GitLab 11.5.
> Introduced in GitLab 11.5.
NOTE: **Note:**
NOTE: **Note:**
You can reference the sample [Knative Ruby App](https://gitlab.com/knative-examples/knative-ruby-app) to get started.
You can reference and import the sample [Knative Ruby App](https://gitlab.com/knative-examples/knative-ruby-app) to get started.
Add the following `.gitlab-ci.yml` to the root of your repository
Add the following `.gitlab-ci.yml` to the root of your repository
(you may skip this step if using the sample [Knative Ruby App](https://gitlab.com/knative-examples/knative-ruby-app) mentioned above):
(you may skip this step if using the sample [Knative Ruby App](https://gitlab.com/knative-examples/knative-ruby-app) mentioned above):
...
@@ -236,11 +255,7 @@ With all the pieces in place, the next time a CI pipeline runs, the Knative appl
...
@@ -236,11 +255,7 @@ With all the pieces in place, the next time a CI pipeline runs, the Knative appl
### Obtain the URL for the Knative deployment
### Obtain the URL for the Knative deployment
Go to the **Operations > Serverless** page to find the URL for your deployment in the **Domain** column.
Go to the **CI/CD > Pipelines** and click on the pipeline that deployed your app. Once all the stages of the pipeline finish, click the **deploy** stage.
![app domain](img/app-domain.png)
Alternatively, use the CI/CD deployment job output to obtain the deployment URL. Once all the stages of the pipeline finish, click the **deploy** stage.