Platform software control module (shturval-backend)

About the service

ParameterDescription
GUI namePlatform software control module
System name (identifier)shturval-backend
Cluster AssignmentShturval platform software control module (API, business logic). Includes Swagger UI for API documentation. Installed only in the management cluster.
CriticalYes
Public repository— (platform); Swagger UI - swagger-ui
Dependenciesshturval-backend-crds, shturval-ingress-controller
Namespaceshturval-backend

The service is included in the Helm chart shturval-backend. This chart also expands the permissions negotiation operator (stp-controller), which produces a bundle for OPA. The authentication and session components are in chart shturval-auth.

Contents

  1. Review
  2. Architecture
  3. Installation/deployment
  4. Diagnostics
  5. Lifecycle
  6. Service parameters

1. Review

Purpose: main software interface for platform management via HTTP API (/api/v1): clusters, groups of nodes and providers (CAP family*), namespace/workload object resources if necessary, terminals and logs, metrics, integration with the authorization loop and external configuration points. The cluster state changes at the request of the operator/API client, and not through CR approval by its own reconcilers within the process.

Features

ContourIntended use
HTTP /api/v1Main API; after exceptions for the websocket terminal, JWT middleware is used
Provider ManagementCRUD and Connection Validation for Platform Views of Infrastructure Providers
Life cycle of clusters and CAPI entitiesCreating and changing management objects through the appropriate services
Bundle of rights OPAObtaining and using authorization rules from permissions operator or a static set for docker installer
Swagger/client generationPlatform assembly artifacts; for operation it is important to have an agreed version of the scheme with the release
MetricsSeparate Prometheus HTTP server (address set by environment)

Initiation scriptsai

What’s going onWho initiatesObserved effect
API ProcessingOperator UI, Client or AutomationResponse or websocket stream; changes are possible in Kubernetes according to the handler logic
Rights bundle trackingProcess at startup (if not static bundle mode)Updating the rules for the OPA scheme built into the delivery
Cleaning up terminal sessionsBackground tasks after the router startsMaintaining terminal resource sustainability
MetricsPlane kubelet or monitoringThe assembler queries a separate bind address
Selecting a Swagger NameWhen starting based on a license tokenThe title of the API documentation may differ depending on the product edition

Limitations and implications

LimitConsequence for the administrator
Mandatory Kubernetes operator access to management clusterWithout a valid cluster client configuration, the process should not start
Silencing the API process on :8080In the standard delivery, access from outside is via Envoy/Service; ingress ports do not equal bare Go process directly
Open CORS (AllowAllOrigins) defaultThe browser/security policy is determined by the router configuration in the image

Place in the chain of command

The consumer sends an HTTPS request to the pod backend: the traffic is first processed by Envoy, which proxies it to the local process sh-backend-api on 127.0.0.1:8080. In parallel, the OPA sidecar checks authorization policies against the bundle of rights. The API process itself accesses the Kubernetes API to read and modify objects and to external URLs of partner components: authn-server, session-manager, ldap-cache, etc.

ComponentWhere it unfoldsCommunication with backend
stp-controllerChart shturval-backendGenerates an OPA bundle to check rights.
sh-authnChart shturval-authProvides authorization issuer and login-flow.
sh-session-managerChart shturval-authServes SESSION_LIST_URL and SESSION_DELETE_URL.
sh-ldap-cacheChart shturval-authServes backend HTTP requests to the LDAP user and group cache.

Key Features

CharacteristicsDescription
Binary namesh-backend-api
HTTP listeningprocess0.0.0.0:8080
Metrics addressVariable PROMETHEUS_ADDR, default :9090
NamespaceSame as the namespace of the Helm release; NAMESPACE is taken from metadata.namespace Pod
Incoming traffic authenticationJWT middleware in the router stack; authorization provider configuration is set by the environment
HTTP/2 in Go serverConfigurable outside the application via TLS/proxy layers

2. Architecture

Workload Components

ComponentKind/role in PodScopeDescription
sh-backend-apicontainernamespaceMain HTTP server of the platform
Envoy sidecarcontainernamespaceHTTP(S) terminal point before the API process
OPA sidecarcontainernamespacePolicy review; uses the current bundle rights
Metricsbuilt-in HTTP process service—Separate Gin server at address from PROMETHEUS_ADDR

The RBAC of a process in a cluster is determined by the manifests chart shturval-backend; The list of rights is not exactly duplicated here.


3. Installation / deployment

Deployment is set by Helm chart shturval-backend. The API, Envoy, OPA, Swagger UI, permissions operator components and related objects (RBAC, Service, Ingress/Envoy configuration) are created in a single release.

Note: Any changes to installation parameters must be made in concert with the platform via ShturvalServicePatch (SSP) (or an equivalent approved mechanism), without manual changes outside of platform control.


4. Diagnostics

Typical checks are as follows (NAMESPACE, DEPLOYMENT, POD substitute according to the actual installation; the Deployment name corresponds to the Helm chart values shturval-backend):

kubectl get deployment -n "${NAMESPACE}"
kubectl get pods -n "${NAMESPACE}" -o wide
kubectl describe pod -n "${NAMESPACE}" "${POD}"
kubectl logs -n "${NAMESPACE}" "${POD}" -c sh-backend-api --tail=200
kubectl logs -n "${NAMESPACE}" "${POD}" -c envoy --tail=200
kubectl logs -n "${NAMESPACE}" "${POD}" -c opa --tail=200
SymptomPossible reasonAction
The process does not startInvalid or inaccessible platform kubeconfigCheck Secret ServiceAccount and network access to apiserver
401 / client authorization deniedJWT or auth endpoint configurationCheck environment authorization settings
OPA blocks authorized user requestsOutdated bundle or bundle observer errorMake sure permissions operator and the bundle service are working
API DelaysOverload or delays to Kubernetes APICheck apiserver/etcd load and quotas

5. Life cycle

Processing path one externalHTTP request types are as follows:

StepMemberWhat the Administrator Observes
1Ingress / Service / EnvoyGetting the request to the desired service
2Gin routerMiddleware sequence: recovery, request id, logging, CORS, JWT (except for exceptions for the websocket terminal)
3HandlerBusiness transactions and possible side effects in Kubernetes
4Return responseJSON, websocket stream or file

The section does not contain reconcile, finalizers, or controller-runtime queues for the API process itself.


6. Service parameters

The configuration is set by the environment variables of the process. Variables important for the platform link:

VariablePurpose
AUTH_ENDPOINTURL / issuer of the authorization subsystem
NAMESPACEWorking platform namespace
DOCKER_INSTALLERMode of using static bundle rights instead of live file system monitoring
LOG_LEVELLogging level
PROMETHEUS_ADDRPrometheus in-process listening address
SESSION_LIST_URL, SESSION_DELETE_URLIntegration with session-manager
Series LDAP_CACHE_*Integration with ldap-cache
LICENSE_TOKENParsing the license and choosing the edition of strings in a Swagger document

Where to configure

Services and repositories → Installed services → shturval-backend → Manage. The service runs in the management cluster.