Skip to content

Instantly share code, notes, and snippets.

@brijesh-deb
Last active November 4, 2018 06:25
Show Gist options
  • Save brijesh-deb/6ac0a384ef409470541af76c0d5d3fe2 to your computer and use it in GitHub Desktop.
Save brijesh-deb/6ac0a384ef409470541af76c0d5d3fe2 to your computer and use it in GitHub Desktop.
#Predix #HandsOn

Setup CF CLI

Basic Commands

  • Login to cf : cf login
  • Display all services in the catalog: cf marketplace or cf m
  • Create a new service: cf create-service
  • Delete a service: cf delete-service <>
  • Display all applications in your space: cf apps
  • Deploy an application:
    • cf push
    • Cf push -m 512M
  • Display all service instances in your space: cf services or cf s
  • To change your space: cf target -s
  • To get help: cf create-service -help
  • List of applications with URL: cf a
  • Delete an application: cf delete
  • List users in an organisation: cf org-users
  • View environment variable of your application: cf env
  • Stop an application: cf stop
  • Check scale of an application: cf scale
  • Scale an application: cf scale -i
  • Bind a service to another: cf bind-service
  • Restage an application: cf restage
  • Create new PostGres service instance in your space: cf create-service
  • Push an application: cf push
  • Php PG Admin [to access pgsql thru a client]

CF log tail

  • Add system.out.println in code
  • Deploy the application in P2
  • Start the log tail
    • Cf logs <>
    • Cf logs <> --recent
  • Run the application
  • Log outputs will be shown in console

Postgres/ phpPgAdmin

phpPgAdmin Setup

  • Download phppgadmin-cf-cf-ready.zip
  • Unzip
  • Go to folder and push application
    • Cf push bdeb-phppgadmin
  • Bind service
    • Cf bs bdeb-phppgadmin my-postgres
  • Restage appliaction
    • Cf restage bdeb-phppgadmin

Access

  • Get URL
    • Cf a
  • Get username and password from application env
    • Cf env bdeb-phppgadmin

Security:UAA

  • Predix offers UAA service for identity management and authentication & ACS service for fine-grained authorization.
  • UAA provides
    • Oauth 2 authorization server
    • SCIM based identity management solution; SCIM = System for Cross Domain Identity Management
    • Support for authentication based on SAML Web SSO profile.
  • Create an UAA service
    • cf cs predix-uaa free bdeb-uaa -c "{"adminClientSecret":"admin123"}" [admin client secret: admin123]
  • Check details of UAA service created in UAA Dashboard
    • Login to predix.io
    • Search of the UAA service created
    • Click "Open Service Instance" [ admin password may be required]
    • Shows details like UAA url, clients, users, groups and identity providers
  • Login to Predix toolkit ( https://www.predix.io/predix-env/predix-toolkit) as admin
    • Paste UAA url
    • Enter admin client secret (eg admin123)
    • Click submit
  • Create Client ID
    • Click "Create client id" in predix toolkit
    • Enter client id and client secret (brijesh\mysecret)
  • Create user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment