Search This Blog

Wednesday 18 December 2019

Spring Boot JPA project riff function demo

riff is an Open Source platform for building and running Functions, Applications, and Containers on Kubernetes. For more information visit the project riff home page https://projectriff.io/

riff supports running containers using Knative serving which in turn provides support for
  •     0-N autoscaling
  •     Revisions
  •     HTTP routing using Istio ingress
Want to try an example? If so head over to the following GitHub project which will show to do this step by step for Spring Data JPA function running using riff on a GKE cluster when required

https://github.com/papicella/SpringDataJPAFunction


More Information

1. Project riff home page
https://projectriff.io/

2. Getting started with riff
https://projectriff.io/docs/v0.5/getting-started

Wednesday 4 December 2019

k8s info: VMware Tanzu Octant - A web-based, highly extensible platform for developers to better understand the complexity of Kubernetes clusters

Octant is a tool for developers to understand how applications run on a Kubernetes cluster. It aims to be part of the developer's toolkit for gaining insight and approaching complexity found in Kubernetes. Octant offers a combination of introspective tooling, cluster navigation, and object management along with a plugin system to further extend its capabilities

So how would I install this?

1. First on my k8s cluster lets create a deployment and a service. You can skip this step if you already have workloads on your cluster. These commands will work on any cluster as the image exists on DockerHub itself so as long as you can get to DockerHub these kubectl commands will work.

$ kubectl run pbs-demo --image=pasapples/pbs-demo-image --replicas=2 --port=8080
$ kubectl expose deploy pbs-demo --type=LoadBalancer --port=80 --target-port=8080
$ http http://101.195.48.144/customers/1

HTTP/1.1 200
Content-Type: application/hal+json;charset=UTF-8
Date: Tue, 03 Dec 2019 16:11:54 GMT
Transfer-Encoding: chunked

{
    "_links": {
        "customer": {
            "href": "http://101.195.48.144/customers/1"
        },
        "self": {
            "href": "http://101.195.48.144/customers/1"
        }
    },
    "name": "pas",
    "status": "active"
}

2. To install Octant you can view instructions on the GitHub page as follows

https://github.com/vmware-tanzu/octant

Given I am on a Mac it's installed using brew as shown below. For other OS refer to link above

$ brew install octant

3. Thats it you can now launch the UI as shown below.

$  octant

2019-12-03T21:47:56.271+0530 INFO module/manager.go:79 registering action {"component": "module-manager", "actionPath": "deployment/configuration", "module-name": "overview"}
2019-12-03T21:47:56.271+0530 INFO module/manager.go:79 registering action {"component": "module-manager", "actionPath": "overview/containerEditor", "module-name": "overview"}
2019-12-03T21:47:56.271+0530 INFO module/manager.go:79 registering action {"component": "module-manager", "actionPath": "overview/serviceEditor", "module-name": "overview"}
2019-12-03T21:47:56.271+0530 INFO module/manager.go:79 registering action {"component": "module-manager", "actionPath": "octant/deleteObject", "module-name": "configuration"}
2019-12-03T21:47:56.272+0530 INFO dash/dash.go:370 Using embedded Octant frontend
2019-12-03T21:47:56.277+0530 INFO dash/dash.go:349 Dashboard is available at http://127.0.0.1:7777

Octant should immediately launch your default web browser on 127.0.0.1:7777

And to view our deployed application!!!!







It's a nice UI and it even has the ability to switch to a different k8s context from the menu bar itself



More Information

1. Seeing is Believing: Octant Reveals the Objects Running in Kubernetes Clusters
https://blogs.vmware.com/cloudnative/2019/08/12/octant-reveals-objects-running-in-kubernetes-clusters/

2. GitHub project page
https://github.com/vmware-tanzu/octant

Tuesday 3 December 2019

k8s info: kubectx and kubens to the rescue

kubectx is a utility to manage and switch between kubectl(1) contexts. To me this is so handy I can't live without it. I am constantly using k8s everywhere from PKS (Pivotal Container Service) clusters, GKE clusters, minikube and wherever I can get my hands on a cluster.

So when I heard about kubectx and no I can't live with this and it makes my life so much easier. His how

Where is my current k8s context and potentially what other contexts could I switch to?


Ok so I am in the k8s cluster with the context of "apples". Let's switch to "lemons" then


It's really as simple as that. In my world every k8s cluster is named after a FRUIT.

Finally if you wish to set the correct context namespace you can use "kubens" to do that just as easily as shown below



More Information

https://github.com/ahmetb/kubectx

https://formulae.brew.sh/formula/kubectx

Joined the ranks of the 100+ CKA/CKAD certified Pivotal Platform Architects

I am now officially CKAD certified in fact I am Cloud Foundry certified as well. Great to be certified with the leaders in container technology both with PaaS and CaaS.





Friday 18 October 2019

Getting started with Pivotal Telemetry Collector

Pivotal Telemetry Collector is an automated tool that collects data from a series of Pivotal Cloud Foundry (PCF) APIs found within a foundation and securely sends that data to Pivotal. The tool collects:

  • Configuration data from the Ops Manager API.
  • Optional certificate data from the CredHub API.
  • Optional app, task and service instance usage data from the Usage Service API.

Pivotal uses this information to do the following:

  • Improve its products and services.
  • Fix problems.
  • Advise customers on how best to deploy and use Pivotal products.
  • Provide better customer support.
Steps to Run

1. Download the scripts required to run "Pivotal Telemetry Collector" using this URL from Pivotal Network

https://network.pivotal.io/products/pivotal-telemetry-collector/

2. Extract to file system. You will notice 3 executables use the right one for your OS, in my case it was the Mac OSX executable "telemetry-collector-darwin-amd64"

-rwxr-xr-x   1 papicella  staff  14877449  5 Oct 00:42 telemetry-collector-linux-amd64*
-rwxr-xr-x   1 papicella  staff  14771312  5 Oct 00:42 telemetry-collector-darwin-amd64*
-rwxr-xr-x   1 papicella  staff  14447104  5 Oct 00:42 telemetry-collector-windows-amd64.exe*

3. Make sure you have network access to your PCF env. You will need to hit the Operations Manager URL as well as the CF CLI API and usage service API endpoints as shown below

Ops Manager endpoint

$ ping opsmgr-02.haas-yyy.pez.pivotal.io
PING opsmgr-02.haas-yyy.pez.pivotal.io (10.195.1.1): 56 data bytes
64 bytes from 10.195.1.1: icmp_seq=0 ttl=58 time=338.412 ms

CF API endpoint

$ ping api.system.run.haas-yyy.pez.pivotal.io
PING api.system.run.haas-yyy.pez.pivotal.io (10.195.1.2): 56 data bytes
64 bytes from 10.195.1.2: icmp_seq=0 ttl=58 time=380.852 ms

Usage Service API endpoint

$ ping app-usage.system.run.haas-yyy.pez.pivotal.io
PING app-usage.system.run.haas-yyy.pez.pivotal.io (10.195.1.3): 56 data bytes
64 bytes from 10.195.1.3: icmp_seq=0 ttl=58 time=495.996 ms

4. Now you can use this via two options. As you would of guessed we are using the CLI given we have downloaded the scripts.

Concourse: https://docs.pivotal.io/telemetry/1-1/using-concourse.html
CLI: https://docs.pivotal.io/telemetry/1-1/using-cli.html

5. So to run out first collect we would run the collector script as follows. More information about what the CLI options are can be found on this link or using help option "./telemetry-collector-darwin-amd64 --help"

https://docs.pivotal.io/telemetry/1-1/using-cli.html

Script Name: run-with-usage.sh

$ ./telemetry-collector-darwin-amd64 collect --url https://opsmgr-02.haas-yyy.pez.pivotal.io/ --username admin --password {PASSWD} --env-type production --output-dir output --usage-service-url https://app-usage.system.run.haas-yyy.pez.pivotal.io/ --usage-service-client-id push_usage_service --usage-service-client-secret {PUSH-USAGE-SERVICE-PASSWORD} --usage-service-insecure-skip-tls-verify --insecure-skip-tls-verify --cf-api-url https://api.system.run.haas-yyy.pez.pivotal.io

Note: You would obtain the PUSH-USAGE-SERVICE-PASSWORD from Ops Manager PAS tile credentials tab as shown in screen shot below


6. All set let's try it out

$ ./run-with-usage.sh
Collecting data from Operations Manager at https://opsmgr-02.haas-yyy.pez.pivotal.io/
Collecting data from Usage Service at https://app-usage.system.run.haas-yyy.pez.pivotal.io/
Wrote output to output/FoundationDetails_1571355194.tar
Success!

7. Let's extract the output TAR as follows

$ cd output/
$ tar -xvf FoundationDetails_1571355194.tar
x opsmanager/ops_manager_deployed_products
x opsmanager/pivotal-container-service_resources
x opsmanager/pivotal-container-service_properties
x opsmanager/pivotal-mysql_resources
x opsmanager/pivotal-mysql_properties
x opsmanager/cf_resources
x opsmanager/cf_properties
x opsmanager/p-compliance-scanner_resources
x opsmanager/p-compliance-scanner_properties
x opsmanager/ops_manager_vm_types
x opsmanager/ops_manager_diagnostic_report
x opsmanager/ops_manager_installations
x opsmanager/ops_manager_certificates
x opsmanager/ops_manager_certificate_authorities
x opsmanager/metadata
x usage_service/app_usage
x usage_service/service_usage
x usage_service/task_usage
x usage_service/metadata

7. Now let's view the output which is a SET of JSON files and to do that I simply use "cat" command and pipe that to JQ as shown below

$ cat ./output/opsmanager/ops_manager_installations | jq -r
{
  "installations": [
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "successful",
          "guid": "p-compliance-scanner-a53448be03a372a13d89",
          "identifier": "p-compliance-scanner",
          "label": "Compliance Scanner for PCF",
          "product_version": "1.0.0"
        }
      ],
      "deletions": [],
      "finished_at": "2019-08-30T09:38:29.679Z",
      "id": 25,
      "started_at": "2019-08-30T09:21:44.810Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [
        {
          "change_type": "deletion",
          "deployment_status": "pending",
          "guid": "p-compliance-scanner-1905a6707e4f434e315a",
          "identifier": "p-compliance-scanner",
          "label": "Compliance Scanner for PCF",
          "product_version": "1.0.0-beta.25"
        }
      ],
      "finished_at": "2019-08-08T02:10:51.130Z",
      "id": 24,
      "started_at": "2019-08-08T02:09:10.290Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-07-18T12:27:54.301Z",
      "id": 23,
      "started_at": "2019-07-18T11:31:19.781Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": [
        {
          "change_type": "update",
          "deployment_status": "successful",
          "guid": "cf-3095a0a264aa5900d79f",
          "identifier": "cf",
          "label": "Small Footprint PAS",
          "product_version": "2.5.3"
        }
      ]
    },
    {
      "additions": [],
      "deletions": [
        {
          "change_type": "deletion",
          "deployment_status": "pending",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "finished_at": "2019-07-07T00:16:31.948Z",
      "id": 22,
      "started_at": "2019-07-07T00:04:32.974Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-07-07T00:02:12.003Z",
      "id": 21,
      "started_at": "2019-07-06T23:57:06.401Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": [
        {
          "change_type": "update",
          "deployment_status": "failed",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ]
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "successful",
          "guid": "p-compliance-scanner-1905a6707e4f434e315a",
          "identifier": "p-compliance-scanner",
          "label": "Compliance Scanner for PCF",
          "product_version": "1.0.0-beta.25"
        }
      ],
      "deletions": [],
      "finished_at": "2019-06-10T09:23:19.595Z",
      "id": 20,
      "started_at": "2019-06-10T09:10:44.431Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "skipped",
          "guid": "aquasec-1b94477ae275ee81be58",
          "identifier": "aquasec",
          "label": "Aqua Security for PCF",
          "product_version": "1.0.0"
        }
      ],
      "deletions": [],
      "finished_at": "2019-06-06T17:38:18.396Z",
      "id": 19,
      "started_at": "2019-06-06T17:35:34.614Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "skipped",
          "guid": "aquasec-1b94477ae275ee81be58",
          "identifier": "aquasec",
          "label": "Aqua Security for PCF",
          "product_version": "1.0.0"
        }
      ],
      "deletions": [],
      "finished_at": "2019-06-06T17:33:18.545Z",
      "id": 18,
      "started_at": "2019-06-06T17:21:41.529Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T11:15:43.546Z",
      "id": 17,
      "started_at": "2019-06-04T10:49:57.969Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T10:44:04.018Z",
      "id": 16,
      "started_at": "2019-06-04T10:17:28.230Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "failed",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T09:52:30.782Z",
      "id": 15,
      "started_at": "2019-06-04T09:48:45.867Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "failed",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T09:21:17.245Z",
      "id": 14,
      "started_at": "2019-06-04T09:17:45.360Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "failed",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T08:50:33.333Z",
      "id": 13,
      "started_at": "2019-06-04T08:47:09.790Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T08:32:44.772Z",
      "id": 12,
      "started_at": "2019-06-04T08:23:27.386Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T08:16:41.757Z",
      "id": 11,
      "started_at": "2019-06-04T08:13:54.645Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "failed",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T01:53:50.594Z",
      "id": 10,
      "started_at": "2019-06-04T01:43:56.205Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": [
        {
          "change_type": "update",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ]
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-04T01:28:22.975Z",
      "id": 9,
      "started_at": "2019-06-04T01:24:52.587Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-06-03T08:37:25.961Z",
      "id": 8,
      "started_at": "2019-06-03T08:13:07.511Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": [
        {
          "change_type": "update",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ]
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "successful",
          "guid": "pas-windows-72031f60ab052fa4d473",
          "identifier": "pas-windows",
          "label": "Pivotal Application Service for Windows",
          "product_version": "2.5.2"
        }
      ],
      "deletions": [],
      "finished_at": "2019-06-03T04:57:06.897Z",
      "id": 7,
      "started_at": "2019-06-03T03:52:13.705Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "successful",
          "guid": "pivotal-mysql-0e5d717f1c87c8095c9d",
          "identifier": "pivotal-mysql",
          "label": "MySQL for Pivotal Cloud Foundry v2",
          "product_version": "2.5.4-build.51"
        }
      ],
      "deletions": [],
      "finished_at": "2019-05-22T05:15:55.703Z",
      "id": 6,
      "started_at": "2019-05-22T04:09:49.841Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "cf-3095a0a264aa5900d79f",
          "identifier": "cf",
          "label": "Small Footprint PAS",
          "product_version": "2.5.3"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-05-22T02:12:22.934Z",
      "id": 5,
      "started_at": "2019-05-22T01:45:28.101Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        },
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "cf-3095a0a264aa5900d79f",
          "identifier": "cf",
          "label": "Small Footprint PAS",
          "product_version": "2.5.3"
        }
      ],
      "updates": []
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "failed",
          "guid": "cf-3095a0a264aa5900d79f",
          "identifier": "cf",
          "label": "Small Footprint PAS",
          "product_version": "2.5.3"
        }
      ],
      "deletions": [],
      "finished_at": "2019-05-22T00:23:29.844Z",
      "id": 4,
      "started_at": "2019-05-21T23:16:42.418Z",
      "status": "failed",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [],
      "deletions": [],
      "finished_at": "2019-05-16T01:50:50.640Z",
      "id": 3,
      "started_at": "2019-05-16T01:45:22.438Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": [
        {
          "change_type": "update",
          "deployment_status": "successful",
          "guid": "pivotal-container-service-5c28f63410227c2221c8",
          "identifier": "pivotal-container-service",
          "label": "Enterprise PKS",
          "product_version": "1.4.0-build.31"
        }
      ]
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "successful",
          "guid": "pivotal-container-service-5c28f63410227c2221c8",
          "identifier": "pivotal-container-service",
          "label": "Enterprise PKS",
          "product_version": "1.4.0-build.31"
        }
      ],
      "deletions": [],
      "finished_at": "2019-05-15T00:08:32.241Z",
      "id": 2,
      "started_at": "2019-05-14T23:33:58.105Z",
      "status": "succeeded",
      "unchanged": [
        {
          "change_type": "unchanged",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "updates": []
    },
    {
      "additions": [
        {
          "change_type": "addition",
          "deployment_status": "successful",
          "guid": "p-bosh-c1853604618b1b3e10fd",
          "identifier": "p-bosh",
          "label": "BOSH Director",
          "product_version": "2.5.3-build.185"
        }
      ],
      "deletions": [],
      "finished_at": "2019-05-14T23:29:47.525Z",
      "id": 1,
      "started_at": "2019-05-14T23:13:13.244Z",
      "status": "succeeded",
      "unchanged": [],
      "updates": []
    }
  ]
}

Optionally you should send this TAR file output on every ticket/case your create so support has a great snapshot of what your ENV looks like to help diagnose support issues for you.

telemetry-collector send --path --api-key

For the API-KEY please contact your Pivotal AE or Platform Architect to request that as the Telemetry team issues API key to customer's


More Information 

https://docs.pivotal.io/telemetry/1-1/index.html

Tuesday 24 September 2019

Basic VMware Harbor Registry usage for Pivotal Container Service (PKS)

VMware Harbor Registry is an enterprise-class registry server that stores and distributes container images. Harbor allows you to store and manage images for use with Enterprise Pivotal Container Service (Enterprise PKS).

In this simple example we show what you need at a minimum to get an image on Harbor deployed onto your PKS cluster. First we need the following to be able to run this basic demo

Required Steps

1. PKS installed with Harbor Registry tile added as shown below


2. VMware Harbor Registry integrated with Enterprise PKS as per the link below. The most important step is the one as follows "Import the CA Certificate Used to Sign the Harbor Certificate and Key to BOSH". You must complete that prior to creating a PKS cluster

https://docs.pivotal.io/partners/vmware-harbor/integrating-pks.html

3. A PKS cluster created. You must have completed step #2 before you create the cluster

https://docs.pivotal.io/pks/1-4/create-cluster.html

$ pks cluster oranges

Name:                     oranges
Plan Name:                small
UUID:                     21998d0d-b9f8-437c-850c-6ee0ed33d781
Last Action:              CREATE
Last Action State:        succeeded
Last Action Description:  Instance provisioning completed
Kubernetes Master Host:   oranges.run.yyyy.bbbb.pivotal.io
Kubernetes Master Port:   8443
Worker Nodes:             4
Kubernetes Master IP(s):  1.1.1.1
Network Profile Name:

4. Docker Desktop Installed on your local machine



Steps

1. First let's log into Harbor and create a new project. Make sure you record your username and password you have assigned for the project. In this example I make the project public.




Details

  • Project Name: cto_apj
  • Username: pas
  • Password: ****

2. Next in order to be able to connect to our registry from our local laptop we will need to install

The VMware Harbor registry isn't running on a public domain, and is using a self-signed certificate. So we need to access this registry with self-signed certificates from my mac osx clients given I am using Docker for Mac. This link shows how to add the self signed certificate to Linux and Mac clients

https://blog.container-solutions.com/adding-self-signed-registry-certs-docker-mac

You can download the self signed cert from Pivotal Ops Manager as sown below


With all that in place a command as follows is all I need to run

$ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ca.crt

3. Now lets login to the registry using a command as follows

$ docker login harbor.haas-bbb.yyyy.pivotal.io -u pas
Password:
Login Succeeded

4. Now I have an image sitting on Docker Hub itself so let's tag that and then deploy that to our VMware Harbor registry as shown below

 $ docker tag pasapples/customer-api:latest harbor.haas-bbb.yyyy.io/cto_apj/customer-api:latest
 $ docker push harbor.haas-bbb.yyyy.io/cto_apj/customer-api:latest


5. Now lets create a new secret for accessing the container registry

$ kubectl create secret docker-registry regcred --docker-server=harbor.haas-bbb.yyyy.io --docker-username=pas --docker-password=**** --docker-email=papicella@pivotal.io

6. Now let's deploy this image to our PKS cluster using a deployment YAML file as follows

customer-api.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: customer-api
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: customer-api
    spec:
      containers:
        - name: customer-api
          image: harbor.haas-206.pez.pivotal.io/cto_apj/customer-api:latest
          ports:
            - containerPort: 8080

---
apiVersion: v1
kind: Service
metadata:
  name: customer-api-service
  labels:
    name: customer-api-service
spec:
  ports:
    - port: 80
      targetPort: 8080
      protocol: TCP
  selector:
    app: customer-api
  type: LoadBalancer

7. Deploy as follows

$ kubectl create -f customer-api.yaml

8. You should see the POD and SERVICE running as follows

$ kubectl get pods | grep customer-api
customer-api-7b8fcd5778-czh46                    1/1     Running   0          58s

$ kubectl get svc | grep customer-api
customer-api-service            LoadBalancer   10.100.2.2    10.195.1.1.80.5   80:31156/TCP 


More Information

PKS Release Notes 1.4
https://docs.pivotal.io/pks/1-4/release-notes.html

VMware Harbor Registry
https://docs.vmware.com/en/VMware-Enterprise-PKS/1.4/vmware-harbor-registry/GUID-index.html