| 1 | #!/usr/local/bin/perl | ||
| 2 | use strict; | ||
| 3 | use lib qw(./lib); | ||
| 4 | use Net::Kubernetes; | ||
| 5 | use Data::Dumper; | ||
| 6 | |||
| 7 | my $kube = Net::Kubernetes->new(url=>'https://10.245.1.2', username=>'vagrant', password=>'vagrant'); | ||
| 8 | |||
| 9 | my $ns = $kube->get_namespace('default'); | ||
| 10 | |||
| 11 | print "Namespace $ns\n"; | ||
| 12 | |||
| 13 | my $pod = $ns->get_pod('bootstrap-cass-cql'); | ||
| 14 | |||
| 15 | #$pod->spec->{containers}[0]{image} = 'liquidweb/base-perl:latest'; | ||
| 16 | $pod->metadata->{labels}{snarf} = 'blat'; | ||
| 17 | |||
| 18 | print Dumper($pod)."\n"; | ||
| 19 | |||
| 20 | if($pod->update){ | ||
| 21 | print "Updated, yay\n"; | ||
| 22 | }else{ | ||
| 23 | print "Doh!\n"; | ||
| 24 | } | ||
| 25 | |||
| 26 | #my $rc = $ns->get_rc('doppler-storage-pod-v1'); | ||
| 27 | # | ||
| 28 | #$rc->spec->{replicas} = 1; | ||
| 29 | # | ||
| 30 | #print Dumper($rc)."\n"; | ||
| 31 | # | ||
| 32 | #if($rc->update){ | ||
| 33 | # print "Updated, yay\n"; | ||
| 34 | #}else{ | ||
| 35 | # print "Doh!\n"; | ||
| 36 | #} | ||
| 37 | |||
| 38 | #my($junk) = grep({$_->{metadata}{name} eq 'junk'} $ns->list_secrets); | ||
| 39 | # | ||
| 40 | #$junk->delete; | ||
| 41 | |||
| 42 | #print $ns->create_from_file('/data/net-kubernetes/futz_with_me.yaml')."\n"; |