Hello Perl monks, I'm a newbie DevOps engineer in the East coast. I'm trying to use Net::Kubernetes to interact with K8S cluster thru Perl, but running into some issue while instantiating the kube object with the new() method. CPAN's documentation mentions those SSL key certificate options but doesn't provide concrete example. And I couldn't find usage examples of Net::Kubernetes on the web either.... So, anyway, here's my code:
my $kube = Net::Kubernetes->new( url => 'https://myK8Scluster:8443', username => 'kubernetes-admin', ssl_ca_file => '/src/ssl_ca_file.txt', ssl_cert_file => '/src/ssl_cert_file.txt', ssl_key_file => '/src/ssl_key_file.txt' );
where the values for url and those ssl params. come from the Kubernetes server's "$HOME/.kube/config" file. Since I couldn't find any Perl example on the net to show usage of this library, I just want to check with you to see if I use this new() method correctly, or whether I need to supply any extra params/options into the new() method? Any insight is greatly appreciated. The error says:
Can't connect to myK8Scluster:8443 Trace begun at /opt/ActivePerl-5.28/lib/perl5/site_perl/5.28.1/Net/Kub +ernetes/Role/ResourceLister.pm line 42

In reply to Perl's Net:Kubernetes question by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.