Running Medplum Bots on Kubernetes with Fission

Fission can execute Medplum Bots on a Kubernetes cluster you control, outside AWS Lambda. This page covers when that fits, how the setup is built, and where scaling and isolation need planning.

On this page

Running Medplum Bots on Kubernetes with Fission: when the cluster is your execution layer

If your self-hosted Medplum team runs on Azure, Google Cloud or on-premises hardware, AWS Lambda is probably not available as a Bot execution layer, and you need another way to run Bots. Fission on Kubernetes is one option to evaluate. This page covers when that path fits, how it is configured, how the setup is built, and the scaling and isolation questions you must settle before running production Bots on it.

Medplum's self-hosting documentation describes Bot execution in its AWS deployment, and the Lambda-based path is the one its deployment guides lay out in detail. Any Fission-based approach is an integration you design and own, so confirm it against Medplum's current Bot documentation before you commit. Check how the Medplum server invokes Bots, what request and response contract the runtime must honor, how Bot code and its dependencies are packaged, and whether the Medplum project settings for Bot execution can point at a non-Lambda backend. The Medplum self-hosting docs are the starting point for that review, and the answers decide whether the rest of this design holds.

Once the execution path is confirmed, plan the cluster as a shared runtime. Kubernetes is an open-source platform under the Apache 2.0 license, and your existing cluster team will own its upgrades, which must move one minor version at a time. Ask who owns the Fission control plane, how Bot function packages are versioned and promoted, and which namespaces, service accounts and network policies separate Bots from the rest of the Medplum stack. Confirm how Bot credentials reach the functions, because Kubernetes Secrets are stored unencrypted in etcd by default unless you configure encryption at rest. Test scaling under the load your Subscriptions and cron jobs produce before go-live.

How a Medplum Subscription reaches a Bot running in Fission

The flow starts when a FHIR resource changes or an API call arrives at the Medplum server, which evaluates Subscriptions and Bot triggers. The hop from the Medplum server into Fission functions on Kubernetes is the step to confirm against Medplum's self-hosting and Bot documentation, because the supplied facts do not describe how the server dispatches to Fission. Results return to Medplum, which writes through PostgreSQL, with Redis as cache. Credentials should come from a secrets store, not from the function pod's environment by default, and the Kubernetes API and pod boundaries determine who can reach each function.

Trust boundaries and the unconfirmed execution hop from Medplum into Fission.

Where Fission fits: Azure, GCP and on-premises installs

A managed Kubernetes service on Azure runs the control plane for you, so your team still operates node pools, networking, upgrades and workload configuration. Medplum's Azure option is a Terraform-based deployment that its self-hosting docs mark as Beta, so treat it as a starting point to validate rather than a settled production path.

  • Control plane: A managed service operates the API server and etcd, but your team still owns node upgrades and must keep kubelets within the supported version skew of the API server.
  • Identity: Confirm whether your approved directory can issue OpenID Connect tokens for cluster access, since Kubernetes accepts OIDC bearer tokens for user authentication.
  • Secrets: Confirm which Azure secrets service is approved for PHI-adjacent workloads, and whether the Secrets Store CSI Driver is acceptable to your security team, because Kubernetes Secrets are stored unencrypted in etcd by default.
  • Beta status: Ask Medplum which parts of the Azure Terraform path are tested, who owns drift between the code and your live environment, and how upgrades are handled.

Before choosing Fission, confirm who is on call for cluster upgrades and whether the identity and secrets services it would depend on are already approved for your environment.

Execution options for Medplum Bots outside AWS

This table compares the four ways a team can execute Medplum Bots when AWS Lambda is not the default, along with who operates each option and what to confirm first. Read each row as a decision point: the fit tells you when to choose it, while the isolation and upgrade concerns tell you what your team will own after go-live.

OptionFitWho operates itMain isolation or upgrade concernConfirm with Medplum
Fission on a managed Kubernetes serviceTeams on Azure or Google Cloud that want serverless Bot execution without running control planesYour platform team operates Fission and the Bot functions, and the cloud provider operates the cluster control planeShared cluster tenancy, namespace and RBAC boundaries, and keeping Fission versions aligned with the managed cluster's release scheduleWhich Bot runtime and execution contract the Medplum version in use expects for external functions
Fission on a self-run clusterOn-premises or air-gapped installs that already run Kubernetes and need full control over network and data pathsYour team operates the Kubernetes control plane, etcd, Fission and the Bot functionsetcd backups and encryption of Secrets, node hardening, and upgrading Kubernetes one minor version at a time before FissionSupported Kubernetes versions and any Medplum-side requirements for reaching the Medplum server from the cluster
Bots on the Medplum server processSmall deployments or early pilots where operating an extra execution layer is not justifiedYour team operates the Medplum server, which runs the Bot code in the same processBot code shares resources and trust with the server, so a faulty or malicious Bot can affect the whole deploymentWhether this path is supported for your Medplum version and how it is isolated from core API traffic
AWS Lambda pathTeams that can run on AWS and want Medplum-managed or external Lambda functions with IAM boundariesYour team operates the AWS accounts, IAM roles and functions, with Medplum configuration on the serverIAM role scope for each function and sandboxing choices, which differ from the Fission modelWhich Lambda mode fits your Medplum deployment and whether your AWS account setup meets its requirements

Setting up Fission for Medplum Bots: the build sequence

This sequence takes a self-hosted Medplum deployment from a confirmed server version to a Bot running on Fission inside a Kubernetes cluster you control, with a logged execution as proof that each layer works. Each step closes with a check so problems surface before the next layer is built.

  1. Confirm the Medplum version and Bot execution options

    Record the Medplum server version you run and read the Bot execution documentation for that exact version, since the supported execution backends and their configuration can differ between releases. Your team owns this step and should confirm with Medplum which execution options are supported for your version and deployment type before any cluster work begins. You know it is done when you have a written note of the server version, the supported Bot execution backends and the configuration keys each one needs. Check the upgrade path too: self-hosted Medplum must move through each minor version in sequence, so a version that is behind may need upgrading before Fission integration is worth building.

  2. Prepare a supported Kubernetes cluster

    Choose a Kubernetes version that the Kubernetes project still supports at the time you build, and confirm it against the release page before provisioning nodes. Decide on the control plane topology: a stacked control plane or an external etcd cluster, with at least three control plane nodes and a TCP load balancer in front of kube-apiserver. Your platform or infrastructure team owns this work. Check that the cluster version sits within the version skew rules for every component and that etcd runs with an odd number of members, with a backup plan in place. You know it is done when the cluster reports a supported version, all control plane nodes are healthy and an etcd snapshot has been taken and restored in a test.

  3. Harden cluster access and secret storage

    Before installing workloads, configure how people and services authenticate to the cluster and where secrets live. Kubernetes authenticates users with X.509 certificates, bearer tokens (including OpenID Connect), webhook token authentication or an authenticating proxy, so decide which of these your identity provider supports. Enable encryption at rest for Secrets, because Kubernetes stores them unencrypted in etcd by default, and write least-privilege RBAC that restricts list and watch access to the namespaces that run Bots. Apply Pod Security Standards to those namespaces. Your security team should review the result. You know it is done when a test user without the right role cannot read Bot secrets and an encryption-at-rest check on the cluster passes.

  4. Install Fission into a dedicated namespace

    Install the Fission serverless framework into its own namespace, following the current Fission installation documentation for the release you have selected. Confirm that Fission is compatible with your Kubernetes version before installing, since the Fission release notes define the supported range. Your platform team performs the install, ideally from a version-controlled manifest or Helm values file so the configuration can be reviewed and repeated. You know it is done when the Fission controller and executor pods are running, the Fission command line tool connects to the cluster and a simple test function can be created and invoked.

  5. Configure the Bot function environment and credentials

    Create the Fission environment that will run Bot code, pinning the language runtime to the version your Bot code is built and tested against. Store the credentials each Bot needs, such as the Medplum client identifier and secret, as Kubernetes Secrets or in an external store reached through the Secrets Store CSI Driver, and grant each function only the secrets it uses. Decide whether Bots will use a dedicated client credential per Bot or a shared one, and record that decision because it drives audit and access policy later. You know it is done when a test function can read its own secret and cannot read another Bot's secret.

  6. Connect the Medplum server to the execution layer

    Set the Medplum server configuration so Bot execution requests reach the Fission environment, using the configuration keys defined in the Medplum self-hosting documentation for your version. Confirm the network path from the Medplum server pods to the Fission router, including any ingress rules, network policies and TLS settings, and restrict it to the traffic Bot execution needs. Your team coordinates this with whoever runs the Medplum deployment. You know it is done when the Medplum server can reach the Fission endpoint from its own pods and a request from the Medplum side returns a response from the function.

  7. Verify with a test Bot and a logged execution

    Deploy a small test Bot that reads one non-sensitive resource through the Medplum API, then trigger it from the Medplum side and confirm the result. Check that the execution appears in the audit trail for the Bot and that errors from a deliberately malformed input are logged and returned clearly. Record the cluster version, Fission version, Medplum version and the test results in your change record. You know it is done when the test Bot runs end to end, the execution is logged in Medplum, and a failing input produces a visible error rather than a silent failure. Use only the test data your privacy and compliance owners have approved for a non-production environment.

How scaling and isolation shape a Fission design

Two concerns drive the design: how function pods scale with Bot invocations, and how far the cluster's node capacity lets that scaling go. Each Bot invocation that Fission serves needs a function pod to handle it, so a burst of Subscription triggers, cron runs or client calls translates directly into pod demand. If the cluster has no spare node capacity, new pods stay pending and Bot executions queue or fail, and the bottleneck appears as latency rather than as an error in the Bot code. Confirm with your platform team how many nodes the cluster can add automatically, what resource requests each Fission function pod declares, and whether the cluster autoscaler is configured for your node pools. Also confirm how Fission's own router, executor and builder components are sized, since they sit in the same capacity budget.

Isolation is the second concern, and it is best handled with namespaces, RBAC and pod security settings together. Bots from different Medplum projects, or Bots that run with different access, should not share a namespace, a service account or a set of Secrets. Give each trust boundary its own namespace, bind a service account per function group, and grant only the get access to named Secrets that the Bot needs, following the least-privilege guidance for Secrets in the Kubernetes secrets good practices page. Enforce the Pod Security Standards at the namespace level, starting from the restricted profile where your Bot runtime allows it, and test that the Fission components themselves run under the profile you choose.

Test scale-up behavior with your own Subscription volume before go-live, because no generic capacity figure will match your workload. Replay a realistic sample of Subscription events, cron firings and operation calls against a staging cluster, then measure time to first response, pending pod counts and error rates as the rate rises. Repeat the test after any change to Bot size, dependencies or node pool settings. Ask your Medplum project team for the peak event rate per project, and ask your platform team to confirm the node ceiling and scale-up delay they can guarantee, so the test results can be compared against a documented limit rather than an assumption.

Security controls for Bot execution on Kubernetes

Bot execution on Kubernetes places Medplum integration logic, credentials and patient-adjacent data inside a cluster your team operates. The cards below cover the controls that decide whether that setup can pass review, and each one names what to verify before Bots run against production data.

Secrets stored unencrypted in etcd

Kubernetes stores Secrets unencrypted in etcd by default, so any Bot credential kept as a Secret is readable by anyone with access to etcd backups or the datastore. Verify that encryption at rest is enabled for Secrets in the API server configuration, and confirm that etcd snapshots taken for backup are protected with the same care as the live store. If your policy forbids cluster-stored credentials, confirm the external store path through the Secrets Store CSI Driver before Bots are deployed.

Secrets good practices

Least-privilege RBAC for Secrets

Any subject that can list or watch Secrets can read every credential in that namespace, including Medplum client credentials used by Bot functions. Verify that Role and RoleBinding objects grant only the verbs each workload needs, that Fission service accounts cannot read Secrets outside their own namespace, and that no broad cluster-admin bindings exist for CI pipelines. Review these bindings on a schedule, not only at go-live.

Operator authentication to the cluster

Kubernetes does not create user objects for people. It relies on X.509 client certificates, bearer tokens including OpenID Connect and JWT, webhook token authentication or an authenticating proxy. Confirm which method your operators use, that individual administrators sign in through your corporate identity provider, that shared kubeconfig files are retired, and that the deploy pipeline uses its own identity rather than a personal one.

Kubernetes authentication

Pod security settings

Bot runtime pods execute code written by your team, so a compromised function should not gain host access or escalate privileges. Verify that the namespaces hosting Fission functions enforce the Pod Security Standards level your review requires, that containers run as non-root with privilege escalation disabled, and that Bot pods cannot mount host paths. Test these settings against a deliberately misconfigured pod before trusting the namespace label.

Pod Security Standards

CIS Kubernetes Benchmark review

The CIS Kubernetes Benchmark is a widely used reference for configuring control plane components, worker nodes and policies. Use it as a checklist for the cluster that hosts Bot execution, record which recommendations you accept, change or defer, and keep the results with the deployment evidence. A benchmark scan shows configuration state at one moment, so schedule it again after each Kubernetes or Fission upgrade.

CIS Kubernetes Benchmark

Shared responsibility for compliance

Medplum's compliance documentation states that compliance is a shared responsibility between Medplum and its customers. On a self-hosted deployment, the cluster, its access controls, Bot runtime isolation and secret handling fall on your side of that line. Ask your compliance lead to map each control above to an owner and an evidence source, and confirm with Medplum which obligations it covers for the software itself.

Medplum compliance docs

Questions teams ask before running Bots on Fission

What drives the effort and cost of running Medplum Bots on Fission?

The cost depends on how much Kubernetes operations work your team already carries and how many layers the setup touches. The main components are the cluster itself (control plane, etcd, nodes and load balancing), the Fission installation and its upgrades, the Medplum Bot runtime wiring, secrets handling, and monitoring integration. Each one is a separate line in a written scope, and each recurs when versions change. Ask any provider to price these items separately, state who pays for each (your team, a DeployOpen engagement or a retainer), and name which upgrades are included. Kubernetes releases about three times per year, so cluster and Fission upgrades are the largest recurring effort.

How long does a Fission setup for Medplum Bots take?

Duration depends on the agreed written scope, not on a fixed template. The scope sets which cluster is used, how many Bots run on Fission, how identity and secrets are wired, and what testing and handover are required. A single-cluster setup with a small set of sample Bots and an existing test environment is a much smaller piece of work than a multi-cluster rollout with formal change control. Most engagements are fixed-scope, so the timeline is written into the agreement before work starts. Ask for the timeline as a list of milestones tied to scope items.

What does our team need to provide before the work starts?

The work needs access and decisions from your side before anything is built. Expect to provide cluster access with the permissions needed to install and operate Fission, a decision on how users and services authenticate, and a decision on where Bot secrets live and who can read them. You also need a few sample Bots that represent real executions, plus a non-production environment where they can run and be tested. Without a test environment, verification moves into production, which is the highest-risk path. Confirm these inputs in the scope document so that delays are assigned to a named party.

Can our internal platform team run Bots on Fission without outside help?

Yes, if the team already operates Kubernetes in production and has someone who can own Fission, RBAC, network policy and secrets. Fission adds a serverless layer on top of the cluster, so operators need to understand function packaging, triggers, and how Medplum Bot code is deployed into it. The harder part is the ongoing work: following Kubernetes release changes, patching on the security timeline your organization sets, and keeping the cluster's etcd backups and restore procedure tested. Medplum's own versioning policy targets security patches within 7 days for critical vulnerabilities, so the internal team needs a defined on-call and change path. If the platform team is small, a retainer covering upgrades and monitoring is a common alternative to building that capacity from scratch.

How do Kubernetes upgrades affect a Fission-based Bot runtime?

Upgrades must follow Kubernetes' version skew rules, and those rules shape how the Bot runtime is changed. The kube-apiserver is upgraded one minor version at a time before the other control plane components and the kubelets, and kubelets may run up to three minor versions behind the API server. The Kubernetes project maintains the three most recent minor releases, so an unplanned gap grows quickly. Plan each cluster upgrade together with a Fission version check and a test run of your sample Bots. Confirm with your Fission release notes that the chosen Fission version supports the Kubernetes version you are moving to before you schedule the change.

Where do Bot secrets and monitoring fit into this setup?

Bot credentials should not be stored as plain Kubernetes Secrets. The Kubernetes secrets good practices page notes that Secrets are stored unencrypted in etcd by default, so you need encryption at rest, least-privilege RBAC on list and watch, or an external store through the Secrets Store CSI Driver. Monitoring needs the same care: decide which Bot executions, errors and cluster signals are collected and who receives alerts. Both decisions belong in the scope before build, because they change the Fission function configuration and the access model. Confirm the secrets approach with your security team and the monitoring approach with whoever runs on-call.

When is AWS Lambda or Medplum Cloud a better fit than Fission?

Choose Lambda when your Medplum deployment already runs on AWS and your team operates AWS identity and networking well, since the IAM boundary and managed execution remove a cluster you would otherwise run. Choose Medplum Cloud when you do not want to operate the platform, its database or its upgrades yourself, and your compliance model fits a hosted service. Fission fits when your installation runs on Azure, Google Cloud or on-premises infrastructure and you already run Kubernetes there. If you have no Kubernetes capability and no reason to add it, Fission adds operational load that a simpler option avoids. Compare the options against your hosting location, security review requirements and the people you have to run them.

How DeployOpen scopes and supports Medplum Bot execution on Kubernetes

DeployOpen approaches Medplum Bot execution on Kubernetes as a written, fixed-scope engagement inside infrastructure you control. The work starts with a scope that names the clusters, Medplum deployment, Bot runtime and operating model, then moves through build, testing, handover and optional ongoing support.

How we scope

  • Confirm which Bots, Subscriptions and cron jobs will run on Fission and which stay on other backends
  • Record the target cloud, data center or air-gapped environment and its Kubernetes distribution
  • Agree the Medplum version, PostgreSQL and Redis topology, and the identity provider used by Bots
  • Document isolation, secrets and network requirements in the written scope before work starts

How we build

  • Install Fission on the agreed cluster and connect it to the Medplum server configuration
  • Package Bot code, configure function resources, and wire triggers to the Medplum execution path
  • Set namespace boundaries, RBAC, Pod Security settings and secrets handling against the agreed design
  • Test Bot execution, failure handling and scaling behavior in a non-production environment first

How we hand over

  • Deliver written documentation of the cluster layout, Fission configuration and deployment steps
  • Provide runbooks for upgrades, Bot deployment from CI, rollback and etcd backup verification
  • Walk your platform and security teams through the monitoring, logs and access controls
  • Hand over test results and a list of open items with owners agreed in the scope

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover
  • Retainers can cover Kubernetes and Fission version planning against your agreed support windows
  • Retest changes to Bot execution, RBAC or secrets handling before they reach production
  • Confirm vendor-specific capabilities with the platform owners as part of each planned change

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.