Skip to content

Commit

Permalink
Automated commit of npm build result and updated readme files
Browse files Browse the repository at this point in the history
  • Loading branch information
cbodonnell authored and github-actions[bot] committed Sep 22, 2023
1 parent a7383f3 commit d7366f0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions create-cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ kubernetes_distribution ---> create_cluster
kubernetes_version ---> create_cluster
cluster_name ---> create_cluster
ttl ---> create_cluster
disk_gib ---> create_cluster
node_count ---> create_cluster
instance_type ---> create_cluster
timeout_minutes ---> create_cluster
kubeconfig_path ---> create_cluster
export_kubeconfig ---> create_cluster
Expand All @@ -25,6 +28,9 @@ create_cluster ---> cluster_kubeconfig
| kubernetes-version | | True | Kubernetes version to provision (format is distribution dependent). |
| cluster-name | | True | Name of the cluster to provision |
| ttl | | False | Cluster TTL (duration, max 48h) |
| disk-gib | | False | Disk size in GiB |
| node-count | | False | Number of nodes to provision |
| instance-type | | False | Instance type to provision |
| timeout-minutes | 20 | False | Time to wait for the cluster to have a status of `running` |
| kubeconfig-path | | False | If specified, the kubeconfig will be written to this path |
| export-kubeconfig | false | False | Export the KUBECONFIG variable (true/false) |
Expand Down
11 changes: 8 additions & 3 deletions create-cluster/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ function run() {
const k8sDistribution = core.getInput('kubernetes-distribution');
const k8sVersion = core.getInput('kubernetes-version');
const k8sTTL = core.getInput('ttl');
const diskGib = +(core.getInput('disk-gib') || 50);
const nodeCount = +(core.getInput('node-count') || 1);
const instanceType = core.getInput('instance-type');
const timeoutMinutes = +(core.getInput('timeout-minutes') || 20);
const apiEndpoint = core.getInput('replicated-api-endpoint');
let kubeconfigPath = core.getInput('kubeconfig-path');
Expand All @@ -38,7 +41,7 @@ function run() {
if (apiEndpoint) {
apiClient.endpoint = apiEndpoint;
}
let cluster = yield (0, replicated_lib_1.createCluster)(apiClient, name, k8sDistribution, k8sVersion, k8sTTL);
let cluster = yield (0, replicated_lib_1.createCluster)(apiClient, name, k8sDistribution, k8sVersion, k8sTTL, diskGib, nodeCount, instanceType);
core.info(`Created cluster ${cluster.id} - waiting for it to be ready...`);
core.setOutput('cluster-id', cluster.id);
cluster = yield (0, replicated_lib_1.pollForStatus)(apiClient, cluster.id, 'running', timeoutMinutes * 60);
Expand Down Expand Up @@ -30491,14 +30494,16 @@ exports.Cluster = Cluster;
class ClusterVersion {
}
exports.ClusterVersion = ClusterVersion;
async function createCluster(vendorPortalApi, clusterName, k8sDistribution, k8sVersion, clusterTTL) {
async function createCluster(vendorPortalApi, clusterName, k8sDistribution, k8sVersion, clusterTTL, diskGib, nodeCount, instanceType) {
const http = await vendorPortalApi.client();
const reqBody = {
"name": clusterName,
"kubernetes_distribution": k8sDistribution,
"kubernetes_version": k8sVersion,
"ttl": clusterTTL,
"disk_gib": 50,
"disk_gib": diskGib || 50,
"node_count": nodeCount || 1,
"instance_type": instanceType
};
const uri = `${vendorPortalApi.endpoint}/cluster`;
const res = await http.post(uri, JSON.stringify(reqBody));
Expand Down
2 changes: 1 addition & 1 deletion create-cluster/dist/index.js.map

Large diffs are not rendered by default.

0 comments on commit d7366f0

Please sign in to comment.