Search This Blog

Friday 5 June 2020

Installing a UI for Tanzu Application Service for Kubernetes

Having installed Tanzu Application Service for Kubernetes a few times having a UI is something I must have. In this post I show how to get Stratos deployed and running on Tanzu Application Service for Kubernetes (TAS4K8s) beta 0.2.0.

Steps

Note: It's assumed you have TAS4K8s deployed and running as per the output of "kapp" 

$ kapp list
Target cluster 'https://lemons.run.haas-236.pez.pivotal.io:8443' (nodes: a51852ac-e449-40ad-bde7-1beb18340854, 5+)

Apps in namespace 'default'

Name  Namespaces                                    Lcs   Lca
cf    (cluster),build-service,cf-blobstore,cf-db,   true  2h
      cf-system,cf-workloads,cf-workloads-staging,
      istio-system,kpack,metacontroller

Lcs: Last Change Successful
Lca: Last Change Age

1 apps

Succeeded

1. First let's create a namespace to install Stratos into.

$ kubectl create namespace console
namespace/console created

2. Using helm 3 install Stratos as shown below.

$ helm repo add stratos https://cloudfoundry.github.io/stratos
$ helm install my-console --namespace=console stratos/console --set console.service.type=LoadBalancer
NAME: my-console
LAST DEPLOYED: Fri Jun  5 13:18:22 2020
NAMESPACE: console
STATUS: deployed
REVISION: 1
TEST SUITE: None

3. You can verify it installed correctly a few ways as shown below

- Check using "helm ls -A"
$ helm ls -A
NAME       NAMESPACE REVISION UPDATED                               STATUS   CHART         APP VERSION
my-console console   1        2020-06-05 13:18:22.785689 +1000 AEST deployed console-3.2.1 3.2.1
- Check everything in the namespace "console" is up and running
$ kubectl get all -n console
NAME                              READY   STATUS      RESTARTS   AGE
pod/stratos-0                     2/2     Running     0          34m
pod/stratos-config-init-1-mxqbw   0/1     Completed   0          34m
pod/stratos-db-7fc9b7b6b7-sp4lf   1/1     Running     0          34m

NAME                         TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)         AGE
service/my-console-mariadb   ClusterIP      10.100.200.65    <none>          3306/TCP        34m
service/my-console-ui-ext    LoadBalancer   10.100.200.216   10.195.75.164   443:32286/TCP   34m

NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/stratos-db   1/1     1            1           34m

NAME                                    DESIRED   CURRENT   READY   AGE
replicaset.apps/stratos-db-7fc9b7b6b7   1         1         1       34m

NAME                       READY   AGE
statefulset.apps/stratos   1/1     34m

NAME                              COMPLETIONS   DURATION   AGE
job.batch/stratos-config-init-1   1/1           28s        34m
4. To invoke the UI run a script as follows.

Script:

export IP=`kubectl -n console get service my-console-ui-ext -ojsonpath='{.status.loadBalancer.ingress[0].ip}'`

echo ""
echo "Stratos URL: https://$IP:443"
echo ""

Output:

$ ./get-stratos-url.sh

Stratos URL: https://10.195.75.164:443

5. Invoking the URL above will take you to a screen as follows where you would select "Local Admin" account



6. Set a password and click "Finish" button


7. At this point we need to get an API endpoint for our TAS4K8s install. Easiest way to get that is to run a command as follows when logged in using the CF CLI as follows

$ cf api
api endpoint:   https://api.system.run.haas-236.pez.pivotal.io
api version:    2.150.0

8. Click on the "Register an Endpoint" + button as shown below


9. Select "Cloud Foundry" as the type you wish to register.

10. Enter details as shown below and click on "Register" button.


11. At this point you should connect to Cloud Foundry using your admin credentials for the TAS4K8s instance as shown below.


12. Once connected your good to go and start deploying some applications. 




2 comments:

Anonymous said...

Hi Pas, whats the repo for helm chart?

Pas Apicella said...

helm repo add stratos https://cloudfoundry.github.io/stratos