Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env ruby
- require 'json'
- pvcs = JSON.parse(`kubectl get pvc --all-namespaces -o json`)["items"]
- pvcs.each do |pvc|
- namespace = pvc["metadata"]["namespace"]
- pv = pvc["spec"]["volumeName"]
- `kubectl label pv #{pv} openebs.io/namespace=#{namespace} --overwrite`
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement