Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'json'
  4.  
  5. pvcs = JSON.parse(`kubectl get pvc --all-namespaces -o json`)["items"]
  6.  
  7. pvcs.each do |pvc|
  8. namespace = pvc["metadata"]["namespace"]
  9. pv = pvc["spec"]["volumeName"]
  10.  
  11. `kubectl label pv #{pv} openebs.io/namespace=#{namespace} --overwrite`
  12. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement