diff --git a/README.md b/README.md index 02f02a1d8..afcb469a9 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,7 @@ The Kubefirst CLI is a cloud provisioning tool. With simple setup and two CLI commands, we create a kubernetes cluster managed with automated Infrastructure as Code, GitOps asset management and application delivery, secrets management, a sample application delivered to development, staging, and production, and so much more. It's an open source platform ready to be customized to suit your company's needs. - [DNS Setup](#dns-setup) -- [Clone the Repository](#clone-the-repository) -- [Start the Container](#start-the-container) -- [Connect to the Container](#connect-to-the-container) +- [Installing the CLI](#installing-the-cli) - [Initialization](#initialization) - [Creation](#creation) - [Access ArgoCD](#access-argocd) @@ -61,33 +59,14 @@ gitlab.subdomain.example.com ... ``` -## Clone the repository +## Installing the CLI -Clone the repository to have the latest `main` branch content - -```bash -# via HTTPS -git clone https://github.com/kubefirst/kubefirst.git - -# via SSH -git clone git@github.com:kubefirst/kubefirst.git -``` - -## Start the Container - -We run everything in isolation with Docker, for that, start the container with: - -```bash -docker-compose up kubefirst +```bash +brew install kubefirst/tools/kubefirst ``` +## Other installation techniques: -## Connect to the Container - -Open a new terminal to connect to the container to run kubefirst - -```bash -docker exec -it kubefirst bash -``` +[Details Here](./build/README.md) ## Initialization @@ -111,20 +90,27 @@ At this point, everything is ready to start provisioning the cloud services, and kubefirst cluster create ``` -## Access ArgoCD +## Destroy + +It will destroy the kubefirst management cluster, and clean up every change made in the cloud. ```bash -aws eks update-kubeconfig --name your_cluster_name -kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d -kubectl -n argocd port-forward svc/argocd-server 8080:80 +kubefirst destroy ``` -## Destroy +# What to do next + +[Learn More - Getting Started](https://docs.kubefirst.com/kubefirst/getting-started.html) -It will destroy the kubefirst management cluster, and clean up every change made in the cloud. + +# If you want learn more + +## Access ArgoCD ```bash -kubefirst destroy +aws eks update-kubeconfig --name your_cluster_name +kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d +kubectl -n argocd port-forward svc/argocd-server 8080:80 ``` ## Available Commands diff --git a/build/Dockerfile b/build/Dockerfile index e1f5b0627..977b7effe 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,6 +1,7 @@ -FROM --platform=linux/amd64 golang:1.18 +FROM --platform=linux/amd64 buildpack-deps:bullseye-scm +# we are using buidlpack-deps:bullseye-scm https://github.com/docker-library/golang/blob/8d0fa6028120904e16fe761f095bd0620b68eab2/1.18/bullseye/Dockerfile -WORKDIR /opt/kubefirst-install +ARG KUBEFIRST_VERSION=1.8.6 RUN apt-get update && \ apt-get install -y unzip curl jq vim unzip less \ @@ -28,19 +29,15 @@ RUN curl -LO https://s3.us-west-2.amazonaws.com/amazon-eks/1.21.2/2021-07-05/bin chmod +x aws-iam-authenticator && \ mv aws-iam-authenticator /usr/local/bin/ +# Kubefirst cli +RUN curl -LO https://github.com/kubefirst/kubefirst/releases/download/$KUBEFIRST_VERSION/kubefirst-$KUBEFIRST_VERSION-linux-amd64.tar.gz && \ + tar -xvzf kubefirst-$KUBEFIRST_VERSION-linux-amd64.tar.gz -C /usr/local/bin/ && \ + chmod +x /usr/local/bin/kubefirst && \ + rm kubefirst-$KUBEFIRST_VERSION-linux-amd64.tar.gz # setup user RUN useradd -ms /bin/bash developer USER developer WORKDIR /home/developer/kubefirst -COPY --chown=developer:developer . . - -# download dependencies and prepare fresh installation -RUN go mod download && \ - go build - -USER root -RUN mv ./kubefirst /usr/local/bin/ && chmod 777 /usr/local/bin/kubefirst -USER developer RUN kubefirst clean diff --git a/build/README.md b/build/README.md new file mode 100644 index 000000000..fcab988af --- /dev/null +++ b/build/README.md @@ -0,0 +1,73 @@ +# Overview + +This page provide sevral ways to explore kubefirst cli, to allow you to choose the one the better fits your prefered way of work. + + +# Requirements to run the CLI + +In order for the CLI to work, We assume you gave your [AWS Credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) files at: `$HOME/.aws`. + + +# Getting the binary for linux + +```bash +#Check the release page: +#https://github.com/kubefirst/kubefirst/releases + +export KUBEFIRST_VERSION=`curl https://github.com/kubefirst/kubefirst/releases/latest -Ls -o /dev/null -w %{url_effective} | grep -oE "[^/]+$"` +curl -LO https://github.com/kubefirst/kubefirst/releases/download/$KUBEFIRST_VERSION/kubefirst-$KUBEFIRST_VERSION-linux-amd64.tar.gz + +tar -xvzf kubefirst-$KUBEFIRST_VERSION-linux-amd64.tar.gz -C /usr/local/bin/ +chmod +x /usr/local/bin/kubefirst + +kubefirst info +``` + + +# Running CLI in docker container + +Based on image: https://hub.docker.com/kubefirst/kubefirst + +You can easily run it, without any installation step with: +```bash +docker run \ + -it --name kubefirst \ + --dns="1.0.0.1" --dns="208.67.222.222" --dns="8.8.8.8" \ + -v $(PWD):/opt/kubefirst \ + -v $HOME/.aws:/home/developer/.aws \ + kubefirst/kubefirst +``` + +After this step is executed, return to [this step](https://github.com/kubefirst/kubefirst#initialization) to run a `kubefirst info` and other functions. + +# Running CLI from a Docker-Compose container + +## Clone the repository + +Clone the repository to have the latest `main` branch content: + +```bash +# via HTTPS +git clone https://github.com/kubefirst/kubefirst.git + +# via SSH +git clone git@github.com:kubefirst/kubefirst.git +``` + +## Start the Container + +We run everything in isolation with Docker, for that, start the container with: + +```bash +docker-compose up kubefirst +``` + +## Connect to the Container + +Open a new terminal to connect to the container to run kubefirst: + +```bash +docker exec -it kubefirst bash +``` + +After this step is executed, return to [this step](https://github.com/kubefirst/kubefirst#initialization) to run a `kubefirst info` and other functions. diff --git a/build/dev/Dockerfile b/build/dev/Dockerfile new file mode 100644 index 000000000..e1f5b0627 --- /dev/null +++ b/build/dev/Dockerfile @@ -0,0 +1,46 @@ +FROM --platform=linux/amd64 golang:1.18 + +WORKDIR /opt/kubefirst-install + +RUN apt-get update && \ + apt-get install -y unzip curl jq vim unzip less \ + && rm -rf /var/lib/apt/lists/* + +# Kubernetes client +RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.21.3/bin/$(uname -s)/amd64/kubectl && \ + chmod +x ./kubectl && \ + mv kubectl /usr/local/bin/ + +# AWS cli +RUN curl -LO https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip && \ + unzip awscli-exe-linux-x86_64.zip && \ + ./aws/install && \ + rm -r aws && \ + rm awscli-exe-linux-x86_64.zip + +# AWS EKS cli +RUN curl -LO https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_linux_amd64.tar.gz && \ + tar -xvzf eksctl_linux_amd64.tar.gz -C /usr/local/bin/ && \ + rm eksctl_linux_amd64.tar.gz + +# AWS IAM Authenticator tool +RUN curl -LO https://s3.us-west-2.amazonaws.com/amazon-eks/1.21.2/2021-07-05/bin/linux/amd64/aws-iam-authenticator && \ + chmod +x aws-iam-authenticator && \ + mv aws-iam-authenticator /usr/local/bin/ + + +# setup user +RUN useradd -ms /bin/bash developer +USER developer +WORKDIR /home/developer/kubefirst + +COPY --chown=developer:developer . . + +# download dependencies and prepare fresh installation +RUN go mod download && \ + go build + +USER root +RUN mv ./kubefirst /usr/local/bin/ && chmod 777 /usr/local/bin/kubefirst +USER developer +RUN kubefirst clean diff --git a/configs/config.go b/configs/config.go index 6184bcaac..1e7afe6e8 100644 --- a/configs/config.go +++ b/configs/config.go @@ -77,7 +77,7 @@ func ReadConfig() *Config { config.HelmVersion = "v3.6.1" config.KubectlVersionM1 = "v1.21.14" - config.KubefirstVersion = "1.8.5" + config.KubefirstVersion = "1.8.6" config.InstallerEmail = "kubefirst-bot@kubefirst.com" diff --git a/docker-compose.yaml b/docker-compose.yaml index f770547b9..8ef1db533 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,7 +1,6 @@ version: "3" services: - kubefirst: platform: linux/amd64 build: @@ -10,15 +9,10 @@ services: container_name: kubefirst environment: TERM: xterm-256color - ports: - - "8080:8080" # ArgoCD - - "8888:8888" # GitLab - - "8200:8200" # Vault volumes: - ./:/opt/kubefirst # AWS credentials are strictly used to provision the Kubefirst in your AWS account - $HOME/.aws:/home/developer/.aws - command: sh -c "./scripts/kubefirst.sh" dns: - 208.67.222.222 #Cisco DNS - 1.1.1.1 #Cloudflare DNS