Slide 1

Slide 1 text

Deployable API infrastructure with nginx Daniel Kocot, Senior Solution Architect / Head of API Experience & Operations

Slide 2

Slide 2 text

Name: Daniel Kocot Role: Senior Solution Architect / Head of API Experience & Operations Email: Twitter: @dk_1977 LinkedIn: [email protected] https://www.linkedin.com/in/danielkocot/

Slide 3

Slide 3 text

Deployable Infrastructure based on a API description Gateways Portals Hubs Registries

Slide 4

Slide 4 text

API Mediation Architectural layer to manage, protect and enrich an API Intercepting API traffic Concept of "outer" APIs No business logic should be handled within this layers

Slide 5

Slide 5 text

OpenAPI Specification

Slide 6

Slide 6 text

OpenAPI Definition in Detail openapi: 3.0.3 servers: - url: 'http://localhost:8080' info: version: 1.0.0 title: News API contact: name: Daniel Kocot url: 'http://www.codecentric.de' email: [email protected] license: name: MIT url: 'https://www.tldrelgal.com/mit' description: An API to provide news tags: - name: news paths: /news: x-nginx-upstream: 'http://remotehost:4000' get: description: gets latest news operationId: getNews tags: - news

Slide 7

Slide 7 text

OpenAPI Map

Slide 8

Slide 8 text

Use of references with $ref local '#/components/schemas/myElement' remote 'myElement.yaml' url 'http://path/to/your/myElement.yaml'

Slide 9

Slide 9 text

Use of OpenAPI Extensions/X-Objects to handle own or vendor needs x-vendor-…​ x-…​ Supported by: root level info paths operation parameters responses tags security schemes

Slide 10

Slide 10 text

From OpenAPI Definition to Configuration as Code paths: /news: x-nginx-upstream: 'http://remotehost:4000' get: description: gets latest news operationId: getNews tags: - news responses: '200':

Slide 11

Slide 11 text

Converting YAML to JSON > npm install -g yaml2json > yaml2json specs/news.yaml

Slide 12

Slide 12 text

Parsing JSON Using a parser of choice Depending on the preferred programming language

Slide 13

Slide 13 text

Fetch information Using variables to fetch data from JSON

Slide 14

Slide 14 text

Creating nginx configuration Using templating engine (Handlebars, Mustache, …​) Writing configuration templates

Slide 15

Slide 15 text

Automation Putting everything in a CI/CD pipeline

Slide 16

Slide 16 text

No standardization (so far)

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Wrap Up Posts on codecentric blog: Posts on my blog: Posts on Medium: https://blog.codecentric.de/en/author/daniel-kocot/ https://danielkocot.github.io https://medium.com/@daniel.kocot

Slide 19

Slide 19 text

Q&A

Slide 20

Slide 20 text

Thank you

Slide 21

Slide 21 text

No content