Add rollout restart support for Kubernetes workloads#36
Conversation
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 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. |
Use Case 1: ConfigMap with When a ConfigMap is mounted using envFrom:
- configMapRef:
name: app-configEnvironment variables are set once when the pod starts. If you update the ConfigMap (e.g., changing 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-configKubernetes 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 |
|
@copilot Put this documentation in the README.md |
Co-authored-by: dkrizic <1181349+dkrizic@users.noreply.github.com>
Added ConfigMap usage documentation to README.md in commit c04eeb9. The documentation explains:
|
Adds gRPC API and UI for performing
kubectl rollout restarton Deployments, StatefulSets, and DaemonSets within the cluster namespace.API Changes
workload.v1.Workload.RestartWorkload()Backend Implementation
kubectl.kubernetes.io/restartedAtannotationPOD_NAMESPACEfrom downward API for default namespaceRBAC Updates
Extended service Role with:
UI
Added "Workload Management" section with:
Documentation
envFromrequire restarts (environment variables)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
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.