-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
206 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
# Update the version and SHA256 for the CLI when new version is released | ||
require 'formula' | ||
class Kitcli < Formula | ||
class Kitctl < Formula | ||
homepage 'https://github.com/awslabs/kubernetes-iteration-toolkit/substrate' | ||
version '$VERSION' | ||
if OS.mac? && Hardware::CPU.is_64_bit? | ||
url 'https://github.com/awslabs/kubernetes-iteration-toolkit/releases/download/$VERSION/kitcli_$VERSION_darwin_amd64.zip' | ||
url 'https://github.com/awslabs/kubernetes-iteration-toolkit/releases/download/$VERSION/kitctl_$VERSION_darwin_amd64.zip' | ||
sha256 '$SHA256' | ||
else | ||
echo "Hardware not supported" | ||
exit 1 | ||
end | ||
def install | ||
bin.install 'kitcli' | ||
bin.install 'kitctl' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,106 @@ | ||
# KITCLI | ||
# kitctl | ||
|
||
## Installing KITCLI | ||
## Installing kitctl | ||
|
||
```bash | ||
brew tap awslabs/kit https://github.com/awslabs/kubernetes-iteration-toolkit.git | ||
brew install kitcli | ||
brew install kitctl | ||
``` | ||
|
||
## Usage | ||
kitctl helps provision an AWS infrastructure environment to deploy Kubernetes clusters using kit-operator. It runs a single node kubernetes cluster in a VPC installed with all the required controllers like Karpeneter, KIT-operator, ELB controller and EBS CSI Driver to manage the lifecycle of clusters. kitctl also creates the necessary IAM permissions required for these controllers. | ||
To get started make sure you have admin access to AWS. | ||
|
||
```sh | ||
kitcli apply | ||
kitcli delete | ||
### Bootstrap an environment in AWS to run Kubernetes clusters using kit-operator | ||
|
||
```bash | ||
kitctl bootstrap | ||
``` | ||
> Set KUBECONFIG to access the environment with the kubeconfig location provided from this command | ||
```shell | ||
cat <<EOF | kitcli apply -f - | ||
apiVersion: kit.sh/v1alpha1 | ||
kind: Substrate | ||
### Configure Karpenter to provision nodes for the Kubernetes cluster control plane | ||
|
||
```bash | ||
GUEST_CLUSTER_NAME=foo # Desired Cluster name | ||
SUBSTRATE_CLUSTER_NAME=test-substrate | ||
``` | ||
|
||
```bash | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: karpenter.sh/v1alpha5 | ||
kind: Provisioner | ||
metadata: | ||
name: ${USER} | ||
name: master-nodes | ||
spec: | ||
instanceType: c5.2xlarge | ||
--- | ||
apiVersion: kit.sh/v1alpha1 | ||
kind: Cluster | ||
kubeletConfiguration: | ||
clusterDNS: | ||
- "10.96.0.10" | ||
labels: | ||
kit.k8s.sh/app: ${GUEST_CLUSTER_NAME}-apiserver | ||
kit.k8s.sh/control-plane-name: ${GUEST_CLUSTER_NAME} | ||
provider: | ||
instanceProfile: kit-${SUBSTRATE_CLUSTER_NAME}-tenant-controlplane-node-role | ||
subnetSelector: | ||
karpenter.sh/discovery: ${SUBSTRATE_CLUSTER_NAME} | ||
securityGroupSelector: | ||
kubernetes.io/cluster/${SUBSTRATE_CLUSTER_NAME}: owned | ||
tags: | ||
kit.aws/substrate: ${SUBSTRATE_CLUSTER_NAME} | ||
ttlSecondsAfterEmpty: 30 | ||
EOF | ||
``` | ||
|
||
```bash | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: karpenter.sh/v1alpha5 | ||
kind: Provisioner | ||
metadata: | ||
name: ${USER} | ||
spec: {} | ||
name: etcd-nodes | ||
spec: | ||
kubeletConfiguration: | ||
clusterDNS: | ||
- "10.96.0.10" | ||
labels: | ||
kit.k8s.sh/app: ${GUEST_CLUSTER_NAME}-etcd | ||
kit.k8s.sh/control-plane-name: ${GUEST_CLUSTER_NAME} | ||
provider: | ||
instanceProfile: kit-${SUBSTRATE_CLUSTER_NAME}-tenant-controlplane-node-role | ||
subnetSelector: | ||
karpenter.sh/discovery: ${SUBSTRATE_CLUSTER_NAME} | ||
securityGroupSelector: | ||
kubernetes.io/cluster/${SUBSTRATE_CLUSTER_NAME}: owned | ||
tags: | ||
kit.aws/substrate: ${SUBSTRATE_CLUSTER_NAME} | ||
ttlSecondsAfterEmpty: 30 | ||
EOF | ||
EOF | ||
``` | ||
|
||
### Provision a Kubernetes cluster control plane | ||
|
||
kitcli delete substrate ${USER} | ||
```bash | ||
cat <<EOF | kubectl apply -f - | ||
apiVersion: kit.k8s.sh/v1alpha1 | ||
kind: ControlPlane | ||
metadata: | ||
name: ${GUEST_CLUSTER_NAME} # Desired Cluster name | ||
spec: {} | ||
EOF | ||
``` | ||
|
||
## Developing | ||
### cleanup | ||
|
||
- To remove the kubernetes cluster provisioned using kit-operator | ||
|
||
```bash | ||
kubectl delete controlplane ${GUEST_CLUSTER_NAME} | ||
``` | ||
alias kitcli="go run ./cmd" | ||
|
||
- To clean up the AWS environment | ||
|
||
```bash | ||
kitctl helps provision an AWS infrastructure environment to deploy Kubernetes clusters using kit-operator. It runs a single node kubernetes cluster with all the required controllers like Karpeneter, KIT-operator, ELB controller and EBS CSI Driver to manage the lifecycle of clusters. kitctl also creates the necessary delete | ||
``` | ||
|
||
### Debug logs | ||
Run the `kitctl helps provision an AWS infrastructure environment to deploy Kubernetes clusters using kit-operator. It runs a single node kubernetes cluster with all the required controllers like Karpeneter, KIT-operator, ELB controller and EBS CSI Driver to manage the lifecycle of clusters. kitctl also creates the necessary` commands with `--debug` flag |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.