fleetcom

by loafoe

Helm chartv0.1.27App 0.76.3

fleetcom - OIDC-protected web UI over the k3s-on-ec2 fleet API (clusters, accounts, hosted zones, jobs with live logs, workers)

About this chart

fleetcom

fleetcom - OIDC-protected web UI over the k3s-on-ec2 fleet API (clusters, accounts, hosted zones, jobs with live logs, workers)

fleetcom from loafoe/k3s-on-ec2 (docs/FLEETCOM.md there) is the web UI of the fleet API (chart k3s-fleet), with Centcom's look: clusters with their spec, outputs and control plane, accounts, hosted zones, jobs with the log followed live, workers. It changes nothing: it reads, and the one thing it queues is a zones check, which only reads Route53 and DNS.

  • Login: OIDC authorization code flow with PKCE. By default fleetcom logs in as the fleet API's own client (issuer and client ID from the API's /auth/config), so the ID token carries the API's audience, and forwards it to the API: the API's group and connector checks decide what each user sees.
  • Stateless: tokens live in sealed, HttpOnly cookies. Replicas only need to share the session key.
  • Sign-out at dex (oidc.logoutAtIssuer): with a dex client of fleetcom's own (oidc.clientId, refreshTokenLifetime: session, listed in the API client's trustedPeers), signing out ends the dex session and revokes fleetcom's refresh token. fleetcom asks for the API's audience with dex's cross-client scope, so its tokens still reach the API.

Prerequisites

  • The fleet API, reachable from fleetcom (fleetApi.url, e.g. the k3s-fleet chart's Service).

  • The redirect URI <baseUrl>/callback registered on the OIDC client fleetcom logs in with. For dex and the fleet API's public client:

    redirectURIs:
      - /device/callback                         # fleetctl
      - https://fleetcom.example.com/callback    # fleetcom
    
  • A session key shared by the replicas: session.key.generate (needs the external-secrets operator: a Password generator fills the Secret once), session.key.existingSecret, or session.key.value.

Example

fleetApi:
  url: http://k3s-fleet-api.k3s-fleet.svc
baseUrl: https://fleetcom.example.com
session:
  key:
    generate: true
httpRoute:
  enabled: true
  parentRefs: [{name: platform, namespace: kube-system}]
  hostnames: [fleetcom.example.com]

Values

KeyTypeDefaultDescription
affinityobject{}
baseUrlrequired""fleetcom's public URL, e.g. https://fleetcom.example.com. The OIDC redirect URI is /callback: register it on the OIDC client.
extraEnvlist[]Extra environment variables for the container
fleetApi.urlrequired""How fleetcom reaches the fleet API, e.g. the k3s-fleet chart's Service: http://k3s-fleet-api.k3s-fleet.svc
fullnameOverridestring""
httpRoute.annotationsobject{}
httpRoute.enabledboolfalseExpose fleetcom with a Gateway API HTTPRoute
httpRoute.hostnameslist[]Hostnames, e.g. [fleetcom.example.com]; baseUrl must be one of them
httpRoute.parentRefsrequired when enabled[]Gateways to attach to, e.g. [{name: platform, namespace: kube-system}]
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"ghcr.io/loafoe/fleetcom"Image repository
image.tagstring""Defaults to the chart appVersion
imagePullSecretslist[]Image pull secrets (the image is public)
nameOverridestring""
nodeSelectorobject{}
oidc.clientIdstring""Client ID. Empty: the fleet API's audience, the client fleetctl logs in with. Tokens must carry the API's audience, so keep the default unless the API accepts another client.
oidc.clientSecret.existingSecretstring""Secret with the client secret, for a confidential client. Empty: a public client (PKCE)
oidc.clientSecret.keystring"client-secret"Key in that Secret
oidc.groupsClaimstring""Groups claim shown on the profile and access-denied pages. Empty: the fleet API's
oidc.issuerstring""Issuer URL. Empty: the fleet API's (its /auth/config)
oidc.logoutAtIssuerboolfalseSign-out also ends the issuer's session (RP-initiated logout at its end_session_endpoint). With dex this revokes the refresh tokens of a session-bound client, so give fleetcom a client of its own (clientId) with refreshTokenLifetime: session, trusted by the API's client (trustedPeers). Requires an issuer that advertises end_session_endpoint.
oidc.scopeslist[]Scopes. Empty: openid, email, profile, groups, offline_access plus what /auth/config asks for
podAnnotationsobject{}
podDisruptionBudget.enabledbooltrueKeep one replica through voluntary disruptions (only rendered with replicas > 1)
podDisruptionBudget.minAvailableint1
podLabelsobject{}
podSecurityContext.runAsGroupint65532
podSecurityContext.runAsNonRootbooltrue
podSecurityContext.runAsUserint65532
podSecurityContext.seccompProfile.typestring"RuntimeDefault"
replicasint2Replicas. More than one needs a shared session key (session.key)
resources.limits.memorystring"128Mi"
resources.requests.cpustring"10m"
resources.requests.memorystring"32Mi"
securityContext.allowPrivilegeEscalationboolfalse
securityContext.capabilities.drop[0]string"ALL"
securityContext.readOnlyRootFilesystembooltrue
service.portint80Service port
service.typestring"ClusterIP"Service type
serviceAccount.annotationsobject{}
serviceAccount.createbooltrueCreate a ServiceAccount (fleetcom needs no Kubernetes API access; its token is not mounted)
serviceAccount.namestring""Defaults to the fullname
session.key.existingSecretstring""Existing Secret with the key (at least 32 random characters, e.g. openssl rand -base64 32)
session.key.existingSecretKeystring"session-key"Key in that Secret
session.key.generateboolfalseGenerate the key once with External Secrets' Password generator into -session (the external-secrets operator must be installed). Never rotated by itself: delete the Secret to rotate (everyone logs in again).
session.key.valuestring""The key inline; the chart keeps it in a Secret. Prefer generate or existingSecret
session.ttlstring"12h"How long a login lasts, token renewals included
tolerationslist[]
topologySpreadConstraintslist[]Spread constraints; the selector labels are filled in when labelSelector is omitted
versionstring""Shown in the sidebar. Empty: the image tag

Autogenerated from chart metadata using helm-docs v1.14.2

Deploy fleetcom with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has fleetcom on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartfleetcom is pinned at v0.1.27 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply