|
| 1 | +# Before you start |
| 2 | + |
| 3 | +Make sure you have [Kubernetes](https://kubernetes.io/docs/tasks/tools/) and [Helm](https://helm.sh/docs/intro/install/) installed. |
| 4 | + |
| 5 | +Download and install the FaasNet CLI tool : |
| 6 | + |
| 7 | +1. Download your [desired version](https://github.com/simpleidserver/FaasNet/releases). |
| 8 | +2. Unpack it. |
| 9 | +3. Add the Directory path into the PATH environment variable. |
| 10 | + |
| 11 | +# Start FaasNet |
| 12 | + |
| 13 | +Open a command prompt and create a `faas` namespace in kubernetes. |
| 14 | + |
| 15 | +``` |
| 16 | +kubectl create namespace faas |
| 17 | +``` |
| 18 | + |
| 19 | +Install and launch the `faasnet` project. |
| 20 | + |
| 21 | +``` |
| 22 | +helm repo add faasnet https://simpleidserver.github.io/FaasNet/charts/ |
| 23 | +helm install my-faasnet faasnet/faasnet --version 0.0.1 --namespace=faas |
| 24 | +``` |
| 25 | + |
| 26 | +# Deploy and execute your first API operation |
| 27 | + |
| 28 | +Before starting, an SQLServer database should be deployed in kubernetes. |
| 29 | + |
| 30 | +``` |
| 31 | +kubectl apply -f https://raw.githubusercontent.com/simpleidserver/FaasNet/master/kubernetes/run-mssql.yml --namespace=faas |
| 32 | +kubectl apply -f https://raw.githubusercontent.com/simpleidserver/FaasNet/master/kubernetes/mssql-external-svc.yml --namespace=faas |
| 33 | +kubectl apply -f https://raw.githubusercontent.com/simpleidserver/FaasNet/master/kubernetes/mssql-internal-svc.yml --namespace=faas |
| 34 | +``` |
| 35 | + |
| 36 | +Authenticate to the SQLServer database `127.0.0.1, 30002` with the following credentials : |
| 37 | + |
| 38 | +| Parameter | Value | |
| 39 | +| --------- | ------------ | |
| 40 | +| Login | sa | |
| 41 | +| Password | D54DE7hHpkG9 | |
| 42 | + |
| 43 | +Add a new `OpenID` database schema, create the table `[dbo].[Acrs]` and insert some data. |
| 44 | + |
| 45 | +``` |
| 46 | +CREATE DATABASE OpenID; |
| 47 | +CREATE TABLE [OpenID].[dbo].[Acrs]( |
| 48 | + [Id] [uniqueidentifier] NULL, |
| 49 | + [Name] [nvarchar](255) NULL |
| 50 | +) ON [PRIMARY] |
| 51 | +GO |
| 52 | +INSERT INTO [OpenID].[dbo].[Acrs] VALUES (NEWID(), 'acr1') |
| 53 | +INSERT INTO [OpenID].[dbo].[Acrs] VALUES (NEWID(), 'acr2') |
| 54 | +INSERT INTO [OpenID].[dbo].[Acrs] VALUES (NEWID(), 'acr3') |
| 55 | +``` |
| 56 | + |
| 57 | +Deploy your first API operation. If there is no error during the deployment then the message `Configuration is applied` is displayed. |
| 58 | + |
| 59 | +``` |
| 60 | +FaasNet.CLI.exe apply -u https://raw.githubusercontent.com/simpleidserver/FaasNet/master/faasnet.yml |
| 61 | +``` |
| 62 | + |
| 63 | +Open Postman or an another tool, execute the HTTP POST request against `http://localhost:30001/clients`. |
0 commit comments