DEV Community

Choonho Son
Choonho Son

Posted on

Cloudforet minimal installation

Overview

This is Cloudforet minimum installation. Just for installation disabling lots of components.

This has new helm values (minimum.yaml file)

#############################################
# Minimum deployment for developer
# * Very small CPU, Memory resources (3GB minikube)
# * Disable scheduler, worker
#############################################


spacectl:
  enabled: false
marketplace-assets:
  enabled: false
plugin:
  enabled: true
  scheduler: false
  worker: false
cost-analysis:
  enabled: false
notification:
  enabled: false
statistics:
  enabled: true
  scheduler: false
  worker: false
monitoring:
  enabled: true
  scheduler: false
  worker: false
  rest: false
inventory:
  enabled: true
  scheduler: false
  worker: false
Enter fullscreen mode Exit fullscreen mode

Prerequisites

  • AWS EC2 VM (ex. t3.medium 2 cores, 4GB memory, 30GB Disk)
  • Docker/Docker Desktop
    • If you don't have Docker installed, minikube will return an error as minikube uses docker as the driver.
    • Highly recommend installing Docker Desktop based on your OS.
  • Minikube
    • Requires minimum Kubernetes version of 1.21+.
  • Kubectl
  • Helm
    • Requires minimum Helm version of 3.11.0+.
    • If you want to learn more about Helm, refer to this.

Before diving into the Cloudforet Installation process, start minikube by running the command below.

At least, 3GB memory is needed

minikube start --driver=docker --memory=3000mb
Enter fullscreen mode Exit fullscreen mode

Installation

You can install the Cloudforet by the following the steps below.

1) Setting up Helm Chart Repository

This command adds Helm repository.

helm repo add cloudforet https://cloudforet-io.github.io/charts 
Enter fullscreen mode Exit fullscreen mode

This command updates repositories basd on latest version of chart repository.

helm repo update
Enter fullscreen mode Exit fullscreen mode

This command list contents of the repository.

helm search repo
Enter fullscreen mode Exit fullscreen mode

2) Create Namespaces

kubectl create ns spaceone
Enter fullscreen mode Exit fullscreen mode
kubectl create ns spaceone-plugin
Enter fullscreen mode Exit fullscreen mode

3) Create Role and RoleBinding

First, download the rbac.yaml file.

The rbac.yaml file basically serves as a means to regulate access to computer or network resources based on the roles of individual users. For more information about RBAC Authorization in Kubernetes, refer to this.

If you are used to downloading files via command-line, run this command to download the file.

wget https://raw.githubusercontent.com/cloudforet-io/charts/master/examples/rbac.yaml -O rbac.yaml
Enter fullscreen mode Exit fullscreen mode

Next, execute the following command.

kubectl apply -f rbac.yaml -n spaceone-plugin
Enter fullscreen mode Exit fullscreen mode

4) Install Cloudforet Chart

Download helm values.yaml for minimal install

wget https://raw.githubusercontent.com/cloudforet-io/charts/master/examples/values/minimum.yaml
Enter fullscreen mode Exit fullscreen mode

This command basically let Helm search for the chart named cloudforet in the repository named spaceone.

helm install cloudforet cloudforet/spaceone -n spaceone -f minimum.yaml
Enter fullscreen mode Exit fullscreen mode

After executing the above command, check the status of the pod.

mzc01-choonhoson@MZC01-CHOONHOSON values % k get pod -n spaceone
NAME                                    READY   STATUS      RESTARTS        AGE
board-6785c9fb6d-dt76q                  1/1     Running     0               3h19m
config-5956655ccc-2j4f5                 1/1     Running     0               3h19m
console-7d4595758b-wbnf4                1/1     Running     0               3h19m
console-api-56f4496f7d-59986            2/2     Running     1 (3h18m ago)   3h19m
console-api-v2-rest-644b847b57-m68tb    2/2     Running     0               3h19m
dashboard-759ccd74b7-d2f6l              1/1     Running     0               3h19m
file-manager-85dbb6c46b-r85gp           1/1     Running     0               3h19m
identity-644b45c8df-49jk8               1/1     Running     0               3h19m
inventory-6bd9df778b-v2t9x              1/1     Running     0               3h19m
mongodb-7fd58fcf75-dzrfg                1/1     Running     0               3h26m
monitoring-5c994d99fc-7wrh2             1/1     Running     0               3h19m
plugin-598865d6dc-mnn2x                 1/1     Running     0               3h19m
redis-646677656f-snnmc                  1/1     Running     0               3h19m
repository-79b7475999-zjznn             1/1     Running     0               3h19m
secret-5d7c9b86bf-24h6v                 1/1     Running     0               3h19m
statistics-5fd4bcb4cc-5w766             1/1     Running     0               3h19m
supervisor-scheduler-84b8b4b659-lwww9   2/2     Running     0               3h19m
Enter fullscreen mode Exit fullscreen mode

5) Initialize the Configuration

First, download the initializer.yaml file.

For more information about the initializer, please refer to the spaceone-initializer.

If you are used to downloading files via command-line, run this command to download the file.

wget https://raw.githubusercontent.com/cloudforet-io/charts/master/examples/initializer.yaml -O initializer.yaml
Enter fullscreen mode Exit fullscreen mode

And execute the following command.

helm install initializer cloudforet/spaceone-initializer -n spaceone -f initializer.yaml
Enter fullscreen mode Exit fullscreen mode

6) Set the Helm Values and Upgrade the Chart

Complete the initialization, you can get the system token from the initializer pod logs.

To figure out the pod name for the initializer, run this command first to show all pod names for namespace spaceone.

kubectl get pods -n spaceone 
Enter fullscreen mode Exit fullscreen mode

Then, among the pods shown copy the name of the pod that starts with initialize-spaceone.

mzc01-choonhoson@MZC01-CHOONHOSON values % k get pod -n spaceone
NAME                                    READY   STATUS      RESTARTS        AGE
board-6785c9fb6d-dt76q                  1/1     Running     0               3h19m
config-5956655ccc-2j4f5                 1/1     Running     0               3h19m
console-7d4595758b-wbnf4                1/1     Running     0               3h19m
console-api-56f4496f7d-59986            2/2     Running     1 (3h18m ago)   3h19m
console-api-v2-rest-644b847b57-m68tb    2/2     Running     0               3h19m
dashboard-759ccd74b7-d2f6l              1/1     Running     0               3h19m
file-manager-85dbb6c46b-r85gp           1/1     Running     0               3h19m
identity-644b45c8df-49jk8               1/1     Running     0               3h19m
initialize-spaceone-6suok-lwhsx         0/1     Completed   0               3h22m
inventory-6bd9df778b-v2t9x              1/1     Running     0               3h19m
mongodb-7fd58fcf75-dzrfg                1/1     Running     0               3h26m
monitoring-5c994d99fc-7wrh2             1/1     Running     0               3h19m
plugin-598865d6dc-mnn2x                 1/1     Running     0               3h19m
redis-646677656f-snnmc                  1/1     Running     0               3h19m
repository-79b7475999-zjznn             1/1     Running     0               3h19m
secret-5d7c9b86bf-24h6v                 1/1     Running     0               3h19m
statistics-5fd4bcb4cc-5w766             1/1     Running     0               3h19m
supervisor-scheduler-84b8b4b659-lwww9   2/2     Running     0               3h19m
Enter fullscreen mode Exit fullscreen mode

To execute the below kubectl logs command, the status of POD(Ex: here initialize-spaceone-6suok-lwhsx) should be Completed . Proceeding with this while the POD is INITIALIZING will give errors

Get the token by getting the log information of the pod with the name you found above.

kubectl logs initialize-spaceone-6suok-lwhsx -n spaceone

...
TASK [Create project manager role] *************************************************************************************
TASK [Create project viewer role] **************************************************************************************
TASK [Add daily cloud service summary] *********************************************************************************
TASK [Print Admin API Key] *********************************************************************************************
"eyJhbGciOiJSUzI1NiIsIXXXXXXXiKinQe6CTDi5_oSdcwnRsX2PuUkekJKbtmAVvORNVErvY_-pJC_kB9tAYmsKNy31sr00pdNV9tpojmg42QLfS41M1bAFJcrdyRahgLQx32mqWRFTDurz8HrrXw"

FINISHED [ ok=23, skipped=0 ] ******************************************************************************************

FINISH SPACEONE INITIALIZE
Enter fullscreen mode Exit fullscreen mode

Open minimum.yaml

#############################################
# Minimum deployment for developer
# * Very small CPU, Memory resources (2 cores, 2GB)
# * Disable scheduler, worker
#############################################
console:
  production_json:
    CONSOLE_API:
      ENDPOINT: http://127.0.0.1:8081  # http://ec2_public_ip:8081 for EC2 users
    CONSOLE_API_V2:
      ENDPOINT: http://127.0.0.1:8082  # http://ec2_public_ip:8082 for EC2 users

global:
  shared_conf:
    TOKEN: eyJhbGciOiJSUzI1NiIsInR5cCI6IXXXXXXX__YOUR_TOKEN__S41M1bAFJcrdyRahgLQx32mqWRFTDurz8HrrXw

spacectl:
  enabled: false
marketplace-assets:
  enabled: false
...
Enter fullscreen mode Exit fullscreen mode

After editing the minimum.yaml file, upgrade the helm chart.

helm upgrade cloudforet cloudforet/spaceone -n spaceone -f minimum.yaml
Enter fullscreen mode Exit fullscreen mode

After upgrading, delete the pods related to the namespace named spaceone.
After upgrading, delete the pods in spaceone namespace that have the label app.kubernetes.io/instance and value cloudforet.

kubectl delete po -n spaceone -l app.kubernetes.io/instance=cloudforet
Enter fullscreen mode Exit fullscreen mode

7) Check the status of the pods

kubectl get pod -n spaceone
Enter fullscreen mode Exit fullscreen mode

If all pods are in Running state, the setup is complete.

Port-forwarding

Installing Cloudforet on minikube doesn't provide any Ingress objects such as Amazon ALB or NGINX ingress controller.
We can use kubectl port-forward instead.

Run the following commands for port forwarding.

# CLI commands
kubectl port-forward -n spaceone svc/console 8080:80 --address='0.0.0.0' &
Enter fullscreen mode Exit fullscreen mode
kubectl port-forward -n spaceone svc/console-api 8081:80 --address='0.0.0.0' &
Enter fullscreen mode Exit fullscreen mode
kubectl port-forward -n spaceone svc/console-api-v2-rest 8082:80 --address='0.0.0.0' &
Enter fullscreen mode Exit fullscreen mode

Start Cloudforet

Log-In (Sign in for Root Account)

For EC2 users: open browser with http://your_ec2_server_ip:8080

Open browser (http://127.0.0.1:8080)

ID PASSWORD
admin Admin123!@#

Top comments (0)