Subject: | Fwd: Net::Kubernetes API question |
Date: | Wed, 13 Nov 2019 17:24:18 -0500 |
To: | bug-Net-Kubernetes [...] rt.cpan.org |
From: | santa claus <santarupa100 [...] gmail.com> |
Hi Cpan admins, I tried to contact the author of the Net::Kubernetes module
for some insight on an issue I'm having while using this API but I get a
returned email saying the email 'dave@perljedi.com' is not valid. Could you
take a look? Thanks very much!
Show quoted text
---------- Forwarded message ---------
Subject: Net::Kubernetes API question
To: <dave@perljedi.com>
Hi Dave, this is Santa. I'm a newbie DevOps engineer in the East coast. I
try to use your library Net::Kubernetes to interact with K8S cluster thru
Perl, but running into some issue while trying to instantiate the kube
object with the new() method. Your documentation mentions those SSL key
certificate options and I tried my code below but it didn't pass the
authentication:
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'
);
It throws this error:
Can't connect to myK8Scluster:8443
Trace begun at /opt/ActivePerl-5.28/lib/perl5/site_perl/5.28.1/Net/Kubernetes/Role/ResourceLister.pm
line 42
Notice the values for those properties inside the new() method are
extracted from a local Kubernetes cluster which has the following
KubeConfig file ( I extracted the CA, client cert, and client key and save
them into 3 separate text files, which I then reference inside the new()
method above ):
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: <...the CA key....>
server: https://myK8Scluster:8443
name: cluster.local
contexts:
- context:
cluster: cluster.local
user: kubernetes-admin
name: kubernetes-admin@cluster.local
current-context: kubernetes-admin@cluster.local
kind: Config
preferences: {}
users:
- name: kubernetes-admin
user:
client-certificate-data: <....the cert....>
client-key-data: <...the client key......>
Since I couldn't find any Perl example on the net to show usage of your
library, I just want to check with you to see if I call your new() method
correctly, or whether I need to provide any extra params/options into the
new() method? Any insight is greatly appreciated. Thanks!
Santa.