Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Properties
hiddentrue
idPROGRESSDONE

Product Version2020 Winter
Report Note
AssigneeAntje

Resources & Remarks

Modification History

NameDateProduct VersionAction
Antje Oelschlägel01 MAR 20212020 WinterPage created and written.


...

Section
bordertrue


Column

Table of Contents

Table of Contents
exclude(Table of Contents|Read on|Authentication against the Core API|Access Authorization for Endpointsand Permissions|Kubernetes Installation Guide)


Introduction

The AUTHENTICATION service manages the access to the yuuvis® Momentum API gateway. With a suitable configuration, also the access to external services running in the same Kubernetes cluster can be managed via the AUTHENTICATION service of yuuvis® Momentum.

...

The service has its own endpoints that are configured in the file authentication-prod.yml in the sections routing.endpoints and authorization.accesses.

Only The AUTHENTICATION service endpoints are only available for endpoints listed in routing.endpoints the AUTHENTICATION service endpoints are available.

In authorization.accesses, permissions can be defined for the access to the individual endpoints and sub-paths.
>> Access Authorization for Endpointsauthentication-prod.yml

API Gateway

The API gateway uses the Spring Cloud Kubernetes DiscoveryClient in order to dynamically create routes. This DiscoveryClient sends requests to the Kubernetes API. The corresponding permissions are configured via the Kubernetes objects ServiceAccount, RoleBinding and Role.

...

In order to create a route for a service in the API gateway, in the file authentication-service.yaml (question) in the section labels the entry yuuvis: true has to be added in the <externalservice>-service.yaml file in the labels section.

Example Configuration

In this example scenario, the required steps of configuration are shown. Afterwards, the external service app in the namespace other will be available via the AUTHENTICATION service.

...

  • Deploy the pod for the external service app in the namespace other

    Code Block
    languageyml
    titleapp-deployment.yaml
    linenumberstrue
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      namespace: other
      name: app
    spec:
      replicas: 1
      selector:
        matchLabels:
          name: app
      template:
        metadata:
          labels:
            name: app
        spec:
          containers:
          - name: app
          ...
            ports:
            - containerPort: 80
          ...
    
    


  • Create a Kubernetes Service for cognisphere (question) app in the namespace other, e.g., app-svc.

    Code Block
    languageyml
    titleservice in the namespace otherapp-service.yaml
    linenumberstrue
    apiVersion: v1
    kind: Service
    metadata:
      name: app-svc
      labels:
      name: app-svc
      namespace: other
    spec:
      ports:
      - name: "http"
         port: 80
         targetPort: 80
      selector:
         name: app
      type: ClusterIP


  • Create the Kubernetes Service in the namespace yuuvis. Use the type externalName that references the namespace other.

    Code Block
    languageyml
    titleservice im namespace yuuvis type externalName:<externalservice>-service.yaml
    linenumberstrue
    apiVersion: v1
    kind: Service
    metadata:
      name: app
      labels:
        yuuvis: "true"
      namespace: yuuvis
    spec:
      type: ExternalName
      externalName: app-svc.other.svc.cluster.local
      ports:
      - port: 80
    
    


  • Add the external service app to the sections routing.endpoints: and routing.access: in the file authentication-prod.yml file.

    Code Block
    languageyml
    titleauthentiaction-prod.yml
    linenumberstrue
    routing.endpoints:
      - 'app' # external service added to the list
    ...
    authorization.accesses:
      - endpoints: /app/** # add
      # optionally restrict to a method, e.g.: method: Post
      # optionally restrict to users with specific roles, e.g.: hasAuthority('COGNISPHERE')


  • Restart the AUTHENTICATION service.


Summary

External services running in the same Kubernetes cluster together with yuuvis® Momentum, access authorization can be managed via the AUTHENTICATION service. The required configuration steps were shown for an example scenario.

Info
iconfalse

Read on

Section


Column
width25%
Kubernetes

Installation Guide

Insert excerpt
Kubernetes Installation GuideKubernetes
Installation Guide
nopaneltrue
 Keep reading


Column
width25%

Access Authorization

for Endpoints

and Permissions

Insert excerpt
Access Authorization for Endpointsand Permissions
Access Authorization for Endpointsand Permissions
nopaneltrue
 Keep reading


Column
width25%

Authentication against the Core API

Insert excerpt
Authentication against the Core API
Authentication against the Core API
nopaneltrue
 Keep reading



...