@mashroom/mashroom-portal-remote-app-registry-k8s
A Mashroom Portal plugin that scans for Remote Portal Apps in a Kubernetes cluster
Last updated a month ago by jkofler .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mashroom/mashroom-portal-remote-app-registry-k8s 
SYNC missed versions from official npm registry.

Mashroom Portal Remote App Registry for Kubernetes

Plugin for Mashroom Server, a Integration Platform for Microfrontends.

Adds a remote app registry to Mashroom Portal. Scans periodically Kubernetes namespaces for services that expose Remote Portal Apps (actually it scans for exposed /package.json containing a mashroom property). You can find an example remote app here: Mashroom Demo Remote Portal App.

Usage

If node_modules/@mashroom is configured as plugin path just add @mashroom/mashroom-portal-remote-app-registry-k8s as dependency.

You can override the default config in your Mashroom config file like this:

{
  "plugins": {
      "Mashroom Portal Remote App Registry Kubernetes": {
          "k8sNamespaces": ["default"],
          "scanPeriodSec": 30,
          "refreshIntervalSec": 300,
          "serviceNameFilter": "(microfrontend-|widget-)",
          "accessViaClusterIP": false
        }
    }
}
  • k8sNamespaces: The Kubernetes namespaces to scan (Default: ["default"])
  • scanPeriodSec: The interval in seconds for scans (Default: 30)
  • checkIntervalSec: The time in seconds after that a registered services show be re-checked (Default: 300)
  • serviceNameFilter: A regular expression for services that should be checked (case insensitive). (Default: ".*")
  • accessViaClusterIP: Access services via IP address and not via <name>.<namespace> (Default: false)

The list of successful registered services will be available on http://<host>:<port>/portal-remote-app-registry-kubernetes

Setup Kubernetes access

In order to allow Mashroom to fetch services for given namespaces you need to attach a Kubernetes Service Account with the correct permissions to the deployment.

Create a role with the required permissions like this:

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
    name: list-services-cluster-role
rules:
    -   apiGroups:
            - ""
        resources:
            - services
        verbs:
            - get
            - list

And then create the Service Account and attach the role:

apiVersion: v1
kind: ServiceAccount
metadata:
    name: mashroom-portal
    namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
    name: mashroom-portal-role-binding
    namespace: default
subjects:
    -   kind: ServiceAccount
        name: mashroom-portal
roleRef:
    kind: ClusterRole
    name: list-services-cluster-role
    apiGroup: rbac.authorization.k8s.io

And in your deployment resource just state the Service Account name:

apiVersion: apps/v1
kind: Deployment
metadata:
    name: mashroom-portal
    namespace: default
spec:
    # ...
    template:
        # ...
        spec:
            containers:
                - name: mashroom-portal
                # ...
            serviceAccountName: mashroom-portal

Current Tags

  • 1.4.5                                ...           latest (a month ago)

9 Versions

  • 1.4.5                                ...           a month ago
  • 1.4.4                                ...           a month ago
  • 1.4.3                                ...           a month ago
  • 1.4.2                                ...           a month ago
  • 1.4.1                                ...           a month ago
  • 1.4.0                                ...           2 months ago
  • 1.3.2                                ...           3 months ago
  • 1.3.1                                ...           4 months ago
  • 1.3.0                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 33
Dependencies (5)
Dev Dependencies (12)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |