-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker image to run kubefirst bin inside container (#250)
Bump to release 1.8.6 Signed-off-by: 6za <[email protected]> Signed-off-by: Thiago Pagotto <[email protected]> Signed-off-by: 6za <[email protected]> Co-authored-by: 6za <[email protected]>
- Loading branch information
Showing
6 changed files
with
148 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected]: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 | ||
|
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 |
---|---|---|
@@ -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 [email protected]: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. |
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 |
---|---|---|
@@ -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 |
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 |
---|---|---|
|
@@ -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 = "[email protected]" | ||
|
||
|
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