GitOps for Medical Device Software: Automating IEC 62304 in K8s
Learn how to automate IEC 62304 Class B and Class C software verification in Kubernetes using GitOps, policy engines, and continuous compliance pipelines.
Article content
In medical device software engineering, the tension between continuous delivery and rigorous regulatory compliance has historically ground release velocity to a halt. Teams developing Software as a Medical Device (SaMD) or connected digital health platforms often default to frozen release cycles, manual validation protocols, and disconnected spreadsheets simply to survive audits under IEC 62304 and FDA 21 CFR Part 820.
As we navigate 2026, the modern cloud-native paradigm has evolved. Kubernetes is no longer an experimental runtime for digital health; it is the production standard for complex medical algorithms, real-time telemetry processing, and microservices architectures. However, deploying Kubernetes workloads without a deterministic, audit-traceable control plane introduces catastrophic regulatory risk. This is where GitOps bridges the divide.
By enforcing an immutable, declarative single source of truth in version control, GitOps unlocks fully automated, reproducible verification pipelines for IEC 62304 Class B and Class C software. Here is the architectural and regulatory blueprint for modern engineering leaders implementing GitOps in regulated Kubernetes clusters.
The Regulatory Challenge: IEC 62304 Class B/C vs. Containerized Agility
IEC 62304 defines software development lifecycle requirements based on the severity of injury a software failure could cause:
- Class A: No injury or damage to health is possible.
- Class B: Non-serious injury is possible.
- Class C: Death or serious injury is possible.
While Class A systems enjoy streamlined verification requirements, Class B and Class C devices mandate strict engineering controls across the software lifecycle. Specifically, Class B and C systems require rigorous evidence for:
- Clause 5.5 (Software Unit Verification): Proving that individual units (container microservices, algorithmic libraries) meet defined software requirements and architectural constraints.
- Clause 5.6 (Software Integration and Integration Testing): Documenting regression-free communication across boundaries, interfaces, APIs, and microservices.
- Clause 5.7 (Software System Testing): End-to-end verification verifying that the compiled system fulfills specified safety and performance criteria.
- Clause 5.1.12 & Clause 8 (Software Configuration Management): Documenting immutable traceability from requirement to commit, artifact, test record, and live production deployment.
In a standard cloud pipeline, ephemeral container nodes, dynamic autoscaling, and hotfixes can create unmanaged drift. If an engineer manually alters a Helm value or runs kubectl edit directly against a live cluster, the configuration integrity is compromised, violating IEC 62304 Clause 8 and FDA 21 CFR Part 820.70(i). GitOps eliminates this surface area completely.
Core Architectural Pattern: The Regulated GitOps Loop
GitOps operates on a fundamental principle: the desired state of your infrastructure and application workloads is declared declaratively in version control (Git), and an automated controller reconciles that declared state with the actual state running inside the cluster.
For SaMD platforms subject to Class B and C rigor, the pattern requires three foundational layers of segregation:
1. Separation of Application Repositories and Deployment State
Software developers work in Application Repositories containing source code, unit tests, and Dockerfiles. Successful continuous integration (CI) generates a signed, immutable container image (with Software Bill of Materials [SBOM] attached). The target production state resides in a strictly controlled Config/Manifest Repository governed by branch protection policies, multi-party cryptographic approvals (M-of-N signing), and integrated QMS change tickets.
2. The Pull-Based Reconciler (Argo CD or Flux)
Rather than pushing configurations from a CI system into production via escalated cluster admin keys, an in-cluster GitOps operator (such as Argo CD or Flux) pulls approved manifests. The operator detects configuration drift automatically, reverting any manual cluster changes within seconds and logging the tampering event to an immutable audit sink. This architectural posture is critical when designing HIPAA-compliant infrastructure and managed cloud systems.
3. Cryptographic Verification Gateways
Deployments must not proceed unless container images and Kubernetes manifests carry valid cryptographic signatures. In 2026, utilizing Sigstore (Cosign) alongside admission controllers such as Kyverno or Open Policy Agent (OPA) Gatekeeper ensures that unsigned binaries or untested revisions are rejected at the Kubernetes API admission level.
Step-by-Step: Automating Class B/C Verification in Kubernetes
To satisfy auditors and notified bodies without manual validation friction, engineering organizations must map each phase of the GitOps pipeline directly to an IEC 62304 requirement.
Step 1: Automated Unit Verification and Static Analysis (Clause 5.5)
On every pull request within the source repository:
- Static Application Security Testing (SAST) and linting run against coding standards (e.g., MISRA, ISO/IEC 25010).
- Unit test suites execute with code coverage thresholds strictly enforced (Class C typically demands high statement and branch coverage).
- Static software composition analysis (SCA) generates a CycloneDX or SPDX SBOM, cross-referencing CVE databases in compliance with FDA cybersecurity guidance.
Step 2: Integration Testing and Contract Verification (Clause 5.6)
Before manifests are committed to the deployment repository:
- Container images are deployed into transient, isolated ephemeral namespaces (e.g., via vcluster or namespace controllers).
- Automated API contract testing and integration suites run across simulated device inputs and downstream EHR/cloud boundaries.
- All test execution logs, timestamps, and pass/fail summaries are compiled into structured JSON/XML artifacts.
Step 3: End-to-End System Testing in Staging Environments (Clause 5.7)
The GitOps engine reconciles the verified configuration into a staging cluster mirror that mirrors production topology identically:
- Synthetic patient workloads and stress testing validate system safety limits, high availability failover, and fault tolerance under load.
- Automated smoke tests run health checks against cryptographic certificate stores, database schema states, and queue latencies.
Step 4: Automated Verification Record (VER) Generation
The linchpin of regulated GitOps is eliminating the manual creation of Design History Files (DHF) and Verification Reports. The pipeline automatically consolidates the commit hash, pipeline run logs, SBOM, SCA report, admission controller approvals, and container digest into an immutable Verification Evidence Record. This evidence is digitally sealed and pushed directly into your electronic Quality Management System (eQMS) using integrations available in platforms like our QMS Cloud and Device Ops solutions.
Sample Declarative Policy: Kyverno Gatekeeper for IEC 62304 Compliance
To ensure no unauthorized or unverified workload can run in the cluster, engineering teams enforce runtime admission rules. Below is an example of a Kyverno ClusterPolicy requiring container images to possess a valid cryptographic signature and verified SBOM attestation:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: iec62304-class-c-enforcement
annotations:
policies.kyverno.io/title: Verify IEC 62304 Attestation & Signatures
policies.kyverno.io/category: Medical Device Software Safety
policies.kyverno.io/description: Blocks containers lacking Cosign verification and QMS test attestations.
spec:
validationFailureAction: Enforce
webhookTimeoutSeconds: 30
rules:
- name: verify-image-signature-and-attestation
match:
any:
- resources:
kinds:
- Pod
namespaces:
- samd-production
verifyImages:
- imageReferences:
- "registry.medtechops.internal/clinical/*"
attestors:
- entries:
- keys:
publicKeys: |
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE+kX8Wb8p...
-----END PUBLIC KEY-----
attestations:
- predicateType: https://medtechops.com/predicate/iec62304-test-run/v1
conditions:
- all:
- key: "{{ @.status }}"
operator: Equals
value: "PASSED"
- key: "{{ @.coverage }}"
operator: GreaterThanOrEquals
value: "85"
With this policy active, any developer or automated agent attempting to deploy a container that lacks a verified, passing test attestation will be blocked at the Kubernetes API server, preventing non-conforming software from executing in patient-facing environments.
Audit Readiness: Tracing Commits to Design History Files (DHF)
When notified bodies or FDA inspectors conduct an audit, the primary question they pose regarding software changes is: "Show me the lineage from this software requirement to the production line, including who approved it and how it was tested."
"In an unmanaged CI/CD pipeline, an audit is a archaeological dig. In a GitOps architecture, an audit is simply a git log and an admission manifest."
To achieve seamless trace matrix generation:
- Git Commits Tagged to PRs & User Stories: Enforce commit hooks requiring references to specific requirements IDs (e.g.,
REQ-SYS-1042). - PR Reviews Act as Electronic Signatures: In alignment with FDA 21 CFR Part 11, require cryptographic Git commit signing (GPG/SSH) and two-person authorization for pull requests merged into deployment branches.
- Immutable Git History: The Git tree for your deployment repository serves as an unalterable, chronological record of every state your production cluster has ever held, complete with timestamps and responsible engineers.
If you are looking to architect custom automated pipelines or need third-party validation for your cloud-native medical device setup, reach out to our team via our engineering contact portal.
Frequently Asked Questions (FAQ)
Can GitOps satisfy FDA 21 CFR Part 11 requirements for electronic signatures?
Yes, provided the identity and cryptographic integrity controls meet Part 11 standards. This is achieved by combining single sign-on (SSO) with MFA, requiring hardware-backed GPG/SSH keys for signing commits, enforcing branch protection that prevents unilateral merging, and ensuring that identity providers maintain immutable audit trails of authentication events.
How does GitOps handle clinical data privacy and HIPAA?
GitOps deals purely with declarations of infrastructure and application code; no Protected Health Information (PHI) should ever enter a Git repository. Secrets and credentials must be injected dynamically at runtime using tools like HashiCorp Vault, AWS Secrets Manager, or External Secrets Operator, encrypted via envelope encryption.
What is the difference in verification stringency between Class B and Class C in GitOps?
While both classes require documented verification and regression analysis, Class C demands rigorous branch/condition test coverage, explicit architectural decomposition verifying software unit interfaces, and deep software safety classification partitioning to ensure that non-safety-critical components cannot compromise critical safety threads.
Does using GitOps mean we can skip Computer Software Assurance (CSA)?
No. The GitOps tooling pipeline itself (GitLab/GitHub, Argo CD, Kyverno, container registries) constitutes software used in the design and manufacture of medical devices. Under FDA 21 CFR Part 820.70(i) and CSA guidelines, you must validate these toolchains for their intended use. However, because GitOps is declarative, validating the pipeline is substantially simpler and can be automated via synthetic self-validating test harnesses.
Conclusion
Adopting GitOps for medical device software is not simply an engineering optimization—it is a regulatory advantage. By enforcing declarative infrastructure, cryptographically signed artifacts, policy-based admission controls, and automated verification reports, medical device manufacturers can simultaneously accelerate clinical innovation and exceed the stringent safety mandates of IEC 62304 Class B and C systems. In 2026, compliance is no longer a manual post-hoc checklist; it is an automated, continuous capability compiled into every build.
