Fusion Middleware

Nice new look and feel to spring.io web site!!!!

Pas Apicella - Sun, 2020-02-16 22:06
Seen the new look and feel for the spring.io? Worth a look

https://spring.io/



Categories: Fusion Middleware

Taking VMware Tanzu Mission Control for a test drive this time creating a k8s cluster on AWS

Pas Apicella - Tue, 2020-02-11 04:12
Previously I blogged about how to use VMware Tanzu Mission Control (TMC) to attach to kubernetes clusters and in that example we used a GCP GKE cluster. That blog entry exists here

Taking VMware Tanzu Mission Control for a test drive
http://theblasfrompas.blogspot.com/2020/02/taking-tanzu-mission-control-for-test.html

In this example we will use the "Create Cluster" button to create a new k8s cluster on AWS that will be managed by TMC for it's entire lifecycle.

Steps

Note: Before getting started you need to create a "Cloud Provider Account" and that is done using AWS as shown below. You can create one or more connected cloud provider accounts. Adding accounts allows you to start using VMware TMC to create clusters, add data protection, and much more



1. Click on the "Clusters" on the left hand navigation bar

2. In the right hand corner click the button "New Cluster" and select your cloud provider account on AWS as shown below


3. Fill in the details of your new cluster as shown below ensuring you select the correct AWS region where your cluster will be created.



4. Click Next

5. In the next screen I am just going to select a Development control plane



6. Click Next

7. Edit the default-node-pool and add 2 worker nodes instead of just 1 as shown below



8. Click "Create"

9. This will take you to a screen where your cluster will create. This can take at least 20 minutes so be patient. Progress is shown as per below



10. If we switch over to AWS console we will start to see some running instances and other cloud components being created as shown in the images below




11. Eventually the cluster will create and you are taken to a summary screen for your cluster. It will take a few minutes for all "Agent and extensions health" to show up green so refresh the page serval times until all shows up green as per below.

Note: This can take up to 10 minutes so be patient




12. So to access this cluster using "kubectl" use the button "Access this Cluster" in the top right hand corner and it will take you to a screen as follows. Click the "Download kubeconfig file" and the "Tanzu Mission Control CLI" as you will need both those files and save them locally



13. make the "tmc" CLI executable and save to your $PATH as shown below

$ chmod +x tmc
$ sudo mv tmc /usr/local/bin

14. Access cluster using "kubectl" as follows
  
$ kubectl --kubeconfig=./kubeconfig-pas-aws-cluster.yml get namespaces
NAME STATUS AGE
default Active 19m
kube-node-lease Active 19m
kube-public Active 19m
kube-system Active 19m
vmware-system-tmc Active 17m

Note: You will be taken to a web page to authenticate and once that's done your good to go as shown below


15. You can view the pods created to allows access from the TMC agent as follows
  
$ kubectl --kubeconfig=./kubeconfig-pas-aws-cluster.yml get pods --namespace=vmware-system-tmc
NAME READY STATUS RESTARTS AGE
agent-updater-7b47c659d-8h2mh 1/1 Running 0 25m
agentupdater-workload-1581415620-csz5p 0/1 Completed 0 35s
data-protection-769994df65-6cgfh 1/1 Running 0 24m
extension-manager-657b467c-k4fkl 1/1 Running 0 25m
extension-updater-c76785dc9-vnmdl 1/1 Running 0 25m
inspection-extension-79dcff47f6-7lm5r 1/1 Running 0 24m
intent-agent-7bdf6c8bd4-kgm46 1/1 Running 0 24m
policy-sync-extension-8648685fc7-shn5g 1/1 Running 0 24m
policy-webhook-78f5699b76-bvz5f 1/1 Running 1 24m
policy-webhook-78f5699b76-td74b 1/1 Running 0 24m
sync-agent-84f5f8bcdc-mrc9p 1/1 Running 0 24m

So if you got this far you now have attached a cluster and created a cluster from scratch all from VMware TMC and that's just the start.

Soon I will show to add some policies to our cluster now we have them under management

More Information

Introducing VMware Tanzu Mission Control to Bring Order to Cluster Chaos
https://blogs.vmware.com/cloudnative/2019/08/26/vmware-tanzu-mission-control/

VMware Tanzu Mission Control
https://cloud.vmware.com/tanzu-mission-control
Categories: Fusion Middleware

Taking VMware Tanzu Mission Control for a test drive

Pas Apicella - Mon, 2020-02-10 19:53
You may or may not have heard of Tanzu Mission Control (TMC) part of the new VMware Tanzu offering which will help you build, run and manage modern apps. To find out more about Tanzu Mission Control here is the Blog link on that.

https://blogs.vmware.com/cloudnative/2019/08/26/vmware-tanzu-mission-control/

In this blog I show you how easily you can use TMC to monitor your existing k8s clusters. Keep in mind TMC can also create k8s clusters for you but here we will use the "Attach Cluster" part of TMC. Demo as follows

1. Of course you will need access account on TMC which for this demo I already have. Once logged in you will see a home screen as follows



2. In the right hand corner there is a "Attach Cluster" button click this to attach an existing cluster to TMC. Enter some cluster details , in this case I am attaching to a k8s cluster on GKE and giving it a name "pas-gke-cluster".


3. Click the "Register" button which takes you to a screen which allows you to install the VMware Tanzu Mission Control agent. This is simply done by using "kubectl apply ..." on your k8s cluster which allows an agent to communicate back to TMC itself. Everything is created in a namespace called "vmware-system-tmc"



4. Once you have run the "kubectl apply .." on your cluster you can verify the status of the pods and other components installed as follows

$ kubectl get all --namespace=vmware-system-tmc

Or you could just check the status of the various pods as shown below and assume everything else was created ok
  
$ kubectl get pods --namespace=vmware-system-tmc
NAME READY STATUS RESTARTS AGE
agent-updater-67bb5bb9c6-khfwh 1/1 Running 0 74m
agentupdater-workload-1581383460-5dsx9 0/1 Completed 0 59s
data-protection-657d8bf96c-v627g 1/1 Running 0 73m
extension-manager-857d46c6c-zfzbj 1/1 Running 0 74m
extension-updater-6ddd9858cf-lr88r 1/1 Running 0 74m
inspection-extension-789bb48b6-mnlqj 1/1 Running 0 73m
intent-agent-cfb49d788-cq8tk 1/1 Running 0 73m
policy-sync-extension-686c757989-jftjc 1/1 Running 0 73m
policy-webhook-5cdc7b87dd-8shlp 1/1 Running 0 73m
policy-webhook-5cdc7b87dd-fzz6s 1/1 Running 0 73m
sync-agent-84bd6c7bf7-rtzcn 1/1 Running 0 73m

5. Now at this point click on "Verify Connection" button to confirm the agent in your k8s cluster is able to communicate with TMC

6. Now let's search for out cluster on the "Clusters" page as shown below



7. Click on "pas-gke-cluster" and you will be taken to an Overview page as shown below. Ensure all green tick boxes are in place this may take a few minutes so refresh the page as needed



8. So this being an empty cluster I will create a deployment with 2 pods so we can see how TMC shows this workload in the UI. These "kubectl commands" should work on any cluster as the image is on Docker Hub

$ kubectl run pbs-deploy --image=pasapples/pbs-demo-image --replicas=2 --port=8080
$ kubectl expose deployment pbs-deploy --type=LoadBalancer --port=80 --target-port=8080 --name=pbs-demo-service

9. Test the workload (Although this isn't really required)

$ echo "http://`kubectl get svc pbs-demo-service -o jsonpath='{.status.loadBalancer.ingress[0].ip}'`/customers/1"
http://104.197.202.165/customers/1

$ http http://104.197.202.165/customers/1
HTTP/1.1 200
Content-Type: application/hal+json;charset=UTF-8
Date: Tue, 11 Feb 2020 01:43:26 GMT
Transfer-Encoding: chunked

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

10. Back on the TMC UI click on workloads. You should see our deployment as per below


11. Click on the deployment "pbs-deploy" to see the status of the pods created as part of the deployment replica set plus the YAML of the deployment itself


12. Of course this is just scratching the surface but from the other tabs you can see the cluster nodes, namespaces and other information as required not just for your workloads but also for the cluster itself




One thing to note here is when I attach a cluster as shown in this demo the life cycle of the cluster, for example upgrades, can't be managed / performed by TMC. In the next post I will show how "Create Cluster" will actually be able to control the life cycle of the cluster as well as this time TMC will actually create the cluster for us.

Stay tuned!!!

More Information

Introducing VMware Tanzu Mission Control to Bring Order to Cluster Chaos
https://blogs.vmware.com/cloudnative/2019/08/26/vmware-tanzu-mission-control/

VMware Tanzu Mission Control
https://cloud.vmware.com/tanzu-mission-control
Categories: Fusion Middleware

kubectl tree - A kubectl plugin to explore ownership relationships between Kubernetes objects through ownersReferences

Pas Apicella - Sun, 2020-01-12 18:51
A kubectl plugin to explore ownership relationships between Kubernetes objects through ownersReferences on them. To get started and install the plugin visit this page.

https://github.com/ahmetb/kubectl-tree

Install Steps

Install as follows

1. Create a script as follows

install-krew.sh

(
  set -x; cd "$(mktemp -d)" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/download/v0.3.3/krew.{tar.gz,yaml}" &&
  tar zxvf krew.tar.gz &&
  KREW=./krew-"$(uname | tr '[:upper:]' '[:lower:]')_amd64" &&
  "$KREW" install --manifest=krew.yaml --archive=krew.tar.gz &&
  "$KREW" update
)

2. Install as follows

papicella@papicella:~/pivotal/software/krew$ ./install-krew.sh
+++ mktemp -d
++ cd /var/folders/mb/93td1r4s7mz3ptq6cmpdvc6m0000gp/T/tmp.kliHlfYB
++ curl -fsSLO 'https://github.com/kubernetes-sigs/krew/releases/download/v0.3.3/krew.{tar.gz,yaml}'
++ tar zxvf krew.tar.gz
x ./krew-darwin_amd64
x ./krew-linux_amd64
x ./krew-linux_arm
x ./krew-windows_amd64.exe
x ./LICENSE
+++ uname
+++ tr '[:upper:]' '[:lower:]'
++ KREW=./krew-darwin_amd64
++ ./krew-darwin_amd64 install --manifest=krew.yaml --archive=krew.tar.gz
Installing plugin: krew
Installed plugin: krew

...

3. On a Mac add the following to your PATH and source your profile file or start a new shell

export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"

4. Check plugin is installed

$ kubectl plugin list
The following compatible plugins are available:

/Users/papicella/.krew/bin/kubectl-krew
/Users/papicella/.krew/bin/kubectl-tree

Can also use this:

$ kubectl tree --help
Show sub-resources of the Kubernetes object

Usage:
  kubectl tree KIND NAME [flags]

Examples:
  kubectl tree deployment my-app
  kubectl tree kservice.v1.serving.knative.dev my-app

6. Ok now it's installed let's see what it shows / displays information about k8s objects and relationships on my cluster which has riff and knative installed

$ kubectl tree deployment --namespace=knative-serving networking-istio
NAMESPACE        NAME                                       READY  REASON  AGE
knative-serving  Deployment/networking-istio                -              8d
knative-serving  └─ReplicaSet/networking-istio-7fcd97cbf7   -              8d
knative-serving    └─Pod/networking-istio-7fcd97cbf7-z4dc9  True           8d

$ kubectl tree deployment --namespace=riff-system riff-build-controller-manager
NAMESPACE    NAME                                                    READY  REASON  AGE
riff-system  Deployment/riff-build-controller-manager                -              8d
riff-system  └─ReplicaSet/riff-build-controller-manager-5d484d5fc4   -              8d
riff-system    └─Pod/riff-build-controller-manager-5d484d5fc4-7rhbr  True           8d


More Information

GitHub Tree Plugin
https://github.com/ahmetb/kubectl-tree

Categories: Fusion Middleware

Spring Boot JPA project riff function demo

Pas Apicella - Tue, 2019-12-17 22:09
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

Categories: Fusion Middleware

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

Pas Apicella - Tue, 2019-12-03 10:33
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

Categories: Fusion Middleware

k8s info: kubectx and kubens to the rescue

Pas Apicella - Tue, 2019-12-03 05:54
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
Categories: Fusion Middleware

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

Pas Apicella - Tue, 2019-12-03 05:22
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.





Categories: Fusion Middleware

Getting started with Pivotal Telemetry Collector

Pas Apicella - Thu, 2019-10-17 18:44
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
Categories: Fusion Middleware

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

Pas Apicella - Tue, 2019-09-24 01:25
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

Categories: Fusion Middleware

Taking kpack, a Kubernetes Native Container Build Service for a test drive

Pas Apicella - Tue, 2019-09-10 23:51
We wanted Build Service to combine the Cloud Native Buildpacks experience with the declarative model of Kubernetes, and extend the K8s workflow in an idiomatic fashion. With this goal in mind, we leveraged custom resource definitions to extended the K8s API. This way, we could use Kubernetes technology to create a composable, declarative architecture to power build service. The Custom Resource Definitions (CRDs) are coordinated by Custom Controllers to automate container image builds and keep them up to date based on user-provided configuration.

So with that in mind lets go and deploy kpack on GKE cluster and build our first image...



Steps

1. Install v0.0.3 of kpack into your Kube cluster

$ kubectl apply -f <(curl -L https://github.com/pivotal/kpack/releases/download/v0.0.3/release.yaml)

...

namespace/kpack created
customresourcedefinition.apiextensions.k8s.io/builds.build.pivotal.io created
customresourcedefinition.apiextensions.k8s.io/builders.build.pivotal.io created
clusterrole.rbac.authorization.k8s.io/kpack-admin created
clusterrolebinding.rbac.authorization.k8s.io/kpack-controller-admin created
deployment.apps/kpack-controller created
customresourcedefinition.apiextensions.k8s.io/images.build.pivotal.io created
serviceaccount/controller created
customresourcedefinition.apiextensions.k8s.io/sourceresolvers.build.pivotal.io created

2. Lets just verify what Custom resources definition (CRD's) have been installed

$ kubectl api-resources --api-group build.pivotal.io
NAME              SHORTNAMES                    APIGROUP           NAMESPACED   KIND
builders          cnbbuilder,cnbbuilders,bldr   build.pivotal.io   true         Builder
builds            cnbbuild,cnbbuilds,bld        build.pivotal.io   true         Build
images            cnbimage,cnbimages            build.pivotal.io   true         Image
sourceresolvers                                 build.pivotal.io   true         SourceResolver

3. Create a builder resource as follows

builder-resource.yaml

apiVersion: build.pivotal.io/v1alpha1
kind: Builder
metadata:
  name: sample-builder
spec:
  image: cloudfoundry/cnb:bionic
  updatePolicy: polling

$ kubectl create -f builder-resource.yaml
builder.build.pivotal.io/sample-builder created

$ kubectl get builds,images,builders,sourceresolvers
NAME                                      AGE
builder.build.pivotal.io/sample-builder   42s

4. Create a secret for push access to the desired docker registry

docker-secret.yaml

apiVersion: v1
kind: Secret
metadata:
  name: basic-docker-user-pass
  annotations:
    build.pivotal.io/docker: index.docker.io
type: kubernetes.io/basic-auth
stringData:
  username: papicella
  password:

$ kubectl create -f docker-secret.yaml
secret/basic-docker-user-pass created

5. Create a secret for pull access from the desired git repository. The example below is for a github repository

git-secret.yaml

apiVersion: v1
kind: Secret
metadata:
  name: basic-git-user-pass
  annotations:
    build.pivotal.io/git: https://github.com
type: kubernetes.io/basic-auth
stringData:
  username: papicella
  password:

$ kubectl create -f git-secret.yaml
secret/basic-git-user-pass created

6. Create a service account that uses the docker registry secret and the git repository secret.

service-account.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: service-account
secrets:
  - name: basic-docker-user-pass
  - name: basic-git-user-pass

$ kubectl create -f service-account.yaml
serviceaccount/service-account created

7. Install logs utility. In order to view the build logs for each image as it's created right now you have to use a utility that you build from the kpack github repo source fils itself. Follow the steps below to get it built

$ export GOPATH=`pwd`
$ git clone https://github.com/pivotal/kpack $GOPATH/src/github.com/pivotal/kpack
$ cd $GOPATH/src/github.com/pivotal/kpack
$ dep ensure -v
$ go build ./cmd/logs

You will have "logs" executable created in current directory which we will use it shortly

8. Create an image as follows. The GitHub repo I have here is public so will work no problem at all

pbs-demo-sample-image.yaml

apiVersion: build.pivotal.io/v1alpha1
kind: Image
metadata:
  name: pbs-demo-image
spec:
  tag: pasapples/pbs-demo-image
  serviceAccount: service-account
  builderRef: sample-builder
  cacheSize: "1.5Gi" # Optional, if not set then the caching feature is disabled
  failedBuildHistoryLimit: 5 # Optional, if not present defaults to 10
  successBuildHistoryLimit: 5 # Optional, if not present defaults to 10
  source:
    git:
      url: https://github.com/papicella/pbs-demo
      revision: master
  build: # Optional
    env:
      - name: BP_JAVA_VERSION
        value: 11.*
    resources:
      limits:
        cpu: 100m
        memory: 1G
      requests:
        cpu: 50m
        memory: 512M

$ kubectl create -f pbs-demo-sample-image.yaml
image.build.pivotal.io/sample-image created

9. Now at this point we can view the created image and current Cloud native Buildpack builds being run using two commands as follows.

$ kubectl get images
NAME             LATESTIMAGE   READY
pbs-demo-image                 Unknown

$ kubectl get cnbbuilds
NAME                           IMAGE   SUCCEEDED
pbs-demo-image-build-1-pvh6k           Unknown

Note: Unknown is normal as it has not yet completed 

10. Now using our created "logs" utility lets view the current build logs

$ ./logs -image pbs-demo-image
{"level":"info","ts":1568175056.446671,"logger":"fallback-logger","caller":"creds-init/main.go:40","msg":"Credentials initialized.","commit":"002a41a"}
source-init:main.go:277: Successfully cloned "https://github.com/papicella/pbs-demo" @ "cee67e26d55b6d2735afd7fa3e0b81e251e0d5ce" in path "/workspace"
2019/09/11 04:11:23 Unable to read "/root/.docker/config.json": open /root/.docker/config.json: no such file or directory
======== Results ========
skip: org.cloudfoundry.archiveexpanding@1.0.0-RC03
pass: org.cloudfoundry.openjdk@1.0.0-RC03
pass: org.cloudfoundry.buildsystem@1.0.0-RC03
pass: org.cloudfoundry.jvmapplication@1.0.0-RC03
pass: org.cloudfoundry.tomcat@1.0.0-RC03
pass: org.cloudfoundry.springboot@1.0.0-RC03
pass: org.cloudfoundry.distzip@1.0.0-RC03
skip: org.cloudfoundry.procfile@1.0.0-RC03
skip: org.cloudfoundry.azureapplicationinsights@1.0.0-RC03
skip: org.cloudfoundry.debug@1.0.0-RC03
skip: org.cloudfoundry.googlestackdriver@1.0.0-RC03
skip: org.cloudfoundry.jdbc@1.0.0-RC03
skip: org.cloudfoundry.jmx@1.0.0-RC03
pass: org.cloudfoundry.springautoreconfiguration@1.0.0-RC03
Resolving plan... (try #1)
Success! (7)
Cache '/cache': metadata not found, nothing to restore
Analyzing image 'index.docker.io/pasapples/pbs-demo-image@sha256:40fe8aa932037faad697c3934667241eef620aac1d09fc7bb5ec5a75d5921e3e'
Writing metadata for uncached layer 'org.cloudfoundry.openjdk:openjdk-jre'

......

11. Now this will take some time to do our first build given it will hagve to download all the maven dependancies but you may be wondering how do we determine how many builds have been run so we can actually view the logs of any builds across our image we just created. To do that run a command as follows

$ kubectl get pods --show-labels | grep pbs-demo-image
pbs-demo-image-build-1-pvh6k-build-pod   0/1     Init:6/9   0          6m29s   image.build.pivotal.io/buildNumber=1,image.build.pivotal.io/image=pbs-demo-image

12. So from the output above you can clearly see we just have the one single build so to view logs of just a particular build we use it's ID as shown above as follows

$ ./logs -image pbs-demo-image -build {ID}

...

13. Now if we wait at least 5 minutes as the first build will always take time just to the dependancies required to be downloaded it will eventually complete and show it's complete using the following commands

$ kubectl get images
NAME             LATESTIMAGE                                                                                                        READY
pbs-demo-image   index.docker.io/pasapples/pbs-demo-image@sha256:a2d4082004d686bb2c76222a631b8a9b3866bef54c1fae03261986a528b556fe   True

$ kubectl get cnbbuilds
NAME                           IMAGE                                                                                                              SUCCEEDED
pbs-demo-image-build-1-pvh6k   index.docker.io/pasapples/pbs-demo-image@sha256:a2d4082004d686bb2c76222a631b8a9b3866bef54c1fae03261986a528b556fe   True

14. Now let's actually make a code change to our source code and issue a git commit. In this example below I am using IntelliJ IDEA for my code change/commit


15. Now let's see if a new build is kicked off it should be. Run the following command

$ kubectl get cnbbuilds
NAME                           IMAGE                                                                                                              SUCCEEDED
pbs-demo-image-build-1-pvh6k   index.docker.io/pasapples/pbs-demo-image@sha256:a2d4082004d686bb2c76222a631b8a9b3866bef54c1fae03261986a528b556fe   True

pbs-demo-image-build-2-stl8w                                                                                                                      Unknown


16. Now lets see that in fact this new build is build ID 2 using a command as follows

$ kubectl get pods --show-labels | grep pbs-demo-image
pbs-demo-image-build-1-pvh6k-build-pod   0/1     Completed   0          21m     image.build.pivotal.io/buildNumber=1,image.build.pivotal.io/image=pbs-demo-image
pbs-demo-image-build-2-stl8w-build-pod   0/1     Init:6/9    0          2m15s   image.build.pivotal.io/buildNumber=2,image.build.pivotal.io/image=pbs-demo-image

17. Lets view the logs for BUILD 2 as follows

$ ./logs -image pbs-demo-image -build 2
{"level":"info","ts":1568176191.088838,"logger":"fallback-logger","caller":"creds-init/main.go:40","msg":"Credentials initialized.","commit":"002a41a"}
source-init:main.go:277: Successfully cloned "https://github.com/papicella/pbs-demo" @ "e2830bbcfb32bfdd72bf5d4b17428c405f46f3c1" in path "/workspace"
2019/09/11 04:29:55 Unable to read "/root/.docker/config.json": open /root/.docker/config.json: no such file or directory
======== Results ========
skip: org.cloudfoundry.archiveexpanding@1.0.0-RC03
pass: org.cloudfoundry.openjdk@1.0.0-RC03
pass: org.cloudfoundry.buildsystem@1.0.0-RC03
pass: org.cloudfoundry.jvmapplication@1.0.0-RC03
pass: org.cloudfoundry.tomcat@1.0.0-RC03
pass: org.cloudfoundry.springboot@1.0.0-RC03
pass: org.cloudfoundry.distzip@1.0.0-RC03
skip: org.cloudfoundry.procfile@1.0.0-RC03
skip: org.cloudfoundry.azureapplicationinsights@1.0.0-RC03
skip: org.cloudfoundry.debug@1.0.0-RC03
skip: org.cloudfoundry.googlestackdriver@1.0.0-RC03
skip: org.cloudfoundry.jdbc@1.0.0-RC03
skip: org.cloudfoundry.jmx@1.0.0-RC03
pass: org.cloudfoundry.springautoreconfiguration@1.0.0-RC03
Resolving plan... (try #1)
Success! (7)
Restoring cached layer 'org.cloudfoundry.openjdk:openjdk-jdk'
Restoring cached layer 'org.cloudfoundry.openjdk:90c33cf3f2ed0bd773f648815de7347e69cfbb3416ef3bf41616ab1c4aa0f5a8'
Restoring cached layer 'org.cloudfoundry.buildsystem:build-system-cache'
Restoring cached layer 'org.cloudfoundry.jvmapplication:executable-jar'
Restoring cached layer 'org.cloudfoundry.springboot:spring-boot'
Analyzing image 'index.docker.io/pasapples/pbs-demo-image@sha256:a2d4082004d686bb2c76222a631b8a9b3866bef54c1fae03261986a528b556fe'
Using cached layer 'org.cloudfoundry.openjdk:90c33cf3f2ed0bd773f648815de7347e69cfbb3416ef3bf41616ab1c4aa0f5a8'
Using cached layer 'org.cloudfoundry.openjdk:openjdk-jdk'
Writing metadata for uncached layer 'org.cloudfoundry.openjdk:openjdk-jre'
Using cached layer 'org.cloudfoundry.buildsystem:build-system-cache'
Using cached launch layer 'org.cloudfoundry.jvmapplication:executable-jar'
Rewriting metadata for layer 'org.cloudfoundry.jvmapplication:executable-jar'
Using cached launch layer 'org.cloudfoundry.springboot:spring-boot'
Rewriting metadata for layer 'org.cloudfoundry.springboot:spring-boot'
Writing metadata for uncached layer 'org.cloudfoundry.springautoreconfiguration:auto-reconfiguration'

Cloud Foundry OpenJDK Buildpack 1.0.0-RC03
  OpenJDK JDK 11.0.4: Reusing cached layer
  OpenJDK JRE 11.0.4: Reusing cached layer

Cloud Foundry Build System Buildpack 1.0.0-RC03
    Using wrapper
    Linking Cache to /home/cnb/.m2
  Compiled Application: Contributing to layer
    Executing /workspace/mvnw -Dmaven.test.skip=true package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------< com.example:pbs-demo >------------------------
[INFO] Building pbs-demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ pbs-demo ---

...

18. Now this build won't take as long as the first build as this time we don't have to pull down the maven dependancies plus avoid creating layers that have not changes in the first OCI complaint image which is something cloud native buildpacks does for us nicely. Once complete you now have two builds as follows

$ kubectl get cnbbuilds
NAME                           IMAGE                                                                                                              SUCCEEDED
pbs-demo-image-build-1-pvh6k   index.docker.io/pasapples/pbs-demo-image@sha256:a2d4082004d686bb2c76222a631b8a9b3866bef54c1fae03261986a528b556fe   True
pbs-demo-image-build-2-stl8w   index.docker.io/pasapples/pbs-demo-image@sha256:a22c64754cb7addc3f7e9a9335b094adf466b5f8035227691e81403d0c9c177f   True

19. Now let's run this locally as follows given I have docker desktop running. First we pull down the created image which in this case is the LATEST build build 2 here



$ docker pull pasapples/pbs-demo-image
Using default tag: latest
latest: Pulling from pasapples/pbs-demo-image
35c102085707: Already exists
251f5509d51d: Already exists
8e829fe70a46: Already exists
6001e1789921: Already exists
76a30c9e6d47: Pull complete
8538f1fe6188: Pull complete
2a899c7e684d: Pull complete
0ea0c38329cb: Pull complete
bb281735f842: Pull complete
664d87aab7ff: Pull complete
f4b03070a779: Pull complete
682af613b7ca: Pull complete
b893e5904080: Pull complete
Digest: sha256:a22c64754cb7addc3f7e9a9335b094adf466b5f8035227691e81403d0c9c177f
Status: Downloaded newer image for pasapples/pbs-demo-image:latest

20. Now let's run it

$ docker run -p 8080:8080 pasapples/pbs-demo-image

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.6.RELEASE)

2019-09-11 04:40:41.747  WARN 1 --- [           main] pertySourceApplicationContextInitializer : Skipping 'cloud' property source addition because not in a cloud
2019-09-11 04:40:41.751  WARN 1 --- [           main] nfigurationApplicationContextInitializer : Skipping reconfiguration because not in a cloud
2019-09-11 04:40:41.760  INFO 1 --- [           main] com.example.pbsdemo.PbsDemoApplication   : Starting PbsDemoApplication on 5975633400c4 with PID 1 (/workspace/BOOT-INF/classes started by cnb in /workspace)

...

2019-09-11 04:40:50.255  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-09-11 04:40:50.259  INFO 1 --- [           main] com.example.pbsdemo.PbsDemoApplication   : Started PbsDemoApplication in 8.93 seconds (JVM running for 9.509)
Hibernate: insert into customer (id, name, status) values (null, ?, ?)
2019-09-11 04:40:50.323  INFO 1 --- [           main] com.example.pbsdemo.LoadDatabase         : Preloading Customer(id=1, name=pas, status=active)
Hibernate: insert into customer (id, name, status) values (null, ?, ?)
2019-09-11 04:40:50.326  INFO 1 --- [           main] com.example.pbsdemo.LoadDatabase         : Preloading Customer(id=2, name=lucia, status=active)
Hibernate: insert into customer (id, name, status) values (null, ?, ?)
2019-09-11 04:40:50.329  INFO 1 --- [           main] com.example.pbsdemo.LoadDatabase         : Preloading Customer(id=3, name=lucas, status=inactive)
Hibernate: insert into customer (id, name, status) values (null, ?, ?)
2019-09-11 04:40:50.331  INFO 1 --- [           main] com.example.pbsdemo.LoadDatabase         : Preloading Customer(id=4, name=siena, status=inactive)

21. Invoke it through a browser as follows

http://localhost:8080/swagger-ui.html


22. Finally let's actually run this application on our k8s cluster itself. So start by creating a basic YAML file for deployment as follows

run-pbs-image-k8s-yaml.yaml

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: pbs-demo-image
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: pbs-demo-image
    spec:
      containers:
        - name: pbs-demo-image
          image: pasapples/pbs-demo-image
          ports:
            - containerPort: 8080

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

23. Apply your config

$ kubectl create -f run-pbs-image-k8s-yaml.yaml
deployment.extensions/pbs-demo-image created
service/pbs-demo-image-service created

24. Check we have running pods and LB service created

$ kubectl get all
NAME                                         READY   STATUS      RESTARTS   AGE
pod/pbs-demo-image-build-1-pvh6k-build-pod   0/1     Completed   0          39m
pod/pbs-demo-image-build-2-stl8w-build-pod   0/1     Completed   0          19m
pod/pbs-demo-image-f5c9d989-l2hg5            1/1     Running     0          48s
pod/pbs-demo-image-f5c9d989-pfxzs            1/1     Running     0          48s

NAME                             TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
service/kubernetes               ClusterIP      10.101.0.1              443/TCP        86m
service/pbs-demo-image-service   LoadBalancer   10.101.15.197        80:30769/TCP   49s

NAME                             READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/pbs-demo-image   2/2     2            2           49s

NAME                                      DESIRED   CURRENT   READY   AGE
replicaset.apps/pbs-demo-image-f5c9d989   2         2         2       50s


More Information

Introducing kpack, a Kubernetes Native Container Build Service
https://content.pivotal.io/blog/introducing-kpack-a-kubernetes-native-container-build-service

Cloud Native Buildpacks
https://buildpacks.io/
Categories: Fusion Middleware

Taking Pivotal Build Service (PBS) for a test drive

Pas Apicella - Fri, 2019-08-02 05:13
Pivotal Build Service ALPHA was just released and in this blog post let's take it for a test drive to work out how it works. The Pivotal blog post about this release is below. In short it Assembles and Updates Containers in Kubernetes

https://content.pivotal.io/blog/pivotal-build-service-now-alpha-assembles-and-updates-containers-in-kubernetes

Steps:

1. Once you have deployed Pivotal Build Service, the pb CLI can be used to target it with the following command.

Note: Use the --skip-ssl-validation flag if the Pivotal Build Service targets a UAA that has a self-signed CA cert

$ pb api set https://pbs.picorivera.cf-app.com --skip-ssl-validation
Successfully set 'https://pbs.picorivera.cf-app.com' as the Build Service

2. Login using "pb login" as shown below

$ pb login
Target Build Server at: https://pbs.picorivera.cf-app.com

Username: papicella@gmail.com
Password: ******
Login successful

Using the Pivotal Build Service (PBS) requires us to create a TEAM and IMAGE. Both are explained below.

TEAM: A team is an entity on Pivotal Build Service that is used to manage authentication for the images built by Pivotal Build Service and to manage registry and git credentials for the images managed by the team

3. Create a TEAM yaml as per below and then apply that config using the pb cli

example-team.yaml

name: example-team-name
registries:
- registry: index.docker.io
  username: pasapples
  password: *****
repositories:
- domain: github.com
  username: papicella
  password: *****

$ pb team apply -f example-team.yaml
Successfully applied team 'example-team-name'

IMAGE: An image defines the specification that Pivotal Build Service uses to create images for a user.

4. Create a IMAGE yaml as per below and then apply that config using the pb cli. The PBS will automatically kick off a build.

example-image.yaml

team: example-team-name
source:
  git:
    url: https://github.com/papicella/pbs-demo
    revision: master
image:
  tag: pasapples/pbs-demo-image

$ pb image apply -f example-image.yaml
Successfully applied image configuration 'pasapples/pbs-demo-image'

$ pb image builds pasapples/pbs-demo-image
Build    Status      Image    Started Time           Finished Time    Reason
-----    ------      -----    ------------           -------------    ------
    1    BUILDING    --       2019-08-02 09:43:06    --               CONFIG

5. You can view the logs of the build using it's ID as shown below driving off the Build ID

$ pb image logs pasapples/pbs-demo-image -b 1

papicella@papicella:~$ pb image logs pasapples/pbs-demo-image -b 1
[build-step-credential-initializer] {"level":"info","ts":1564739008.561973,"logger":"fallback-logger","caller":"creds-init/main.go:40","msg":"Credentials initialized.","commit":"002a41a"}
[build-step-credential-initializer]
[build-step-git-source-0] git-init:main.go:81: Successfully cloned "https://github.com/papicella/pbs-demo" @ "c1aae50feaffcd61c521796cd675e6576e58bc64" in path "/workspace"
[build-step-git-source-0]
[build-step-prepare]
[build-step-detect] Trying group 1 out of 3 with 27 buildpacks...
[build-step-detect] ======== Results ========
[build-step-detect] skip: Cloud Foundry Archive Expanding Buildpack
[build-step-detect] pass: Pivotal OpenJDK Buildpack
[build-step-detect] pass: Pivotal Build System Buildpack
[build-step-detect] pass: Cloud Foundry JVM Application Buildpack
[build-step-detect] pass: Cloud Foundry Spring Boot Buildpack
[build-step-detect] pass: Cloud Foundry Apache Tomcat Buildpack
[build-step-detect] pass: Cloud Foundry DistZip Buildpack
[build-step-detect] skip: Cloud Foundry Procfile Buildpack
[build-step-detect] skip: Pivotal AppDynamics Buildpack
[build-step-detect] skip: Pivotal AspectJ Buildpack
[build-step-detect] skip: Pivotal CA Introscope Buildpack
[build-step-detect] pass: Pivotal Client Certificate Mapper Buildpack

....


6. So after a few minutes or so we will see we have built our initial image from the GitHub repo and that OCI compliant image built using Cloud Native Buildpacks is created on our DockerHub account

$ pb image builds pasapples/pbs-demo-image
Build    Status     Image       Started Time           Finished Time          Reason
-----    ------     -----       ------------           -------------          ------
    1    SUCCESS    98239112    2019-08-02 09:43:06    2019-08-02 09:44:34    CONFIG



One of the PBS job is to keep this image updated as new successful commits occur off the matser branch. Lets show how this works as per below

7. Let's make a change to the code for or GitHub repo here I do this in IntelliJ IDEA



8. Commit the changes as shown below



9. Let's see if indeed the PBS actually started a new build for us and we should see it is doing that.

$ pb image builds pasapples/pbs-demo-image
Build    Status      Image       Started Time           Finished Time          Reason
-----    ------      -----       ------------           -------------          ------
    1    SUCCESS     98239112    2019-08-02 09:43:06    2019-08-02 09:44:34    CONFIG
    2    BUILDING    --          2019-08-02 09:57:11    --                     COMMIT

10. We can tail the logs as shown below and actually tail the build logs live using "-f"

papicella@papicella:~$ pb image logs pasapples/pbs-demo-image -b 2 -f
[build-step-credential-initializer] {"level":"info","ts":1564739850.5331886,"logger":"fallback-logger","caller":"creds-init/main.go:40","msg":"Credentials initialized.","commit":"002a41a"}
[build-step-credential-initializer]
[build-step-git-source-0] git-init:main.go:81: Successfully cloned "https://github.com/papicella/pbs-demo" @ "0bb81c7523be7ada3ed956569d0241cda6b410d2" in path "/workspace"
[build-step-git-source-0]
[build-step-prepare]
[build-step-detect] Trying group 1 out of 3 with 27 buildpacks...
[build-step-detect] ======== Results ========
[build-step-detect] skip: Cloud Foundry Archive Expanding Buildpack
[build-step-detect] pass: Pivotal OpenJDK Buildpack
[build-step-detect] pass: Pivotal Build System Buildpack
[build-step-detect] pass: Cloud Foundry JVM Application Buildpack
[build-step-detect] pass: Cloud Foundry Spring Boot Buildpack
[build-step-detect] pass: Cloud Foundry Apache Tomcat Buildpack
[build-step-detect] pass: Cloud Foundry DistZip Buildpack
[build-step-detect] skip: Cloud Foundry Procfile Buildpack
[build-step-detect] skip: Pivotal AppDynamics Buildpack
[build-step-detect] skip: Pivotal AspectJ Buildpack
[build-step-detect] skip: Pivotal CA Introscope Buildpack
[build-step-detect] pass: Pivotal Client Certificate Mapper Buildpack
[build-step-detect] skip: Pivotal Elastic APM Buildpack
[build-step-detect] skip: Pivotal JaCoCo Buildpack
[build-step-detect] skip: Pivotal JProfiler Buildpack
[build-step-detect] skip: Pivotal JRebel Buildpack
[build-step-detect] skip: Pivotal New Relic Buildpack
[build-step-detect] skip: Pivotal OverOps Buildpack
[build-step-detect] skip: Pivotal Riverbed AppInternals Buildpack
[build-step-detect] skip: Pivotal SkyWalking Buildpack
[build-step-detect] skip: Pivotal YourKit Buildpack
[build-step-detect] skip: Cloud Foundry Azure Application Insights Buildpack
[build-step-detect] skip: Cloud Foundry Debug Buildpack
[build-step-detect] skip: Cloud Foundry Google Stackdriver Buildpack
[build-step-detect] skip: Cloud Foundry JDBC Buildpack
[build-step-detect] skip: Cloud Foundry JMX Buildpack
[build-step-detect] pass: Cloud Foundry Spring Auto-reconfiguration Buildpack
[build-step-detect]
[build-step-restore] Restoring cached layer 'io.pivotal.openjdk:openjdk-jdk'
[build-step-restore] Restoring cached layer 'io.pivotal.buildsystem:build-system-application'
[build-step-restore] Restoring cached layer 'io.pivotal.buildsystem:build-system-cache'
[build-step-restore] Restoring cached layer 'org.cloudfoundry.jvmapplication:executable-jar'
[build-step-restore] Restoring cached layer 'org.cloudfoundry.springboot:spring-boot'
[build-step-restore]
[build-step-analyze] Analyzing image 'index.docker.io/pasapples/pbs-demo-image@sha256:982391123b47cdbac534aaeed78c5e121d89d2064b53897c23f2248a7658fa50'
[build-step-analyze] Using cached layer 'io.pivotal.openjdk:openjdk-jdk'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:java-security-properties'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:jvmkill'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:link-local-dns'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:memory-calculator'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:openjdk-jre'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:security-provider-configurer'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.openjdk:class-counter'
[build-step-analyze] Using cached layer 'io.pivotal.buildsystem:build-system-application'
[build-step-analyze] Using cached layer 'io.pivotal.buildsystem:build-system-cache'
[build-step-analyze] Using cached launch layer 'org.cloudfoundry.jvmapplication:executable-jar'
[build-step-analyze] Rewriting metadata for layer 'org.cloudfoundry.jvmapplication:executable-jar'
[build-step-analyze] Using cached launch layer 'org.cloudfoundry.springboot:spring-boot'
[build-step-analyze] Rewriting metadata for layer 'org.cloudfoundry.springboot:spring-boot'
[build-step-analyze] Writing metadata for uncached layer 'io.pivotal.clientcertificatemapper:client-certificate-mapper'
[build-step-analyze] Writing metadata for uncached layer 'org.cloudfoundry.springautoreconfiguration:auto-reconfiguration'
[build-step-analyze]
[build-step-build]
[build-step-build] Pivotal OpenJDK Buildpack 1.0.0-M9
[build-step-build]   OpenJDK JDK 11.0.3: Reusing cached layer
[build-step-build]   OpenJDK JRE 11.0.3: Reusing cached layer
[build-step-build]   Java Security Properties 1.0.0-M9: Reusing cached layer
[build-step-build]   Security Provider Configurer 1.0.0-M9: Reusing cached layer
[build-step-build]   Link-Local DNS 1.0.0-M9: Reusing cached layer
[build-step-build]   JVMKill Agent 1.16.0: Reusing cached layer
[build-step-build]   Class Counter 1.0.0-M9: Reusing cached layer
[build-step-build]   Memory Calculator 4.0.0: Reusing cached layer
[build-step-build]
[build-step-build] Pivotal Build System Buildpack 1.0.0-M9
[build-step-build]     Using wrapper
[build-step-build]     Linking Cache to /home/vcap/.m2
[build-step-build]   Compiled Application (141 files): Contributing to layer
[build-step-build] [INFO] Scanning for projects...
[build-step-build] [INFO]
[build-step-build] [INFO] ------------------------< com.example:pbs-demo >------------------------
[build-step-build] [INFO] Building pbs-demo 0.0.1-SNAPSHOT
[build-step-build] [INFO] --------------------------------[ jar ]---------------------------------
[build-step-build] [INFO]
[build-step-build] [INFO] --- maven-resources-plugin:3.1.0:resources (default-resources) @ pbs-demo ---
[build-step-build] [INFO] Using 'UTF-8' encoding to copy filtered resources.
[build-step-build] [INFO] Copying 1 resource
[build-step-build] [INFO] Copying 0 resource
[build-step-build] [INFO]
[build-step-build] [INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ pbs-demo ---
[build-step-build] [INFO] Changes detected - recompiling the module!
[build-step-build] [INFO] Compiling 9 source files to /workspace/target/classes
[build-step-build] [INFO]
[build-step-build] [INFO] --- maven-resources-plugin:3.1.0:testResources (default-testResources) @ pbs-demo ---
[build-step-build] [INFO] Not copying test resources
[build-step-build] [INFO]
[build-step-build] [INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ pbs-demo ---
[build-step-build] [INFO] Not compiling test sources
[build-step-build] [INFO]
[build-step-build] [INFO] --- maven-surefire-plugin:2.22.2:test (default-test) @ pbs-demo ---
[build-step-build] [INFO] Tests are skipped.
[build-step-build] [INFO]
[build-step-build] [INFO] --- maven-jar-plugin:3.1.2:jar (default-jar) @ pbs-demo ---
[build-step-build] [INFO] Building jar: /workspace/target/pbs-demo-0.0.1-SNAPSHOT.jar
[build-step-build] [INFO]
[build-step-build] [INFO] --- spring-boot-maven-plugin:2.1.6.RELEASE:repackage (repackage) @ pbs-demo ---
[build-step-build] [INFO] Replacing main artifact with repackaged archive
[build-step-build] [INFO] ------------------------------------------------------------------------
[build-step-build] [INFO] BUILD SUCCESS
[build-step-build] [INFO] ------------------------------------------------------------------------
[build-step-build] [INFO] Total time:  7.214 s
[build-step-build] [INFO] Finished at: 2019-08-02T09:57:52Z
[build-step-build] [INFO] ------------------------------------------------------------------------
[build-step-build]   Removing source code
[build-step-build]
[build-step-build] Cloud Foundry JVM Application Buildpack 1.0.0-M9
[build-step-build]   Executable JAR: Reusing cached layer
[build-step-build]   Process types:
[build-step-build]     executable-jar: java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[build-step-build]     task:           java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[build-step-build]     web:            java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[build-step-build]
[build-step-build] Cloud Foundry Spring Boot Buildpack 1.0.0-M9
[build-step-build]   Spring Boot 2.1.6.RELEASE: Reusing cached layer
[build-step-build]   Process types:
[build-step-build]     spring-boot: java -cp $CLASSPATH $JAVA_OPTS com.example.pbsdemo.PbsDemoApplication
[build-step-build]     task:        java -cp $CLASSPATH $JAVA_OPTS com.example.pbsdemo.PbsDemoApplication
[build-step-build]     web:         java -cp $CLASSPATH $JAVA_OPTS com.example.pbsdemo.PbsDemoApplication
[build-step-build]
[build-step-build] Pivotal Client Certificate Mapper Buildpack 1.0.0-M9
[build-step-build]   Cloud Foundry Client Certificate Mapper 1.8.0: Reusing cached layer
[build-step-build]
[build-step-build] Cloud Foundry Spring Auto-reconfiguration Buildpack 1.0.0-M9
[build-step-build]   Spring Auto-reconfiguration 2.7.0: Reusing cached layer
[build-step-build] 

...


11. This time the build will be faster given we are using Cloud Native Buildpacks a CNCF project and it will only rebuild the layers required versus the whole image itself. You can see from the time taken of build "2"

$ pb image builds pasapples/pbs-demo-image
Build    Status     Image       Started Time           Finished Time          Reason
-----    ------     -----       ------------           -------------          ------
    1    SUCCESS    98239112    2019-08-02 09:43:06    2019-08-02 09:44:34    CONFIG
    2    SUCCESS    1e4b63b1    2019-08-02 09:57:11    2019-08-02 09:58:15    COMMIT

Hopefully this demo shows what the PBS is all about and how it will simplify how you create and keep updated your OCI compliant images.

More Information:

1. Get started with Pivotal Build Service.
https://github.com/pivotal-cf/docs-build-service/blob/master/using.md

2. Request alpha access to Build Service via this form, or by reaching out to your account team. Once you’ve gained access, you’ll see the bits on up PivNet

3. Cloud Native buildpacks
https://buildpacks.io/


Categories: Fusion Middleware

Deploy Artifacts from JFrog Artifactory to PCF directly from IntelliJ IDEA using Spinnaker

Pas Apicella - Thu, 2019-06-27 19:18
Spinnaker is an open-source, multi-cloud continuous delivery platform that helps you release software changes with high velocity and confidence. In the demo below we will show how to deploy an Spring boot application deployed to JFrog Artifactory which Spinnaker watches for changes through a trigger and then deploys to PCF

This demo assumes you have the following:
  • A JFrog Artifactory repository configured to accept a Maven artifact—the JAR for your application (Spring Boot JAR in this example)
  • Spinnaker 1.14.7 or later installed on a k8s cluster
StepsSetup JFrog Artifactory As a Maven repository, Artifactory is both a source for artifacts needed for a build, and a target to deploy artifacts generated in the build process. For more details on how to set that up refer to this short video if required

https://jfrog.com/screencast/setting-maven-repository-jfrog-artifactory-less-one-minute/

In this screen shot below it's shows we are ready to use JFrog Artifactory as our maven repository





Configure Spinnaker1. Connect to Halyard pod as shown below

$ kubectl exec --namespace default -it myspinnaker-spinnaker-halyard-0 bash

2. Enable the Artifactory repository

$ hal config repository artifactory enable

3. Add a search for your repository

$ hal config repository artifactory search add spring-artifactory --base-url http://10.195.75.147/artifactory --repo libs-release-local --groupId com.example --username admin --password

4. Enable the Maven artifact provider

$ hal config artifact maven enable

5. Add an artifact account for Maven

$ hal config artifact maven account add spring-artifactory-maven --repository-url http://10.195.75.147/artifactory/libs-release-local

6. Apply your changes

$ hal deploy apply
Configure Spring Boot Application1. To deploy build artifacts through Artifactory you need to add a deployment element with the URL of a target local repository to which you want to deploy your artifacts. You can find this in the "Set Me Up " wizard for your maven repository in JFrog Artifactory



2. Copy the pom.xml entry and place into your local maven project POM file as shown below
  
<distributionManagement>
<repository>
<id>central</id>
<name>artifactory-artifactory-0-releases</name>
<url>http://10.195.75.147:80/artifactory/libs-release-local</url>
</repository>
</distributionManagement>

Basic Spring Boot project as follows for this:



Configure Spinnaker Pipeline1. Create a new pipeline for your application. In the pipeline configuration, add an Artifactory trigger to the Automated Triggers, as shown below. We are referencing what we created above in Spinnaker




2. In the Artifact Constraints dropdown for the Artifactory trigger, select “Define a new artifact…” and populate the Expected Artifact form with the details of the artifact that will be published to the Artifactory repository


3. Add a “Deploy” stage to the pipeline which will simply just deploy our application to PCF.





Now we are ready to Publish the application artifact to the Artifactory repository

Kick if offTo verify our setup we just need to do a "mvn deploy" from the local spring boot maven project as shown below

1. Deploy the artifact JAR using "mvn deploy" as shown below from your local maven project which will publish the artifact to your JFrog Artifactory maven repo.

$ mvn deploy

Output from command above

[INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ spinnaker-artifactory-demo ---
Uploading to central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/0.0.1-RELEASE/spinnaker-artifactory-demo-0.0.1-RELEASE.jar
Uploaded to central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/0.0.1-RELEASE/spinnaker-artifactory-demo-0.0.1-RELEASE.jar (17 MB at 83 kB/s)
Uploading to central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/0.0.1-RELEASE/spinnaker-artifactory-demo-0.0.1-RELEASE.pom
Uploaded to central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/0.0.1-RELEASE/spinnaker-artifactory-demo-0.0.1-RELEASE.pom (1.8 kB at 886 B/s)
Downloading from central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/maven-metadata.xml
Downloaded from central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/maven-metadata.xml (424 B at 671 B/s)
Uploading to central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/maven-metadata.xml
Uploaded to central: http://10.195.75.147:80/artifactory/libs-release-local/com/example/spinnaker-artifactory-demo/maven-metadata.xml (368 B at 218 B/s)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  03:33 min
[INFO] Finished at: 2019-06-28T09:59:00+10:00
[INFO] ------------------------------------------------------------------------



2. Verify from spinnaker that your artifactory trigger has fired


3. From PCF applications manager we will see our deployed application using the server group settings we used and the artifactory published JAR we used



4. Once pipeline is complete you can view information of what was created and the various stages as shown below



More InformationDeploy Artifacts from Artifactory to CF
https://www.spinnaker.io/guides/tutorials/codelabs/artifactory-to-cf/

Categories: Fusion Middleware

Using Cloud Native Buildpacks (CNB) on a local registry to speed up the building of images for test purposes

Pas Apicella - Tue, 2019-06-11 20:58
I previously blogged about the CNCF project known as Cloud Native Buildpacks previously on this blog entry below.

Building PivotalMySQLWeb using Cloud Native Buildpacks (CNB)
http://theblasfrompas.blogspot.com/2019/06/building-pivotalmysqlweb-using-cloud.html

In the steps below I will show how to use a local docker registry on your laptop or desktop to enable faster builds of your OCI compliant images using CNB's. Here is how using the same application.

Pre Steps:

1. Ensure you have Docker CE installed if not use this link

  https://hub.docker.com/search/?type=edition&offering=community

Steps:

1. Start by running a local registry on your own laptop. The guide shows how to get a container running which will be our local registry and then how you verify it's running.

https://docs.docker.com/registry/

$ docker run -d -p 5000:5000 --restart=always --name registry registry:2

Verify it's running:

$ netstat -an | grep 5000
tcp6       0      0  ::1.5000               *.*                    LISTEN
tcp4       0      0  *.5000                 *.*                    LISTEN

2. Then pull the CNB images versions of the "official" build and run images from the GCR as follows. Those images exist here

https://console.cloud.google.com/gcr/images/cncf-buildpacks-ci/GLOBAL/packs/run?gcrImageListsize=30

Here I am using the latest build/run images which at the time of this post was "run:0.2.0-build.12"

papicella@papicella:~$ docker pull gcr.io:443/cncf-buildpacks-ci/packs/run:0.2.0-build.12
0.2.0-build.12: Pulling from cncf-buildpacks-ci/packs/run
Digest: sha256:ebd42c0228f776804f2e99733076216592c5a1117f1b3dde7688cf3bd0bbe7b9
Status: Downloaded newer image for gcr.io:443/cncf-buildpacks-ci/packs/run:0.2.0-build.12

papicella@papicella:~$ docker tag gcr.io:443/cncf-buildpacks-ci/packs/run:0.2.0-build.12 localhost:5000/run:0.2.0-build.12

papicella@papicella:~$ docker rmi gcr.io:443/cncf-buildpacks-ci/packs/run:0.2.0-build.12
Untagged: gcr.io:443/cncf-buildpacks-ci/packs/run:0.2.0-build.12
Untagged: gcr.io:443/cncf-buildpacks-ci/packs/run@sha256:ebd42c0228f776804f2e99733076216592c5a1117f1b3dde7688cf3bd0bbe7b9

papicella@papicella:~$ docker push localhost:5000/run:0.2.0-build.12
The push refers to repository [localhost:5000/run]
1315c94f2536: Layer already exists
63696cbb6c17: Layer already exists
30ede08f8231: Layer already exists
b57c79f4a9f3: Layer already exists
d60e01b37e74: Layer already exists
e45cfbc98a50: Layer already exists
762d8e1a6054: Layer already exists
0.2.0-build.12: digest: sha256:ebd42c0228f776804f2e99733076216592c5a1117f1b3dde7688cf3bd0bbe7b9 size: 1780

3. Now lets use our local registry and build/run images which will be much faster for local development

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ docker tag localhost:5000/run:0.2.0-build.12 localhost:5000/run

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ docker push localhost:5000/run:latest
The push refers to repository [localhost:5000/run]
1315c94f2536: Layer already exists
63696cbb6c17: Layer already exists
30ede08f8231: Layer already exists
b57c79f4a9f3: Layer already exists
d60e01b37e74: Layer already exists
e45cfbc98a50: Layer already exists
762d8e1a6054: Layer already exists
latest: digest: sha256:ebd42c0228f776804f2e99733076216592c5a1117f1b3dde7688cf3bd0bbe7b9 size: 1780

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ pack build localhost:5000/pivotal-mysql-web --path ./PivotalMySQLWeb --no-pull --publish
Using default builder image cloudfoundry/cnb:cflinuxfs3
Selected run image cloudfoundry/cnb-run:cflinuxfs3 from builder
Using build cache volume pack-cache-65bb470893c1.build
Executing lifecycle version 0.2.1
===> DETECTING
[detector] Trying group 1 out of 4 with 8 buildpacks...
[detector] ======== Results ========
[detector] pass: Cloud Foundry OpenJDK Buildpack
[detector] skip: Cloud Foundry Build System Buildpack
[detector] pass: Cloud Foundry JVM Application Buildpack
[detector] skip: Cloud Foundry Azure Application Insights Buildpack
[detector] skip: Cloud Foundry Debug Buildpack
[detector] skip: Cloud Foundry Google Stackdriver Buildpack
[detector] skip: Cloud Foundry JMX Buildpack
[detector] skip: Cloud Foundry Procfile Buildpack
===> RESTORING
[restorer] restoring cached layer 'org.cloudfoundry.openjdk:d2df8bc799b09c8375f79bf646747afac3d933bb1f65de71d6c78e7466ff8fe4'
===> ANALYZING
[analyzer] using cached layer 'org.cloudfoundry.openjdk:d2df8bc799b09c8375f79bf646747afac3d933bb1f65de71d6c78e7466ff8fe4'
[analyzer] writing metadata for uncached layer 'org.cloudfoundry.openjdk:openjdk-jre'
[analyzer] writing metadata for uncached layer 'org.cloudfoundry.jvmapplication:main-class'
===> BUILDING
[builder] -----> Cloud Foundry OpenJDK Buildpack 1.0.0-M8
[builder] -----> OpenJDK JRE 11.0.3: Reusing cached layer
[builder]
[builder] -----> Cloud Foundry JVM Application Buildpack 1.0.0-M8
[builder] -----> Main-Class Classpath: Reusing cached layer
[builder] -----> Process types:
[builder]        task: java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[builder]        web:  java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[builder]
===> EXPORTING
[exporter] Reusing layer 'app' with SHA sha256:b32618ed6b86fb496a4ce33db9df49fdd4ef16c5646b174b5643c8befcb7408a
[exporter] Reusing layer 'config' with SHA sha256:9538e967fa10f23b3415c382a3754ebf4c2645c20b6d76af519236c1181e7639
[exporter] Reusing layer 'launcher' with SHA sha256:04ca7957074763290a9abe6a067ce8c902a2ab51ed6c55102964e3f3294cdebd
[exporter] Reusing layer 'org.cloudfoundry.openjdk:openjdk-jre' with SHA sha256:e540f1464509ac673a25bd2f24c7dd6875f805c0dd35e9af84dd4669e2fd0c93
[exporter] Reusing layer 'org.cloudfoundry.jvmapplication:main-class' with SHA sha256:8537197b3f57d86a59397b89b4fbdd14900a602cc12961eae338b9ef2513cdc0
[exporter]
[exporter] *** Image: localhost:5000/pivotal-mysql-web:latest@sha256:f1d7a25fc5159ceb668c26b595dcffb00ef54ada31cbb52eaa8319dc143fc9d8
===> CACHING
[cacher] Reusing layer 'org.cloudfoundry.openjdk:d2df8bc799b09c8375f79bf646747afac3d933bb1f65de71d6c78e7466ff8fe4' with SHA sha256:11439713b023be71211cb83ecd56a1be63e0c0be3e4814a18cc4c71d2264dea5
Successfully built image localhost:5000/pivotal-mysql-web

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ docker pull localhost:5000/pivotal-mysql-web
Using default tag: latest
latest: Pulling from pivotal-mysql-web
410238d178d0: Already exists
a00e90b544bc: Already exists
9de264eecc08: Already exists
4acedf754175: Already exists
d5a72fc0c7a1: Already exists
4066d2d744ac: Already exists
dba1ef680b99: Already exists
Digest: sha256:f1d7a25fc5159ceb668c26b595dcffb00ef54ada31cbb52eaa8319dc143fc9d8
Status: Downloaded newer image for localhost:5000/pivotal-mysql-web:latest

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ docker run -m 1G -p 8080:8080 localhost:5000/pivotal-mysql-web

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.0.RELEASE)

2019-06-12 01:02:16.174  INFO 1 --- [           main] c.p.p.m.PivotalMySqlWebApplication       : Starting PivotalMySqlWebApplication on a018f17d6121 with PID 1 (/workspace/BOOT-INF/classes started by vcap in /workspace)
2019-06-12 01:02:16.179  INFO 1 --- [           main] c.p.p.m.PivotalMySqlWebApplication       : No active profile set, falling back to default profiles: default
2019-06-12 01:02:18.336  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-06-12 01:02:18.374  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-06-12 01:02:18.375  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/9.0.12
2019-06-12 01:02:18.391  INFO 1 --- [           main] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/layers/org.cloudfoundry.openjdk/openjdk-jre/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
2019-06-12 01:02:18.512  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-06-12 01:02:18.512  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2270 ms
2019-06-12 01:02:19.019  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-06-12 01:02:19.020  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2019-06-12 01:02:19.020  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-06-12 01:02:19.020  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'formContentFilter' to: [/*]
2019-06-12 01:02:19.021  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2019-06-12 01:02:19.021  INFO 1 --- [           main] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2019-06-12 01:02:19.022  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpTraceFilter' to: [/*]
2019-06-12 01:02:19.022  INFO 1 --- [           main] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2019-06-12 01:02:19.374  INFO 1 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-06-12 01:02:19.918  INFO 1 --- [           main] .s.s.UserDetailsServiceAutoConfiguration :

Using generated security password: 42d4ec01-6459-4205-a66b-1b49d333121e

2019-06-12 01:02:20.043  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/**'], []
2019-06-12 01:02:20.092  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@47e4d9d0, org.springframework.security.web.context.SecurityContextPersistenceFilter@5e4fa1da, org.springframework.security.web.header.HeaderWriterFilter@4ae263bf, org.springframework.security.web.csrf.CsrfFilter@2788d0fe, org.springframework.security.web.authentication.logout.LogoutFilter@15fdd1f2, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@2d746ce4, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@70e02081, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@49798e84, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@1948ea69, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@3f92c349, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@66ba7e45, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@6ed06f69, org.springframework.security.web.session.SessionManagementFilter@19ccca5, org.springframework.security.web.access.ExceptionTranslationFilter@57aa341b, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@7c6442c2]
2019-06-12 01:02:20.138  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 9 endpoint(s) beneath base path '/actuator'
2019-06-12 01:02:20.259  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-06-12 01:02:20.265  INFO 1 --- [           main] c.p.p.m.PivotalMySqlWebApplication       : Started PivotalMySqlWebApplication in 4.841 seconds (JVM running for 5.646)



And that's it a locally built OCI image (Built very fast all locally) you have run locally from your local image registry.

Here is how to view your local registry using HTTPie showing our locally built "pivotal-mysql-web" OCI image we created above

papicella@papicella:~$ http http://localhost:5000/v2/_catalog
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json; charset=utf-8
Date: Wed, 12 Jun 2019 01:53:40 GMT
Docker-Distribution-Api-Version: registry/2.0
X-Content-Type-Options: nosniff

{
    "repositories": [
        "pivotal-mysql-web",
        "run",
        "sample-java-app"
    ]
}


More Information

1. Cloud Native Buildpacks: an Industry-Standard Build Process for Kubernetes and Beyond.
https://content.pivotal.io/blog/cloud-native-buildpacks-for-kubernetes-and-beyond

2. buildspacks.io Home Page
https://buildpacks.io/

Categories: Fusion Middleware

Building PivotalMySQLWeb using Cloud Native Buildpacks (CNB)

Pas Apicella - Sun, 2019-06-09 00:28
Not heard of Cloud Native Buildpacks? If not this post will show why you might want to. If you want to make your developers more productive with Kubernetes, you’re going to want to look at Cloud Native Buildpacks.

https://buildpacks.io/

Until cloud platforms such as Heroku and Pivotal Cloud Foundry incorporate the Buildpack v3 Lifecycle, the fastest way to try Cloud Native Buildpacks is via the pack CLI, which integrates with your local Docker daemon. Here is an example below taking Pivotal MySQLWeb application and creating an OCI compliant image from that

Pre Steps:

1. Install pack using this link

  https://buildpacks.io/docs/install-pack/

2. Ensure you have Docker CE installed if not use this link

  https://hub.docker.com/search/?type=edition&offering=community

Steps:

1. I am using Pivotal MySQLWeb which i have packaged using maven and then taken the JAR and exploded it onto the file system to avoid compilation. You can still just use source code and the Cloud Native Buildpack's will still work but in this example I avoid the maven compilation step by using an exploded JAR file already compiled which is what a Build Service on a cloud platform would do in any case

Let's start by using "pack" to create our image as per below

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ pack build pivotal-mysql-web --path ./PivotalMySQLWeb

Using default builder image cloudfoundry/cnb:cflinuxfs3
Pulling image index.docker.io/cloudfoundry/cnb:cflinuxfs3
cflinuxfs3: Pulling from cloudfoundry/cnb
18d7ea8d445c: Pull complete
18d0be9dc457: Pull complete
f5407c34df38: Pull complete
35c61e03e6bf: Pull complete
40d144c93ada: Pull complete
4f4fb700ef54: Pull complete
0432ec3bb9f8: Pull complete
3731e128636c: Pull complete
1bab066bbafe: Pull complete
4cc53e89f635: Pull complete
4fd62e90f994: Pull complete
dc9fa77b2cd2: Pull complete
3cd4ed6e9bbf: Pull complete
a525f8221dc8: Pull complete
f01bc40f59c5: Pull complete
1f9842b1696d: Pull complete
3e15eeb884d5: Pull complete
3c0f59c7956f: Pull complete
c3e6214340d9: Pull complete
6955f2c8bfad: Pull complete
5112994886a0: Pull complete
e19195f86112: Pull complete
07fb5cd454f2: Pull complete
Digest: sha256:197439e9ccc699daa6431bd7154c80b3b0ce75b072792a0e93edd6779756f3bc
Status: Downloaded newer image for cloudfoundry/cnb:cflinuxfs3
Selected run image cloudfoundry/cnb-run:cflinuxfs3 from builder
Pulling image cloudfoundry/cnb-run:cflinuxfs3
cflinuxfs3: Pulling from cloudfoundry/cnb-run
0a25bf28c5eb: Pull complete
7216becd0525: Pull complete
Digest: sha256:f9605c5af04b2ba04918879f2bf9d37c55620ae28e73b94e9926cd97bbf8fe96
Status: Downloaded newer image for cloudfoundry/cnb-run:cflinuxfs3
Using build cache volume pack-cache-1f2556cf858e.build
Executing lifecycle version 0.2.1
===> DETECTING
[detector] Trying group 1 out of 4 with 8 buildpacks...
[detector] ======== Results ========
[detector] pass: Cloud Foundry OpenJDK Buildpack
[detector] skip: Cloud Foundry Build System Buildpack
[detector] pass: Cloud Foundry JVM Application Buildpack
[detector] skip: Cloud Foundry Azure Application Insights Buildpack
[detector] skip: Cloud Foundry Debug Buildpack
[detector] skip: Cloud Foundry Google Stackdriver Buildpack
[detector] skip: Cloud Foundry JMX Buildpack
[detector] skip: Cloud Foundry Procfile Buildpack
===> RESTORING
[restorer] cache '/cache': metadata not found, nothing to restore
===> ANALYZING
===> BUILDING
[builder] -----> Cloud Foundry OpenJDK Buildpack 1.0.0-M8
[builder] -----> OpenJDK JRE 11.0.3: Contributing to layer
[builder]        Downloading from https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-jre_x64_linux_hotspot_11.0.3_7.tar.gz
[builder]        Verifying checksum
[builder]        Expanding to /layers/org.cloudfoundry.openjdk/openjdk-jre
[builder]        Writing JAVA_HOME to shared
[builder]
[builder] -----> Cloud Foundry JVM Application Buildpack 1.0.0-M8
[builder] -----> Main-Class Classpath: Contributing to layer
[builder]        Writing CLASSPATH to launch
[builder] -----> Process types:
[builder]        task: java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[builder]        web:  java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[builder]
===> EXPORTING
[exporter] Exporting layer 'app' with SHA sha256:b32618ed6b86fb496a4ce33db9df49fdd4ef16c5646b174b5643c8befcb7408a
[exporter] Exporting layer 'config' with SHA sha256:9538e967fa10f23b3415c382a3754ebf4c2645c20b6d76af519236c1181e7639
[exporter] Exporting layer 'launcher' with SHA sha256:04ca7957074763290a9abe6a067ce8c902a2ab51ed6c55102964e3f3294cdebd
[exporter] Exporting layer 'org.cloudfoundry.openjdk:openjdk-jre' with SHA sha256:e540f1464509ac673a25bd2f24c7dd6875f805c0dd35e9af84dd4669e2fd0c93
[exporter] Exporting layer 'org.cloudfoundry.jvmapplication:main-class' with SHA sha256:8537197b3f57d86a59397b89b4fbdd14900a602cc12961eae338b9ef2513cdc0
[exporter]
[exporter] *** Image: index.docker.io/library/pivotal-mysql-web:latest@8957afa91f464e2c0adc24968c31613148b9905ff1fb90ec59ff84e165d939ac
===> CACHING
[cacher] Caching layer 'org.cloudfoundry.openjdk:d2df8bc799b09c8375f79bf646747afac3d933bb1f65de71d6c78e7466ff8fe4' with SHA sha256:11439713b023be71211cb83ecd56a1be63e0c0be3e4814a18cc4c71d2264dea5
Successfully built image pivotal-mysql-web

2. Inspect the docker image on your laptop as shown below

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ docker image inspect pivotal-mysql-web

[
    {
        "Id": "sha256:8957afa91f464e2c0adc24968c31613148b9905ff1fb90ec59ff84e165d939ac",
        "RepoTags": [
            "pivotal-mysql-web:latest"
        ],
        "RepoDigests": [],
        "Parent": "",
        "Comment": "",
        "Created": "2019-06-05T05:25:58Z",
        "Container": "",
        "ContainerConfig": {

...

3. Run the docker image as shown below

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ docker run --rm -p 8080:8080 pivotal-mysql-web

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.0.RELEASE)

2019-06-05 05:30:43.005  INFO 1 --- [           main] c.p.p.m.PivotalMySqlWebApplication       : Starting PivotalMySqlWebApplication on 5d21f8f32ba4 with PID 1 (/workspace/BOOT-INF/classes started by vcap in /workspace)
2019-06-05 05:30:43.009  INFO 1 --- [           main] c.p.p.m.PivotalMySqlWebApplication       : No active profile set, falling back to default profiles: default
2019-06-05 05:30:44.662  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-06-05 05:30:44.686  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-06-05 05:30:44.687  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet Engine: Apache Tomcat/9.0.12
2019-06-05 05:30:44.698  INFO 1 --- [           main] o.a.catalina.core.AprLifecycleListener   : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/layers/org.cloudfoundry.openjdk/openjdk-jre/lib:/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
2019-06-05 05:30:44.793  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-06-05 05:30:44.794  INFO 1 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 1736 ms
2019-06-05 05:30:45.130  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-06-05 05:30:45.131  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'webMvcMetricsFilter' to: [/*]
2019-06-05 05:30:45.131  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-06-05 05:30:45.131  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'formContentFilter' to: [/*]
2019-06-05 05:30:45.132  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'requestContextFilter' to: [/*]
2019-06-05 05:30:45.132  INFO 1 --- [           main] .s.DelegatingFilterProxyRegistrationBean : Mapping filter: 'springSecurityFilterChain' to: [/*]
2019-06-05 05:30:45.133  INFO 1 --- [           main] o.s.b.w.servlet.FilterRegistrationBean   : Mapping filter: 'httpTraceFilter' to: [/*]
2019-06-05 05:30:45.134  INFO 1 --- [           main] o.s.b.w.servlet.ServletRegistrationBean  : Servlet dispatcherServlet mapped to [/]
2019-06-05 05:30:45.436  INFO 1 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2019-06-05 05:30:45.851  INFO 1 --- [           main] .s.s.UserDetailsServiceAutoConfiguration :

Using generated security password: 3823aef6-6f72-4f5f-939d-bbd3d57ec2fa

2019-06-05 05:30:45.931  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: Ant [pattern='/**'], []
2019-06-05 05:30:45.967  INFO 1 --- [           main] o.s.s.web.DefaultSecurityFilterChain     : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@2e140e59, org.springframework.security.web.context.SecurityContextPersistenceFilter@26ae880a, org.springframework.security.web.header.HeaderWriterFilter@25a73de1, org.springframework.security.web.csrf.CsrfFilter@652ab8d9, org.springframework.security.web.authentication.logout.LogoutFilter@17814b1c, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@54f66455, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@58399d82, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@49a71302, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4c03a37, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@3c017078, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@298d9a05, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@5cd61783, org.springframework.security.web.session.SessionManagementFilter@771db12c, org.springframework.security.web.access.ExceptionTranslationFilter@5f303ecd, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@73ab3aac]
2019-06-05 05:30:46.000  INFO 1 --- [           main] o.s.b.a.e.web.EndpointLinksResolver      : Exposing 9 endpoint(s) beneath base path '/actuator'
2019-06-05 05:30:46.096  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-06-05 05:30:46.101  INFO 1 --- [           main] c.p.p.m.PivotalMySqlWebApplication       : Started PivotalMySqlWebApplication in 3.654 seconds (JVM running for 4.324)

4. Browse to localhost:8080 to invoke the application just to be sure it worked



5. Publish the OCI compliant image to your registry. In this example I am using Docker Hub as shown below

papicella@papicella:~/pivotal/PCF/APJ/PPTX/CNCF/buildpacks.io/demos$ pack build pasapples/pivotal-mysql-web:latest --publish --path ./PivotalMySQLWeb --no-pull

Using default builder image cloudfoundry/cnb:cflinuxfs3
Selected run image cloudfoundry/cnb-run:cflinuxfs3 from builder
Using build cache volume pack-cache-a4a78257c7be.build
Executing lifecycle version 0.2.1
===> DETECTING
[detector] Trying group 1 out of 4 with 8 buildpacks...
[detector] ======== Results ========
[detector] pass: Cloud Foundry OpenJDK Buildpack
[detector] skip: Cloud Foundry Build System Buildpack
[detector] pass: Cloud Foundry JVM Application Buildpack
[detector] skip: Cloud Foundry Azure Application Insights Buildpack
[detector] skip: Cloud Foundry Debug Buildpack
[detector] skip: Cloud Foundry Google Stackdriver Buildpack
[detector] skip: Cloud Foundry JMX Buildpack
[detector] skip: Cloud Foundry Procfile Buildpack
===> RESTORING
[restorer] cache '/cache': metadata not found, nothing to restore
===> ANALYZING
===> BUILDING
[builder] -----> Cloud Foundry OpenJDK Buildpack 1.0.0-M8
[builder] -----> OpenJDK JRE 11.0.3: Contributing to layer
[builder]        Downloading from https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.3%2B7/OpenJDK11U-jre_x64_linux_hotspot_11.0.3_7.tar.gz
[builder]        Verifying checksum
[builder]        Expanding to /layers/org.cloudfoundry.openjdk/openjdk-jre
[builder]        Writing JAVA_HOME to shared
[builder]
[builder] -----> Cloud Foundry JVM Application Buildpack 1.0.0-M8
[builder] -----> Main-Class Classpath: Contributing to layer
[builder]        Writing CLASSPATH to launch
[builder] -----> Process types:
[builder]        task: java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[builder]        web:  java -cp $CLASSPATH $JAVA_OPTS org.springframework.boot.loader.JarLauncher
[builder]
===> EXPORTING
[exporter] Exporting layer 'app' with SHA sha256:b32618ed6b86fb496a4ce33db9df49fdd4ef16c5646b174b5643c8befcb7408a
[exporter] Exporting layer 'config' with SHA sha256:9538e967fa10f23b3415c382a3754ebf4c2645c20b6d76af519236c1181e7639
[exporter] Exporting layer 'launcher' with SHA sha256:04ca7957074763290a9abe6a067ce8c902a2ab51ed6c55102964e3f3294cdebd
[exporter] Exporting layer 'org.cloudfoundry.openjdk:openjdk-jre' with SHA sha256:e540f1464509ac673a25bd2f24c7dd6875f805c0dd35e9af84dd4669e2fd0c93
[exporter] Exporting layer 'org.cloudfoundry.jvmapplication:main-class' with SHA sha256:8537197b3f57d86a59397b89b4fbdd14900a602cc12961eae338b9ef2513cdc0
[exporter]
[exporter] *** Image: index.docker.io/pasapples/pivotal-mysql-web:latest@sha256:c862eda516289c2daa29580c95b74b4d72eca9caf941a3a6ac2bf2bd886057e5
===> CACHING
[cacher] Caching layer 'org.cloudfoundry.openjdk:d2df8bc799b09c8375f79bf646747afac3d933bb1f65de71d6c78e7466ff8fe4' with SHA sha256:11439713b023be71211cb83ecd56a1be63e0c0be3e4814a18cc4c71d2264dea5
Successfully built image pasapples/pivotal-mysql-web:latest


At this point you have a OCI compliant image sitting in your registry ready to be consumed for your K8's application needs all from just source code or pre compiled source code in this example a Java Application. Let's not forget this support's a polyglot programming model so supports NodeJS, Python and anything that buildpack's supports.

More Information

1. Cloud Native Buildpacks: an Industry-Standard Build Process for Kubernetes and Beyond.

2. buildspacks.io Home Page

Categories: Fusion Middleware

Metrics Driven Blue-green Deployments using Spinnaker’s Cloud Foundry Integration

Pas Apicella - Thu, 2019-05-02 18:24
I recently attended CF Summit in Philadelphia in March 2019 and here is the talk track to that.

Metrics Driven Blue-green Deployments using Spinnaker’s Cloud Foundry Integration - Amith Nambiar & Pas Apicella, Pivotal

https://www.youtube.com/watch?v=9C8m7n_sG38 
Categories: Fusion Middleware

Any App, Every Cloud, One Platform: Delivering on Pivotal’s Vision

Pas Apicella - Wed, 2019-05-01 20:42
Pivotal Cloud Foundry (PCF) recently turned five-years-old. In celebration, Onsi Fakhouri reflects on how far the platform has come, and provides a look at our plans for the months and years ahead.

The Pivotal Blog post exists here:

https://content.pivotal.io/blog/any-app-every-cloud-one-platform-delivering-on-pivotal-s-vision
Categories: Fusion Middleware

Deploying an Application to Pivotal Cloud Foundry through Spinnaker and then invoking a resize operation

Pas Apicella - Thu, 2019-03-28 22:36
In this post we show a basic deployment to Cloud foundry in fact Pivotal Cloud foundry 2.4 using spinnaker 1.13.0.

Assumptions:

1. Configured a Cloud Foundry provider as shown below

spinnaker@myspinnaker-spinnaker-halyard-0:/workdir$ hal config provider cloudfoundry account add pez208 --user admin --password mypassword --api api.system.run.myenv.io --environment dev --appsManagerURI https://apps.system.run.myenv.io
+ Get current deployment
  Success
+ Add the pez208 account
  Success
Problems in default.provider.cloudfoundry:
- WARNING To be able to link server groups to CF Metrics a URI is
  required: pez208

+ Successfully added account pez208 for provider cloudfoundry.

2. Enable cloud foundry provider

spinnaker@myspinnaker-spinnaker-halyard-0:/workdir$ hal config provider cloudfoundry enable
+ Get current deployment
  Success
+ Edit the cloudfoundry provider
  Success

+ Successfully enabled cloudfoundry

3. Run "hal deploy apply"

spinnaker@myspinnaker-spinnaker-halyard-0:/workdir$ hal deploy apply
+ Get current deployment
  Success
+ Prep deployment
  Success
+ Preparation complete... deploying Spinnaker
+ Get current deployment
  Success
+ Apply deployment
  Success
+ Deploy spin-clouddriver
  Success
+ Deploy spin-front50
  Success
+ Deploy spin-orca
  Success
+ Deploy spin-deck
  Success
+ Deploy spin-echo
  Success
+ Deploy spin-gate
  Success
+ Deploy spin-igor
  Success
+ Deploy spin-rosco
  Success
+ Run `hal deploy connect` to connect to Spinnaker.

IN this demo I can simply going to deploy my artifact sitting within my GitHub repo using a HTTP endpoiunt so for that will need to enable HTTP artifact support in Spinnaker as shown below

$ hal config features edit --artifacts true
$ hal config artifact http enable
$ hal config artifact http account add apples-http
$ hal deploy apply

Steps:

1. Lets create a new application called "pastest" as shown below. Be sure to select "CloudFoundry" provider.


2. Click "Create"

3. Click on "Create Server group"

4. Fill in the fields as shown below. In this example I am using the following

  • Account "pez208" which was the cloud foundry provider name we used above
  • Region is basically the CF space we will deploy into
  • HTTP artifact which I enabled called "apples-http".
  • Fully qualified path to my JAR file I wish to deploy
  • Form based manifest settings to define my application deployment settings




5. Click "Create"

6. Verify your application is going through the deploy phase as shown in the dialog



7. Oncer complete we can see our deployed application in Pivotal Cloud Foundry Applications Manager as shown below.


8. Now if we return to the Spinnaker UI we will see various views of what we just deployed as follows

Server Group Main Page


Load Balancer Page



Instance Page


9. Now let's actually scale our application to 2 instances rather than just a single instance. To do that lets click the "Resize Option" in the "Server Group Page" as shown below



10. In the dialog which appears set "Resize to" to "2"


11. Click "Submit"


12. Return to Pivotal Cloud Foundry Applications Manager and verify we now have 2 instances of our application as shown below



13. This will also be reflected on Spinnaker UI as well



More Information

Cloud Foundry - Cloud Provider
https://www.spinnaker.io/reference/providers/cf/
Categories: Fusion Middleware

Two nice Pivotal Container Service (PKS) CLI commands I use very often

Pas Apicella - Wed, 2019-03-27 23:07
Having always created multiple PKS clusters at times I forget the configuration of my K8S clusters and this command comes in very handy

First lets list those clusters we have created with PKS

papicella@papicella:~$ pks clusters

Name    Plan Name  UUID                                  Status     Action
lemons  small      5c19c39e-88ae-4e06-a1cf-050b517f1b9c  succeeded  CREATE
banana  small      7c3ab1b3-a25c-498e-8179-9a14336004ff  succeeded  CREATE

Now lets see how many master nodes and how many worker nodes actually exist in my cluster using "pks cluster {name} --json"

papicella@papicella:~$ pks cluster banana --json

{
   "name": "banana",
   "plan_name": "small",
   "last_action": "CREATE",
   "last_action_state": "succeeded",
   "last_action_description": "Instance provisioning completed",
   "uuid": "7c3ab1b3-a25c-498e-8179-9a14336004ff",
   "kubernetes_master_ips": [
      "10.0.0.1"
   ],
   "parameters": {
      "kubernetes_master_host": "banana.yyyy.hhh.pivotal.io",
      "kubernetes_master_port": 8443,
      "kubernetes_worker_instances": 3
   }
}

One final PKS CLI command I use often when creating my clusters is the --wait option so I know when it's done creating the cluster rather then continually checking using "pks cluster {name}"

papicella@papicella:~$ pks create-cluster cluster1 -e cluster1.run.yyyy.hhh.pivotal.io -p small -n 4 --wait

More Information

https://docs.pivotal.io/runtimes/pks/1-3/cli/index.html

Categories: Fusion Middleware

Pages

Subscribe to Oracle FAQ aggregator - Fusion Middleware