I have a cluster with some deployments / services / etc... inside an OKE, which I usually connect to via kubectl from my pc.
The question is: is it possible to delete a pod inside that cluster from a Oracle Function? What I want to do is build a CI/CD chain, triggering my function via a Gateway to execute my "ci-function", and this part works well.
I'm writing my functions in Go using oci-go-sdk , but here is the problem:
I can obtain the Kubeconfig file of my cluster with:
resp, err := client.CreateKubeconfig(ctx, containerengine.CreateKubeconfigRequest{
ClusterId: &cID,
})
But this Kubeconfig file contains:
- name: user-**********
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
args:
- ce
- cluster
- generate-token
- --cluster-id
- ocid1.cluster.oc1.*************************
- --region
- eu-frankfurt-1
command: oci
env: []
which need oci installed inside the function env, which I am not able to install.
Also, oci-cli used there is opensource, here is the interesting part that generate the token used here: https://github.com/oracle/oci-cli/blob/cf04fa4f08238cb1ee4287f0354603ba92e60647/services/container_engine/src/oci_cli_co… But I wasn't able to recreate this part and use it inside kubeconfig directly.
Someone know any way to do this?
Thanks in advance