From 7fae600664a6cead3c4849d381c8a580c120b1a2 Mon Sep 17 00:00:00 2001 From: abdennour Date: Sun, 25 Jul 2021 03:07:29 +0300 Subject: [PATCH] feat: v0.1.0 --- .env.example | 5 +- Makefile | 6 +-- docs/getting-started/cli/falco.md | 19 ++++++++ docs/getting-started/installation.md | 11 +++++ docs/getting-started/quickstart.md | 72 +++++++++++++++++++++++++++- mkdocs.yml | 1 + pkg/commands/app.go | 4 +- 7 files changed, 107 insertions(+), 11 deletions(-) create mode 100644 docs/getting-started/cli/falco.md diff --git a/.env.example b/.env.example index 5aaa60a..18df502 100644 --- a/.env.example +++ b/.env.example @@ -1,7 +1,4 @@ GOOGLE_ANALYTICS_KEY= BUCKET_BINARIES= -CFN_STACK_NAME=cks-cli-web -CFN_ENVIRONMENT=prod -CFN_SSL_CERT_ARN=arn:aws:acm:REGION:ACCOUNTID:certificate/UUID -CFN_HOSTS=host.example.com,host2.example.com +BUCKET_WEBSITE= AWS_REGION= \ No newline at end of file diff --git a/Makefile b/Makefile index 558d1a8..0455eb1 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,8 @@ build-all: release-binary: make build-all - aws s3 sync ./bin/ s3://$(BUCKET_BINARIES)/cks-cli/$(VERSION) --delete --region eu-west-1 - aws s3 sync s3://$(BUCKET_BINARIES)/cks-cli/$(VERSION) s3://$(BUCKET_BINARIES)/cks-cli/latest --delete --region eu-west-1 + aws s3 sync ./bin/ s3://$(BUCKET_BINARIES)/cks-cli/$(VERSION) --delete --region $(BUCKET_BINARIES_AWS_REGION) + aws s3 sync s3://$(BUCKET_BINARIES)/cks-cli/$(VERSION) s3://$(BUCKET_BINARIES)/cks-cli/latest --delete --region $(BUCKET_BINARIES_AWS_REGION) mkdocs-serve: docker build -t $(MKDOCS_IMAGE) -f docs/build/Dockerfile docs/build docker run --name mkdocs-serve --rm --env-file .env -v $(PWD):/docs -p $(MKDOCS_PORT):8000 $(MKDOCS_IMAGE) @@ -32,7 +32,7 @@ mkdocs-gen: release-docs: make mkdocs-gen - aws s3 sync ./public/ s3://$(BUCKET_WEBSITE)/ --delete --region us-east-1 + aws s3 sync ./public/ s3://$(BUCKET_WEBSITE)/ --delete --region $(BUCKET_WEBSITE_AWS_REGION) release-infra: echo bash deploy/cloudformation/apply.sh diff --git a/docs/getting-started/cli/falco.md b/docs/getting-started/cli/falco.md new file mode 100644 index 0000000..469577c --- /dev/null +++ b/docs/getting-started/cli/falco.md @@ -0,0 +1,19 @@ +# Falco + +```bash +NAME: + cks falco - teach falco in CKS context + +USAGE: + cks falco command [command options] falco_install + +COMMANDS: + check-requirements, req check if your machines meet requirements to install the cluster + install, i install falco (support Ubuntu 20 OS only for now) + tutorial, t, tuto tuto falco + rules, r rules falco + help, h Shows a list of commands or help for one command + +OPTIONS: + --help, -h show help (default: false) +``` \ No newline at end of file diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index bc3ab73..33a8980 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -10,3 +10,14 @@ ``` + +## OS X + +=== "Binary" + Download it then install it + ```bash + curl -o cks https://k8s.tn/cks-cli/latest/cks-darwin-amd64 && \ + chmod +x cks && sudo mv cks /usr/local/bin + + ``` + diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 0394f76..8955efd 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -118,11 +118,79 @@ cks cluster join --master 172.31.118.222:6443 --token ppblkq.6uafwx1q03m0cxbq -- [kubelet-start] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env" [kubelet-start] Starting the kubelet [kubelet-start] Waiting for the kubelet to perform the TLS Bootstrap... - This node has joined the cluster: * Certificate signing request was sent to apiserver and a response was received. * The Kubelet was informed of the new secure connection details. - Run 'kubectl get nodes' on the control-plane to see this node join the cluster ``` + +## Falco + +**install falco** + +Identify one of your worker nodes and install falco + +``` +$ cks falco install + +``` + +
+Result + +``` +... +.... +.... + +``` + +
+ + +**Follow falco tutorial** + +Enjoy a falco tutorial step by step + +``` +$ cks falco tuto + +``` + +
+Result + +``` + ____ _ ____ _____ +/ ___| / \ | _ \_ _| +\___ \ / _ \ | |_) || | + ___) / ___ \| _ < | | +|____/_/ \_\_| \_\|_| +### Create Namespace for the demo ### + +kubectl create ns demo-falco + +# Are you done? [y/n]: +...... +..... +.... + _____ _ _ ____ +| ____| \ | | _ \ +| _| | \| | | | | +| |___| |\ | |_| | +|_____|_| \_|____/ +### Clean up namespace + +kubectl delete ns demo-falco + + +## check another advanced tuto in this link : +https://k8s.tn/rdiL4i + +# Clean up done? [y/n]: y +END of Falco Tuto - Congrats! + +``` + +
diff --git a/mkdocs.yml b/mkdocs.yml index 8de6f0b..50ea13f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,6 +19,7 @@ nav: - CLI: - Overview: getting-started/cli/index.md - Cluster: getting-started/cli/cluster.md + - Falco: getting-started/cli/falco.md # - Config: getting-started/cli/config.md # - Filesystem: getting-started/cli/fs.md # - Repository: getting-started/cli/repo.md diff --git a/pkg/commands/app.go b/pkg/commands/app.go index 1c6101b..70eb58e 100644 --- a/pkg/commands/app.go +++ b/pkg/commands/app.go @@ -143,7 +143,7 @@ func NewFalcoCommand() *cli.Command { Name: "falco", Aliases: []string{"f"}, ArgsUsage: "falco_install", - Usage: "manage cluster (support Ubuntu 20 OS only for now)", + Usage: "teach falco in CKS context", Subcommands: cli.Commands{ { Name: "check-requirements", @@ -155,7 +155,7 @@ func NewFalcoCommand() *cli.Command { { Name: "install", Aliases: []string{"i"}, - Usage: "install falco", + Usage: "install falco (support Ubuntu 20 OS only for now)", ArgsUsage: "", Action: falco.Install, Flags: falcoInstallFlags,