Open Theprim0 opened 1 year ago
Thanks for filing a feature request. Could you be a bit more specific about what you would like to be able to do? I believe the collection should already support the functionality provided by kubectl rollout
. The information from status
and history
should be available from the k8s_info
module, but in a machine actionable format. The k8s_rollback
module does what undo
does. pause
and resume
can both be accomplished with a simple k8s_json_patch
operation to set the /spec/paused
property. The only thing that can't be done easily with the collection is the rolling restart.
Thanks for filing a feature request. Could you be a bit more specific about what you would like to be able to do? I believe the collection should already support the functionality provided by
kubectl rollout
. The information fromstatus
andhistory
should be available from thek8s_info
module, but in a machine actionable format. Thek8s_rollback
module does whatundo
does.pause
andresume
can both be accomplished with a simplek8s_json_patch
operation to set the/spec/paused
property. The only thing that can't be done easily with the collection is the rolling restart.
@gravesm, which way do you suggest to do do rollout restart
with the collection? I would like to apply the rollout restart
that can be seen here but without using the ansible.builtin.shell
module.
@gravesm exactly, i see k8s_rollback module exists, but I mean "rollout". As @MarceloFCandido says, we can't acomplish "rollout restart" with kubernetes.core module neither with k8s_rollback module.
Came looking for this too. Glad it's being looked into. Thanks.
+1 for this feature, but wonder if in the meantime, could you use the kubernetes.core.k8s_scale module to scale the deployment to 0, then back to what it was?
The following works for anyone else who finds this thread.
kubectl rollout status -w deployment/foo-bar -n foo
becomes...
- name: "k8s wait for deployment/foo-bar rollout"
kubernetes.core.k8s_info:
kind: Rollout
namespace: "foo"
name: "deployment/foo-bar"
wait: true
wait_condition:
type: Succeeded
Maybe this could be added to the examples? https://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_info_module.html#examples
+1 to this feature. I need to restart a deployment because of a change in a ConfigMap.
+1 for this. seems a very useful feature
+1 for this. seems a very useful feature
+1 to this feature
+1
kubectl rollout status -w deployment/foo-bar -n foo
becomes...
- name: "k8s wait for deployment/foo-bar rollout" kubernetes.core.k8s_info: kind: Rollout namespace: "foo" name: "deployment/foo-bar" wait: true wait_condition: type: Succeeded
That gives me a (green) output saying:
Failed to find API for resource with apiVersion "v1" and kind "Rollout"
+1
I was looking into restarting ArgoCD deployment after patching the configmap
But, meanwhile, I found a way to restart a deployment:
- name: Restart ArgoCD repo-server
kubernetes.core.k8s:
state: patched
kind: Deployment
name: argocd-repo-server
namespace: "{{ argocd_namespace }}"
definition:
spec:
template:
metadata:
annotations:
kubectl.kubernetes.io/restartedAt: "{{ now(fmt='%Y-%m-%dT%H:%M:%SZ') }}"
+1
SUMMARY
It would be interesting to include tasks into kubernetes.core to interact with ROLLOUT.
ISSUE TYPE
COMPONENT NAME
kubectl rollout
rollout history, rollout restart, etc...
ADDITIONAL INFORMATION