{"id":19893627,"url":"https://github.com/cameronsenese/okectl","last_synced_at":"2026-04-15T00:31:44.764Z","repository":{"id":170275775,"uuid":"607010894","full_name":"cameronsenese/okectl","owner":"cameronsenese","description":"okectl is a CLI utility designed for use with Oracle Container Engine for Kubernetes. okectl provides a command-line interface for interaction with OKE, including Kubernetes cluster lifecycle. Note: This project is a mirror of the upstream GitLab project developed and maintained by Cameron Senese.","archived":false,"fork":false,"pushed_at":"2023-02-27T05:52:58.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-01T05:28:16.711Z","etag":null,"topics":["golang","kubernetes","oci-sdk","oke"],"latest_commit_sha":null,"homepage":"https://gitlab.com/byteQualia/okectl","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cameronsenese.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-27T05:51:19.000Z","updated_at":"2024-10-05T04:30:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"ccbeb209-4a43-4d03-96b7-1df50e885396","html_url":"https://github.com/cameronsenese/okectl","commit_stats":null,"previous_names":["cameronsenese/okectl"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cameronsenese/okectl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronsenese%2Fokectl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronsenese%2Fokectl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronsenese%2Fokectl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronsenese%2Fokectl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameronsenese","download_url":"https://codeload.github.com/cameronsenese/okectl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronsenese%2Fokectl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31821439,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T18:05:02.291Z","status":"ssl_error","status_checked_at":"2026-04-14T18:05:01.765Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","kubernetes","oci-sdk","oke"],"created_at":"2024-11-12T18:30:14.656Z","updated_at":"2026-04-15T00:31:44.741Z","avatar_url":"https://github.com/cameronsenese.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[terraform]: https://terraform.io\n[oci]: https://cloud.oracle.com/en_US/cloud-infrastructure\n[go]: https://golang.org/dl/\n[oke]: https://cloud.oracle.com/containers/kubernetes-engine\n[oke-guide]: https://docs.cloud.oracle.com/iaas/Content/ContEng/Concepts/contengprerequisites.htm?tocpath=Services%7CContainer%20Engine%7CPreparing%20for%20Container%20Engine%20for%20Kubernetes%7C_____0\n[go-sdk]: https://github.com/oracle/oci-go-sdk\n[config-file]: https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdkconfig.htm#CLIConfiguration\n[kubectl-guide]: https://kubernetes.io/docs/tasks/tools/install-kubectl/\n\n\n# okectl: CLI utility for OKE cluster lifecycle management\n\n## About\n\nokectl is a CLI utility designed for use with [Oracle Container Engine for Kubernetes (OKE)][oke]. okectl provides a command-line interface for interaction with OKE, including Kubernetes cluster lifecycle.\n\nokectl is designed as a stand-alone tool to automate the Kubernetes cluster creation process, but is most useful when used as part of an automation pipeline.\n\n[Oracle Container Engine for Kubernetes][oke] is a developer friendly, container-native, and enterprise-ready managed Kubernetes service for running highly available clusters with the control, security, and predictable performance of Oracle’s Cloud Infrastructure.\n\nokectl is built using the [Go SDK for Oracle Cloud Infrastructure][go-sdk].\n\n### Supported Operations\n\n - `createOkeCluster`\n    - Creates cluster control plane, node pool, worker nodes, \u0026 configuration data (kubeconfig \u0026 json cluster desctiption).\n - `deleteOkeCluster`\n    - Deletes specified cluster.\n - `getOkeNodePool`\n    - Retreives cluster, node poool, and node details for a specified node pool.\n - `createOkeKubeconfig`\n    - Creates kubeconfig authentication artefact for kubectl.\n\n## Usage\n\nokectl requires configuration data via command-line arguments/flags. Command-line flags provide data relating to both the [OCI][oci] tenancy, and also OKE cluster configuration parameters.\n\n### Example - Usage\n```\n$ ./okectl\n$ usage: OKECTL [\u003cflags\u003e] \u003ccommand\u003e [\u003cargs\u003e ...]\n$\n$ A command-line application for configuring Oracle OKE (Container Engine for Kubernetes.)\n$\n$ Flags:\n$   --help                 Show context-sensitive help (also try --help-long and --help-man).\n$   --configDir=\".okectl\"  Path where output files are created - e.g. kubeconfig file.\n$   --version              Show application version.\n$\n$ Commands:\n$   help [\u003ccommand\u003e...]\n$     Show help.\n$\n$   createOkeCluster --vcnId=VCNID --compartmentId=COMPARTMENTID --subnet1Id=SUBNET1ID --subnet2Id=SUBNET2ID --subnet3Id=SUBNET3ID [\u003cflags\u003e]\n$     Create new OKE Kubernetes cluster.\n$\n$   deleteOkeCluster --clusterId=CLUSTERID\n$     Delete OKE Kubernetes cluster.\n$\n$   getOkeNodePool [\u003cflags\u003e]\n$     Get cluster, node poool, and node details for a specified node pool.\n$\n$   createOkeKubeconfig --clusterId=CLUSTERID\n$     Create kubeconfig authentication artefact for kubectl.\n```\n\n### Example - Create Cluster\n\n#### Interactive Help\n\n```\n$ ./okectl createOkeCluster --help\n$\n$ usage: OKECTL createOkeCluster --vcnId=VCNID --compartmentId=COMPARTMENTID --subnet1Id=SUBNET1ID --subnet2Id=SUBNET2ID --subnet3Id=SUBNET3ID [\u003cflags\u003e]\n$\n$ Create new OKE Kubernetes cluster.\n$\n$ Flags:\n$   --help                              Show context-sensitive help (also try --help-long and --help-man).\n$   --configDir=\".okectl\"               Path where output files are created - e.g. kubeconfig file. Specify as absolute path.\n$   --version                           Show application version.\n$   --vcnId=VCNID                       OCI VCN-Id where cluster will be created.\n$   --compartmentId=COMPARTMENTID       OCI Compartment-Id where cluster will be created.\n$   --subnet1Id=SUBNET1ID               Cluster Control Plane LB Subnet 1.\n$   --subnet2Id=SUBNET2ID               Cluster Control Plane LB Subnet 2.\n$   --subnet3Id=SUBNET3ID               Worker Node Subnet 1.\n$   --subnet4Id=SUBNET4ID               Worker Node Subnet 2.\n$   --subnet5Id=SUBNET5ID               Worker Node Subnet 3.\n$   --clusterName=\"dev-oke-001\"         Kubernetes cluster name.\n$   --kubeVersion=\"v1.10.3\"             Kubernetes cluster version.\n$   --nodeImageName=\"Oracle-Linux-7.4\"  OS image used for Worker Node(s).\n$   --nodeShape=\"VM.Standard1.1\"        CPU/RAM allocated to Worker Node(s).\n$   --nodeSshKey=NODESSHKEY             SSH key to provision to Worker Node(s) for remote access.\n$   --quantityWkrSubnets=1              Number of subnets used to host Worker Node(s).\n$   --quantityPerSubnet=1               Number of Worker Nodes per subnet.\n$   --waitNodesActive=\"false\"           If waitNodesActive=all, wait \u0026 return when all nodes in the pool are active.\n                                        If waitNodesActive=any, wait \u0026 return when any of the nodes in the pool are active.\n                                        If waitNodesActive=false, no wait \u0026 return when the node pool is active.\n```\n\n#### Create Cluster\n\n```\n$ ./okectl createOkeCluster \\\n$ --clusterName=OKE-Cluster-001 \\\n$ --kubernetesVersion=v1.10.3 \\\n$ --vcnId=ocid1.vcn.oc1.iad.aaaaaaaamg7tqzjpxbbibev7lhp3bhgtcmgkbbrxr7td4if5qa64bbekdxqa \\\n$ --compartmentId=ocid1.compartment.oc1..aaaaaaaa2id6dilongtlxxmufoeunasaxuv76xxcb4ewxcxxxw5eba \\\n$ --quantityWkrSubnets=1 \\\n$ --quantityPerSubnet=1 \\\n$ --subnet1Id=ocid1.subnet.oc1.iad.aaaaaaaagq5apzuwr2qnianczzie4ffo6t46rcjehnsyoymiuunxaauq7y7a \\\n$ --subnet2Id=ocid1.subnet.oc1.iad.aaaaaaaadxr6zl4jpmcaxd4izzlvbyq2pqss3pmotx6dnusmh3ijorrpbhva \\\n$ --subnet3Id=ocid1.subnet.oc1.iad.aaaaaaaabf6k3ufcjdsdb5xfzzc3ayplhpip2jxtnaqvfcpakxt3bhmhecxa \\\n$ --nodeImageName=Oracle-Linux-7.4 \\\n$ --nodeShape=VM.Standard1.1 \\\n$ --nodeSshKey=\"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDsHX7RR0z+JSAf+5nfTO9kS4Y6HV2pPXoXTqUJH...\" \\\n$ --waitNodesActive=\"all\"\n```\nFor the above request, okectl will provision:\n - Kubernetes Cluster (Control Plane)\n       - Version will be as nominated via the `--kubeVersion` flag.\n - Node Pool\n       - Node Pool will be created across the number of worker subnets as provided via `--quantityWkrSubnets` flag.\n - Nodes\n       - Worker nodes will be provisioned to each of the nominated worker subnets. Number of worker nodes per subnet is determined by the `--quantityPerSubnet` flag.\n - Configuration Data\n       - Provision to local filesystem a kubeconfig authentication artefact (kubeconfig) \u0026 json description of cluster configuration (nodeconfig.json).\n\nPer the flag --waitNodesActive=\"all\", okectl will return when cluster, node pool, and each of the nodes in the node pool are active.\n\nOnce completed, okectl will output the cluster, nodepool and node configuration data (stdout):\n\n```\n$ OKECTL :: Create Cluster :: Complete ...\n$ --------------------------------------------------------------------------------------\n$ {\n$        \"id\": \"ocid1.nodepool.oc1.iad.aaaaaaaaae3tonjqgftdiyrxha2gczrtgu3winbtgbsdszjqmnrdeodegu2t\",\n$        \"compartmentId\": \"ocid1.compartment.oc1..aaaaaaaa2id6dilongtl6fmufoeunasaxuv76b6cb4ewxcw4juafe55w5eba\",\n$        \"clusterId\": \"ocid1.cluster.oc1.iad.aaaaaaaaae2tgnlbmzrtknjygrrwmobsmvrwgnrsmnqtmzjygc2domtbgmyt\",\n$        \"name\": \"oke-dev-001\",\n$        \"kubernetesVersion\": \"v1.10.3\",\n$        \"nodeImageId\": \"ocid1.image.oc1.iad.aaaaaaaajlw3xfie2t5t52uegyhiq2npx7bqyu4uvi2zyu3w3mqayc2bxmaa\",\n$        \"nodeImageName\": \"Oracle-Linux-7.4\",\n$        \"nodeShape\": \"VM.Standard1.1\",\n$        \"initialNodeLabels\": [],\n$        \"sshPublicKey\": \"\",\n$        \"quantityPerSubnet\": 1,\n$        \"subnetIds\": [\n$                \"ocid1.subnet.oc1.iad.aaaaaaaajvfrxxawuwhvxnjliox7gzibonafqcyjkdozwie7q5po7qbawl4a\"\n$        ],\n$        \"nodes\": [\n$                {\n$                        \"id\": \"ocid1.instance.oc1.iad.abuwcljtayee6h7ttavqngewglsbe3b6my3n2eoqawhttgtswsu66lrjgi4q\",\n$                        \"name\": \"oke-c2domtbgmyt-nrdeodegu2t-soxdncj6x5a-0\",\n$                        \"availabilityDomain\": \"Ppri:US-ASHBURN-AD-3\",\n$                        \"subnetId\": \"ocid1.subnet.oc1.iad.aaaaaaaattodyph6wco6cmusyza4kyz3naftwf6yjzvog5h2g6oxdncj6x5a\",\n$                        \"nodePoolId\": \"ocid1.nodepool.oc1.iad.aaaaaaaaae3tonjqgftdiyrxha2gczrtgu3winbtgbsdszjqmnrdeodegu2t\",\n$                        \"publicIp\": \"100.211.162.17\",\n$                        \"nodeError\": null,\n$                        \"lifecycleState\": \"UPDATING\",\n$                        \"lifecycleDetails\": \"waiting for running compute instance\"\n$                }\n$        ]\n$ }\n```\n\nBy default, okectl will create a sub-directory named \".okectl\" within the same directory as the okectl binary. okectl will create x2 files within the \".okectl\" directory:\n\n - `kubeconfig`\n       - This file contains authentication and cluster connection information. It should be used with the `kubectl` command-line utility to access and configure the cluster.\n - `nodepool.json`\n       - This file contains a detailed output of the cluster and node pool configuration in json format.\n\nOutput directory is configurable via the `--configDir` flag. Path provided to `--configDir` should be provided as an absolute path.\n\nAll clusters created using okectl will be provisioned with the additional options of the Kubernetes dashboard \u0026 Helm/Tiller as installed.\n\n### Example - Get Node Pool\n\n#### Interactive Help\n\n```\n$ ./okectl getOkeNodePool --help\n$\n$ usage: OKECTL getOkeNodePool [\u003cflags\u003e]\n$\n$ Get cluster, node pool, and node details for a specified node pool.\n$\n$ Flags:\n$   --help                     Show context-sensitive help (also try --help-long and --help-man).\n$   --configDir=\".okectl\"      Path where output files are created or referenced - e.g. kubeconfig file. Specify as absolute path.\n$   --version                  Show application version.\n$   --nodePoolId=NODEPOOLID    OKE Node Pool Id. If not specified, Id contained in nodepool.json will be used.\n$   --tfExternalDs=\"false\"     Run as a Terraform External Data Source, \u0026 provide json only response data.\n$   --waitNodesActive=\"false\"  If waitNodesActive=all, wait \u0026 return when all nodes in the pool are active. If waitNodesActive=any, wait \u0026 return when any of the nodes in the pool\n$                              are active. If waitNodesActive=false, no wait \u0026 return when the node pool is active.\n```\n\n#### Get Node Pool\n\n```\n$ ./okectl getOkeNodePool \\\n$ --tfExternalDs=\"false\" \\\n$ --waitNodesActive=\"all\"\n```\n\nFor the above request, okectl will provision:\n - Configuration Data\n       - Provision to local filesystem a json description of cluster configuration (nodeconfig.json).\n\nPer the flag --waitNodesActive=\"all\", okectl will return when cluster, node pool, and each of the nodes in the node pool are active.\n\nOnce completed, okectl will output the cluster, nodepool and node configuration data (stdout):\n\n```\nOKECTL :: Get NodePool :: Complete ...\n-------------------------------------------------------\n{\n        \"id\": \"ocid1.nodepool.oc1.iad.aaaaaaaaafswgzjyguywemdcgbrtinzygaywmmjwg44tqntbgnzwmyzrgm3d\",\n        \"compartmentId\": \"ocid1.compartment.oc1..aaaaaaaa2id6dilongtl6fmufoeunasaxuv76b6cb4ewxcw4juafe55w5eba\",\n        \"clusterId\": \"ocid1.cluster.oc1.iad.aaaaaaaaae4tsyryg4zwkobvmyzdenzwgjsdiolbgyytcmrymc2wimbqg5rd\",\n        \"name\": \"dev000-oke\",\n        \"kubernetesVersion\": \"v1.11.1\",\n        \"nodeImageId\": \"ocid1.image.oc1.iad.aaaaaaaa2tq67tvbeavcmioghquci6p3pvqwbneq3vfy7fe7m7geiga4cnxa\",\n        \"nodeImageName\": \"Oracle-Linux-7.4\",\n        \"nodeShape\": \"VM.Standard2.2\",\n        \"initialNodeLabels\": [],\n        \"sshPublicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDHzATp/2KhhrVF0CiI6sHX7HA0z+JSAf+5JF5zdD7KnKsO9kS4Y6HV2vPPuV/z/IWIOLQeNOgXZQyC832oOdSAPu7/sag7PxpPXoXTqUJH+hc8zDUJ/WegX1dVhm3zZjU7TvvsjKJMUWO0c7TaRglebkcoMGzTMtU9WHF/7fJ8npOv4DSMC7Y7Ss1263vffpqnUpeBCsAHT6v+JuMsL6wEdYnQnY4GslmS3GTItQ1J2gNBlnMOyfVTOsyQNyw2sxE1AyvYvgxiZRZ1IYOth1al5uJQjEirjrb3llJgKQgMjwAX3zhPBa9E0UzyOx9YuaWJ2Yq8xP3OZ2Jh913KWlLT\",\n        \"quantityPerSubnet\": 1,\n        \"subnetIds\": [\n                \"ocid1.subnet.oc1.iad.aaaaaaaaafa2y2dgywmjbtl6zyvgl2eucgkst3xfunfxm46lyrqg2jvdbjaq\"\n        ],\n        \"nodes\": [\n                {\n                        \"id\": \"ocid1.instance.oc1.iad.abuwcljswg6w4tl4mge46pwfmxjv3zdvkgh4fdu3umfdgpkkrwnymv76eypq\",\n                        \"name\": \"oke-c2wimbqg5rd-nzwmyzrgm3d-rqg2jvdbjaq-0\",\n                        \"availabilityDomain\": \"Ppri:US-ASHBURN-AD-1\",\n                        \"subnetId\": \"ocid1.subnet.oc1.iad.aaaaaaaaafa2y2dgywmjbtl6zyvgl2eucgkst3xfunfxm46lyrqg2jvdbjaq\",\n                        \"nodePoolId\": \"ocid1.nodepool.oc1.iad.aaaaaaaaafswgzjyguywemdcgbrtinzygaywmmjwg44tqntbgnzwmyzrgm3d\",\n                        \"publicIp\": \"132.145.156.184\",\n                        \"nodeError\": null,\n                        \"lifecycleState\": \"ACTIVE\",\n                        \"lifecycleDetails\": \"\"\n                }\n        ]\n}\n```\n\nWhere the flag --tfExternalDs=\"true\" is applied, okectl will run as a [Terraform external data source](https://www.terraform.io/docs/providers/external/data_source.html). The Terraform external data source allows an external program implementing a specific protocol to act as a data source, exposing arbitrary data for use elsewhere in the Terraform configuration.\n\nIn this circumstance, okectl will provide json only response data containing the public IP address of a cluster worker node:\n\n```\n$ ./okectl getOkeNodePool --tfExternalDs=true\n$ {\"workerNodeIp\":\"132.145.156.184\"}\n```\n\nIn combination with the --waitNodesActive flag, this provides the ability to have Terraform wait for worker nodes to be active, then proceed to call a remote-exec provisioner against the worker node via the public IP address returned (e.g. configure cluster or deploy workloads).\n\n### Accessing a cluster\n\nThe Kubernetes cluster will be running after the okectl `createOkeCluster` operation completes.\n\n#### Cluster Operations via CLI\n\nTo operate the cluster using the `kubectl` CLI, first ensure its installed per this [configuration guide][kubectl-guide]. You can then submit requests to the OKE kube api by invoking `kubectl` and specifying the path to the `kubeconfig` file:\n\n```\n$ kubectl cluster-info --kubeconfig=\\path-to-oke-go\\config\\kubeconfig\n```\n\n#### Cluster Operations via Dashboard\n\nTo access the Kubernetes dashboard, ensure that you have kubectl installed \u0026 run the following command:\n\n```\n$ kubectl proxy --kubeconfig=\\path-to-oke-go\\config\\kubeconfig\n```\nOpen a web browser and request the following URL:\nhttp://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/\n\nThe kube dashboard will request authentication method - select _kubeconfig_ as the authentication method, \u0026 point to the local kubeconfig file generated by okectl.\n\n\n## Configuration\n\nDeploying an OKE cluster to OCI requires that certain configuration prerequisites be met on the host system that is running the utility, and in the target OCI tenancy.\n\n### Dependencies\n\n#### OCI\n\nDeploying an OKE cluster to OCI requires that certain configuration prerequisites be met in the target OCI tenancy. These include a Compartment, VCN, Subnets, Internet Gateway, Route Table and Security Lists.\nSee the following guide which provides step-by-step instruction on configuring the dependencies: [Preparing for Container Engine for Kubernetes][oke-guide].\n\n#### Environment\n\nBasic configuration information (for example, user credentials and OCI tenancy OCID) is required in order for the utility to work. You can provide this information by configuring one of the following:\n\n - Using a configuration file:\n   See the following [configuration guide][config-file] for instruction on building a configuration file.\n\n - Using environment variables:\n  ```\n    TF_VAR_user_ocid = (string)\n        OCID of the user calling the API\n    TF_VAR_fingerprint = (string)\n        Fingerprint for the key pair being used\n    TF_VAR_private_key_path = (string)\n        Full path and filename of the private key\n    TF_VAR_region = (string)\n        Oracle Cloud Infrastructure region of your tenancy\n    TF_VAR_tenancy_ocid = (string)\n        OCID of your tenancy\n  ```\nokectl will automatically check for the presence of the configuration file \u0026 environment variables at runtime.\n\n#### Debug\n\nokectl will provide detailed debug information to stdout when specifying the environment varable:\n  ```\n    OCI_GO_SDK_DEBUG = 1\n  ```\n\n## Building okectl from source\n\n### Dependencies\n\n - Install [Go programming language][go]\n - Install [Go SDK for Oracle Cloud Infrastructure][go-sdk]\n\n### Build\n\n```\n$ go build okectl.go\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronsenese%2Fokectl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronsenese%2Fokectl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronsenese%2Fokectl/lists"}