Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Como Kubernetes Operators pode me ajudar na cri...

Como Kubernetes Operators pode me ajudar na criação e testes de APIs usando Open API Specification

Vou fazer uma breve introdução a definição de Operators Patterns, criando um operador que pode ajudar na criação, definição e testes/mocks de APIs habilitando a utilizacao do conceito denominado API First Design bastante importante na criacao de APIs X Microservices.

More Decks by Claudio Eduardo de Oliveira

Other Decks in Programming

Transcript

  1. K8s Operators & Open APIs Como Kubernetes Operators pode me

    ajudar na criação e testes de APIs usando Open API Specification
  2. 1 - Open API Spec 4 - Putting all together

    3 - k8s Operator 2 - API First Principle Agenda Agenda
  3. Things to think about... ▰ Microservices are developed by !=

    teams (communication) ▰ Many interactions between services ▰ Ecosystem turns to complex and hard to understand
  4. The OpenAPI Specification (OAS) defines a standard, programming language-agnostic interface

    description for REST APIs, which allows both humans and computers to discover and understand the capabilities of a service without requiring access to source code What is Open API Spec
  5. What API First Means??? An API-first approach means that for

    any given development project, your APIs are treated as “first-class citizens.”
  6. Your API should be designed with with users in mind.

    Think in consumption in first place.
  7. How it works??? An API-first approach involves developing APIs that

    are consistent and reusable, which can be accomplished by using an API description language to establish a contract for how the API is supposed to behave
  8. Advantages ▰ Increase the speed to market ▰ Ensures good

    developer experiences Development teams can work in parallel How to achieve it???
  9. API Mocks can be a good way to deliver API

    consumption for other teams
  10. Open API has a example section that make our service

    clearer to consumption also we can use some tool to help with mocks
  11. Kubernetes Controllers Kubernetes controllers receive these events and then we

    can extend kubernetes features It is a program that can react a k8s events golang, python, java...etc
  12. Custom Resource A resource is an endpoint in the Kubernetes

    API that stores a collection of API objects of a certain kind POD is built-in Kind Deployment is built-in Kind Service is built-in Kind APIMock is not a built-in kind is a Custom Resource
  13. CRD is the way to tell instructions to kubernetes some

    Custom Resources properties like “template”
  14. k8s Operator “An Operator is a Controller that uses a

    CRD to encapsulate operational knowledge for a specific application in an algorithmic and automated form. The Operator pattern allows us to extend the Controller pattern from the preceding chapter for more flexibility and greater expressiveness.” from Kubernetes Patterns Book