This is the 9th day of my participation in the August More Text Challenge

preface

The helm command line has a lot of parameters, and it would be much easier if you had a UI tool to use it. The popular Monocular of a few years ago is no longer supported, and another new player is coming soon: Kubeapps

kubeapps

Kubeapps characteristics

  • Access and manipulate public and private HELM repositories
  • You can create and manage multiple namespaces
  • Support for RBAC authentication and authorization

For more details, please visit the official website

Kubeapps website kubeapps.com/

Kubeapps github address github.com/kubeapps/ku…

The installation

A prerequisite for

  • Kubernetes version > = 11.15
  • > = 3.1.0 helm version

Step 1

Create the KubeApps namespace and install it directly using helm

kubectl create namespace kubeapps
helm install kubeapps --namespace kubeapps bitnami/kubeapps
Copy the code

As mentioned in the previous section, the helm will only commit the required resources for creation in order, but it does not care whether the startup is successful or not, so you need to use Kubectl to check the deployment progress, as shown in the output below

NAME: kubeapps
NAMESPACE: kubeapps
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **
Tip:
  Watch the deployment status using the command: kubectl get pods -w --namespace kubeapps
Kubeapps can be accessed via port 80 on the following DNS name from within your cluster:
   kubeapps.kubeapps.svc.cluster.local
To access Kubeapps from outside your K8s cluster, follow the steps below:
1. Get the Kubeapps URL by running these commands:
   echo "Kubeapps URL: http://127.0.0.1:8080"
   kubectl port-forward --namespace kubeapps service/kubeapps 8080:80
2. Open a browser and access Kubeapps using the obtained URL.
### WARNING: You did not provide a value for the postgresqlPassword so one has been generated randomly ###
Copy the code

Next we use kubectl get Pods -w –namespace kubeapps to check the progress

Postgresql does not have a password. It is a random value. We will ignore this for now because we are testing it

Step 2

Next, create accounts and cluster permissions. In this case, create administrator permissions, or create normal roles in a production environment

kubectl create --namespace default serviceaccount kubeapps-operator
kubectl create clusterrolebinding kubeapps-operator --clusterrole=cluster-admin --serviceaccount=default:kubeapps-operator
Copy the code

After the account is created, get a command card

kubectl get secret $(kubectl get serviceaccount kubeapps-operator -o jsonpath='{range .secrets[*]}{.name}{"\n"}{end}' | grep kubeapps-operator-token) -o jsonpath='{.data.token}' -o go-template='{{.data.token | base64decode}}' && echo
Copy the code

You can see that the token is actually encrypted in.data.token and decrypted using base64decode

Step 3

Forward ports to access services

kubectl port-forward --namespace kubeapps service/kubeapps 8080:80
Copy the code

Service /kubeapps service/kubeapps service/kubeapps service/kubeapps service/kubeapps

However, if we use the command above, we will not be able to access it, because the default listening is on 127.0.0.1, and there is no way our browser can access the server’s 127.0.0.1. So you need to use global monitoring so that you can access IP:8080

kubectl port-forward --address 0.0. 0. 0 --namespace kubeapps service/kubeapps 8080:80 
Copy the code

Enter the token you obtained earlier

If forwarding PORT is troublesome, you can change service to NodePort and use IP:PORT

Kubectl get SVC -n kubeapps kubectl get SVC -n kubeapps kubectl get SVC -n kubeappsCopy the code

Analysis of the resource

Then see what resources are started by the service and filter out Replicaset because Deployment is based on REP and both are the same

kubectl get all  -n kubeapps | grep -v replicaset
Copy the code

  • Kubeapps is a set of Nginx applications
  • Kubeops is a set of back-end applications
  • Kubedashboard is a set of front-end applications
  • The deployment controller is used on both the back end and front end as well as nginx
  • The PG database, a stateful service, uses the StatefulSet controller
  • Use Batch batch to synchronize APprepO
  • Apprepo is synchronized every 10 minutes using cronjab

use

When you open the screen, you can see two Kubeapps Chart because we are currently deploying only two at helm

Click the chart of center-nginx to enter the function panel, you can update, roll back, delete and other actions, and you can also see the Note message during deployment

In the upper right corner, you can view all namespaces of the cluster

Repo function

Because there is currently only one Bitnami repository, select Application Repositories in the upper right corner to add the repository

Please fill in the address of Name and Helm chart

Operator functions

If you want to enable Operator support, you need to deploy the software again, which is not added by default

Installing support packages

curl -L https:/ / github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.18.2/install.sh -o install. Sh
chmod +x install.sh
./install.sh v018.2.
Copy the code

After installation, open the Operator page and click Apply to see the corresponding function