From 766995f12f35b0f25cfeef3a639d41fa1575cfd4 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 6 Dec 2023 20:05:18 +0900 Subject: [PATCH 1/8] Add README with CLI usage descriptions --- README.md | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..90359f1 --- /dev/null +++ b/README.md @@ -0,0 +1,110 @@ +# Scalar Admin k8s + +## Usage of the CLI tool + +```console +Usage: scalar-admin-k8s-cli [-h] [-d=] [-n=] + -r= [-w=] + [-z=] +Scalar Admin pause tool for the Kubernetes environment + -d, --pause-duration= + The duration of the pause period by millisecond. + 5000 (5 seconds) by default. + -h, --help Display the help message. + -n, --namespace= + Namespace that Scalar products you want to pause + are deployed. `default` by default. + -r, --release-name= + Helm's release name that you specify when you run + the `helm install ` command. You + can see the by using the `helm + list` command. + -w, --max-pause-wait-time= + The max wait time (in milliseconds) until Scalar + products drain outstanding requests before they + pause. If omitting this option, the max wait + time will be the default value defined in the + products. Most Scalar products have the default + value of 30 seconds. + -z, --time-zone= Specify a time zone ID, e.g., Asia/Tokyo, to + output successful paused period. Note the time + zone ID is case sensitive. Etc/UTC by default. +``` + +## Run the CLI tool on a Kubernetes environment + +The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-k8s` CLI tool as a pod on the Kubernetes environment and you must: + +1. Create three Kubernetes resources (`Role`, `RoleBinding`, and `ServiceAccount`). + * Role + + ```yaml + apiVersion: rbac.authorization.k8s.io/v1 + kind: Role + metadata: + name: scalar-admin-k8s-role + namespace: + rules: + - apiGroups: ["", "apps"] + resources: ["pods", "deployments", "services"] + verbs: ["get", "list"] + ``` + + * RoleBinding + + ```yaml + apiVersion: rbac.authorization.k8s.io/v1 + kind: RoleBinding + metadata: + name: scalar-admin-k8s-rolebinding + namespace: + subjects: + - kind: ServiceAccount + name: scalar-admin-k8s-sa + roleRef: + kind: Role + name: scalar-admin-k8s-role + apiGroup: rbac.authorization.k8s.io + ``` + + * ServiceAccount + + ```yaml + apiVersion: v1 + kind: ServiceAccount + metadata: + name: scalar-admin-k8s-sa + namespace: + ``` + +1. Mount the `ServiceAccount` on the `scalar-admin-k8s` pod. + * Pod + + ```yaml + apiVersion: v1 + kind: Pod + metadata: + name: scalar-admin-k8s + namespace: + spec: + serviceAccountName: scalar-admin-k8s-sa + containers: + - name: scalar-admin-k8s + image: ghcr.io/scalar-labs/scalar-admin-k8s:1.0.0 + command: + - java + - -jar + - /app.jar + - -r + - + - -n + - + - -d + - + - -z + - + ``` + +## Run the CLI tool on a Kubernetes environment by using Helm Chart + +Coming soon. From ddad824d269608f9d8ec3b851948636bc2ef106a Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:03:49 +0900 Subject: [PATCH 2/8] Apply suggestions from code review Co-authored-by: Josh Wong --- README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 90359f1..67cb849 100644 --- a/README.md +++ b/README.md @@ -31,11 +31,12 @@ Scalar Admin pause tool for the Kubernetes environment zone ID is case sensitive. Etc/UTC by default. ``` -## Run the CLI tool on a Kubernetes environment +## Run the CLI tool in a Kubernetes environment The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-k8s` CLI tool as a pod on the Kubernetes environment and you must: -1. Create three Kubernetes resources (`Role`, `RoleBinding`, and `ServiceAccount`). +1. Create three Kubernetes resources (`Role`, `RoleBinding`, and `ServiceAccount`), replacing the contents in the angle brackets as described: + * Role ```yaml @@ -77,7 +78,8 @@ The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal process namespace: ``` -1. Mount the `ServiceAccount` on the `scalar-admin-k8s` pod. +1. Mount the `ServiceAccount` on the `scalar-admin-k8s` pod, replacing the contents in the angle brackets as described: + * Pod ```yaml @@ -105,6 +107,6 @@ The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal process - ``` -## Run the CLI tool on a Kubernetes environment by using Helm Chart +## Run the CLI tool in a Kubernetes environment by using a Helm Chart Coming soon. From c3656bf0474caba994f825c28f0b39648a6a748d Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:19:30 +0900 Subject: [PATCH 3/8] Update product name --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 67cb849..581aa27 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ -# Scalar Admin k8s +# Scalar Admin for Kubernetes ## Usage of the CLI tool ```console -Usage: scalar-admin-k8s-cli [-h] [-d=] [-n=] - -r= [-w=] - [-z=] +Usage: scalar-admin-for-kubernetes-cli [-h] [-d=] + [-n=] -r= + [-w=] [-z=] Scalar Admin pause tool for the Kubernetes environment -d, --pause-duration= The duration of the pause period by millisecond. @@ -33,7 +33,7 @@ Scalar Admin pause tool for the Kubernetes environment ## Run the CLI tool in a Kubernetes environment -The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-k8s` CLI tool as a pod on the Kubernetes environment and you must: +The `scalar-admin-for-kubernetes` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-for-kubernetes` CLI tool as a pod on the Kubernetes environment and you must: 1. Create three Kubernetes resources (`Role`, `RoleBinding`, and `ServiceAccount`), replacing the contents in the angle brackets as described: @@ -43,7 +43,7 @@ The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal process apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: - name: scalar-admin-k8s-role + name: scalar-admin-for-kubernetes-role namespace: rules: - apiGroups: ["", "apps"] @@ -57,14 +57,14 @@ The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal process apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: - name: scalar-admin-k8s-rolebinding + name: scalar-admin-for-kubernetes-rolebinding namespace: subjects: - kind: ServiceAccount - name: scalar-admin-k8s-sa + name: scalar-admin-for-kubernetes-sa roleRef: kind: Role - name: scalar-admin-k8s-role + name: scalar-admin-for-kubernetes-role apiGroup: rbac.authorization.k8s.io ``` @@ -74,11 +74,11 @@ The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal process apiVersion: v1 kind: ServiceAccount metadata: - name: scalar-admin-k8s-sa + name: scalar-admin-for-kubernetes-sa namespace: ``` -1. Mount the `ServiceAccount` on the `scalar-admin-k8s` pod, replacing the contents in the angle brackets as described: +1. Mount the `ServiceAccount` on the `scalar-admin-for-kubernetes` pod, replacing the contents in the angle brackets as described: * Pod @@ -86,13 +86,13 @@ The `scalar-admin-k8s` CLI tool executes Kubernetes APIs in its internal process apiVersion: v1 kind: Pod metadata: - name: scalar-admin-k8s + name: scalar-admin-for-kubernetes namespace: spec: - serviceAccountName: scalar-admin-k8s-sa + serviceAccountName: scalar-admin-for-kubernetes-sa containers: - - name: scalar-admin-k8s - image: ghcr.io/scalar-labs/scalar-admin-k8s:1.0.0 + - name: scalar-admin-for-kubernetes + image: ghcr.io/scalar-labs/scalar-admin-for-kubernetes:1.0.0 command: - java - -jar From 71c433ebdb7cad746e75a60eb4073d24743acc2c Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Mon, 25 Dec 2023 15:31:04 +0900 Subject: [PATCH 4/8] Apply suggestions from code review --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 581aa27..3e6a7cc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Scalar Admin for Kubernetes +Scalar Admin for Kubernetes is a tool that creates a paused state for Scalar products (for example, ScalarDB and ScalarDL) in a Kubernetes environment. You can use such a paused state to take backups easily and consistently across multiple diverse databases. + ## Usage of the CLI tool ```console From 6377a3c234e543aa4a2cd215d14fe3065fe075fd Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:27:32 +0900 Subject: [PATCH 5/8] Update README.md Co-authored-by: Josh Wong --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3e6a7cc..b60a379 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Scalar Admin for Kubernetes -Scalar Admin for Kubernetes is a tool that creates a paused state for Scalar products (for example, ScalarDB and ScalarDL) in a Kubernetes environment. You can use such a paused state to take backups easily and consistently across multiple diverse databases. +Scalar Admin for Kubernetes is a tool that creates a paused state for ScalarDB or ScalarDL in a Kubernetes environment. You can use such a paused state to take backups easily and consistently across multiple diverse databases. ## Usage of the CLI tool From af9596a4dc8142709acf2421e61d500a7aab30bc Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:28:40 +0900 Subject: [PATCH 6/8] Update README.md Co-authored-by: Josh Wong --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b60a379..1d786aa 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Scalar Admin pause tool for the Kubernetes environment ## Run the CLI tool in a Kubernetes environment -The `scalar-admin-for-kubernetes` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-for-kubernetes` CLI tool as a pod on the Kubernetes environment and you must: +The `scalar-admin-for-kubernetes` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-for-kubernetes` CLI tool as a pod in the Kubernetes environment and do the following: 1. Create three Kubernetes resources (`Role`, `RoleBinding`, and `ServiceAccount`), replacing the contents in the angle brackets as described: From 7a9ed872e1cbff10e4b8f21390719c6f5ebcb659 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:28:59 +0900 Subject: [PATCH 7/8] Update README.md Co-authored-by: Josh Wong --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d786aa..17aca85 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ The `scalar-admin-for-kubernetes` CLI tool executes Kubernetes APIs in its inter namespace: ``` -1. Mount the `ServiceAccount` on the `scalar-admin-for-kubernetes` pod, replacing the contents in the angle brackets as described: +1. Mount the `ServiceAccount` resource on the `scalar-admin-for-kubernetes` pod, replacing the contents in the angle brackets as described: * Pod From 8d5d2a4e3a8686ecba1c1607e98224988f547ec4 Mon Sep 17 00:00:00 2001 From: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:32:02 +0900 Subject: [PATCH 8/8] Apply suggestion from code review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 17aca85..f00f0cb 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Scalar Admin pause tool for the Kubernetes environment ## Run the CLI tool in a Kubernetes environment -The `scalar-admin-for-kubernetes` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-for-kubernetes` CLI tool as a pod in the Kubernetes environment and do the following: +The `scalar-admin-for-kubernetes` CLI tool executes Kubernetes APIs in its internal processes. To run those Kubernetes APIs, you must run the `scalar-admin-for-kubernetes` CLI tool as a pod on the Kubernetes environment by following the steps below: 1. Create three Kubernetes resources (`Role`, `RoleBinding`, and `ServiceAccount`), replacing the contents in the angle brackets as described: