Skip to content

Add rollout restart support for Kubernetes workloads#36

Merged
dkrizic merged 7 commits intomainfrom
copilot/add-rollout-restart-button
Jan 23, 2026
Merged

Add rollout restart support for Kubernetes workloads#36
dkrizic merged 7 commits intomainfrom
copilot/add-rollout-restart-button

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 22, 2026

Adds gRPC API and UI for performing kubectl rollout restart on Deployments, StatefulSets, and DaemonSets within the cluster namespace.

API Changes

  • New proto service: workload.v1.Workload.RestartWorkload()
  • Request specifies workload type, name, and optional namespace
  • Response indicates success with descriptive message

Backend Implementation

  • Uses k8s client-go to patch workloads with kubectl.kubernetes.io/restartedAt annotation
  • Falls back gracefully when not running in-cluster (feature disabled with warning)
  • Reads POD_NAMESPACE from downward API for default namespace

RBAC Updates

Extended service Role with:

- apiGroups: ["apps"]
  resources: ["deployments", "statefulsets", "daemonsets"]
  verbs: ["get", "list", "patch", "update"]

UI

Added "Workload Management" section with:

  • Dropdown for workload type selection
  • Name and optional namespace inputs
  • Confirmation dialog before restart
  • HTMX-driven success/error feedback

Documentation

  • Architecture Diagram: Updated README.md Mermaid diagram to include Workload Manager component
  • ConfigMap Usage Guide: Added comprehensive section explaining:
    • When ConfigMaps mounted with envFrom require restarts (environment variables)
    • When ConfigMaps mounted as volumes auto-update (file mounts)
    • Why the workload restart feature is essential for this service

Example Usage

From UI: Select "Deployment" → Enter "feature" → Click "⟳ Restart" → Confirms → Restarts pods via annotation update

This feature is particularly useful when updating ConfigMaps that are mounted as environment variables via envFrom, as these require pod restarts to take effect.

Original prompt

This section details on the original issue you should resolve

<issue_title>Support for restarting a deployment, statefulset or daemonset</issue_title>
<issue_description>Feature should have a button that does a

rollout restart on a given deployment, statefulset or daemonset with a specified name.

We also need to add some RBAC to the Helm chart to be allowed to do that. There should be a button in the ui do trigger the restart.
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 23, 2026 00:00
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for restarting deployment, statefulset or daemonset Add rollout restart support for Kubernetes workloads Jan 23, 2026
Copilot AI requested a review from dkrizic January 23, 2026 00:08
@dkrizic
Copy link
Copy Markdown
Owner

dkrizic commented Jan 23, 2026

@copilot Describe a use case where you can modify a configmap which is mounted as envFrom configmap and that you need to restart the service so that the values take in effect. Additionally describe a use case where you mount a configmap as a volume where this is not needed since the values update automatically after a while.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 23, 2026

@copilot Describe a use case where you can modify a configmap which is mounted as envFrom configmap and that you need to restart the service so that the values take in effect. Additionally describe a ...

Use Case 1: ConfigMap with envFrom (Restart Required)

When a ConfigMap is mounted using envFrom to populate environment variables:

envFrom:
  - configMapRef:
      name: app-config

Environment variables are set once when the pod starts. If you update the ConfigMap (e.g., changing LOG_LEVEL=debug to LOG_LEVEL=info), the running pods continue using the old values because environment variables cannot be updated in a running process. You must restart the deployment for pods to pick up the new environment variable values.

Use Case 2: ConfigMap as Volume Mount (Auto-Update)

When a ConfigMap is mounted as a volume:

volumeMounts:
  - name: config
    mountPath: /etc/config
volumes:
  - name: config
    configMap:
      name: app-config

Kubernetes automatically updates the files in the mounted volume when the ConfigMap changes (typically within 60-90 seconds due to kubelet sync period). Applications that read configuration files dynamically (e.g., nginx reloading config, apps watching file changes) can pick up updates without pod restart.

Why This Feature Matters

The workload restart button is essential for the first scenario - when using envFrom (as this service does with service-configmap.yaml), updating feature flags in the ConfigMap requires restarting pods to apply changes. This feature provides a convenient UI button to trigger that restart instead of requiring kubectl access.

@dkrizic
Copy link
Copy Markdown
Owner

dkrizic commented Jan 23, 2026

@copilot Put this documentation in the README.md

Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jan 23, 2026

@copilot Put this documentation in the README.md

Added ConfigMap usage documentation to README.md in commit c04eeb9. The documentation explains:

  • When ConfigMaps mounted with envFrom require restarts (environment variables)
  • When ConfigMaps mounted as volumes auto-update (file mounts)
  • Why the workload restart feature is essential for this service

@dkrizic dkrizic marked this pull request as ready for review January 23, 2026 00:25
@dkrizic dkrizic merged commit e06fa47 into main Jan 23, 2026
3 checks passed
@dkrizic dkrizic deleted the copilot/add-rollout-restart-button branch January 23, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for restarting a deployment, statefulset or daemonset

2 participants