{"id":18429146,"url":"https://github.com/openliberty/guide-okd","last_synced_at":"2025-06-19T09:41:01.260Z","repository":{"id":46718932,"uuid":"217387918","full_name":"OpenLiberty/guide-okd","owner":"OpenLiberty","description":"(Deprecated) A guide on how to use Minishift to deploy microservices to an Origin Community Distribution of Kubernetes (OKD) cluster.","archived":false,"fork":false,"pushed_at":"2024-04-23T18:26:50.000Z","size":257,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"prod","last_synced_at":"2025-04-07T17:41:47.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://openliberty.io/guides/okd.html","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenLiberty.png","metadata":{"files":{"readme":"README.adoc","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-24T20:17:33.000Z","updated_at":"2024-07-03T20:48:56.000Z","dependencies_parsed_at":"2025-04-07T17:48:41.844Z","dependency_job_id":null,"html_url":"https://github.com/OpenLiberty/guide-okd","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/OpenLiberty/guide-okd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenLiberty%2Fguide-okd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenLiberty%2Fguide-okd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenLiberty%2Fguide-okd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenLiberty%2Fguide-okd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenLiberty","download_url":"https://codeload.github.com/OpenLiberty/guide-okd/tar.gz/refs/heads/prod","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenLiberty%2Fguide-okd/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260726559,"owners_count":23053180,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-06T05:16:01.262Z","updated_at":"2025-06-19T09:40:56.251Z","avatar_url":"https://github.com/OpenLiberty.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"// Copyright (c) 2020, 2023 IBM Corporation and others.\n// Licensed under Creative Commons Attribution-NoDerivatives\n// 4.0 International (CC BY-ND 4.0)\n//   https://creativecommons.org/licenses/by-nd/4.0/\n//\n// Contributors:\n//     IBM Corporation\n//\n:projectid: okd\n:page-layout: guide-multipane\n:page-duration: 1 hour\n:page-releasedate: 2020-01-17\n:page-description: Explore how to deploy microservices on an OKD cluster using a virtual machine with Minishift. \n:page-tags: ['Kubernetes', 'Docker', 'Cloud'] \n:page-permalink: /guides/{projectid}\n:page-related-guides: ['cloud-openshift', 'istio-intro', 'microprofile-istio-retry-fallback', 'kubernetes-intro', 'containerize']\n:common-includes: https://raw.githubusercontent.com/OpenLiberty/guides-common/prod\n:source-highlighter: prettify\n:page-seo-title: Deploying Java microservices to an OKD cluster using Minishift\n:page-seo-description: A getting started tutorial and an example on how to deploy Java microservices to an Origin Community Distribution of Kubernetes (OKD) cluster using Minishift for development purposes.\n:guide-author: Open Liberty\n= Deploying microservices to an OKD cluster using Minishift\n\n[.hidden]\nNOTE: This repository contains the guide documentation source. To view the guide in published form, view it on the https://openliberty.io/guides/{projectid}.html[Open Liberty website^].\n\nExplore how to use Minishift to deploy microservices to an Origin Community Distribution of Kubernetes (OKD) cluster. \n\n// *********************************************************************************************\n\n== What you'll learn \n\nYou will learn how to deploy two simple microservices with Open Liberty to an Origin Community Distribution of Kubernetes (OKD) cluster that is running in \nMinishift.\n\n=== What is Origin Community Distribution of Kubernetes (OKD)?\n\nOKD, formerly known as OpenShift Origin, is the upstream open source project for all OpenShift products. \nOKD is a Kubernetes-based platform with added functionality. \nOKD streamlines the DevOps process by providing an intuitive development pipeline. \nIt also provides integration with multiple tools to make the deployment and management of cloud applications easier.\n\nTo learn more about OKD, check out the https://www.okd.io/[official OKD page^]. \nTo learn more about the different platforms that Red Hat OpenShift offers, \ncheck out the https://docs.openshift.com[official OpenShift documentation^]. \nIf you would like to learn more about Kubernetes, check out \nthe https://openliberty.io/guides/kubernetes-intro.html[Deploying microservices to Kubernetes^] guide.\n\nUsing Maven, you will build the `system` microservice that collects basic system properties from your system and the `inventory` microservice that will \ninteract with the `system` microservice. Then, you will learn how to deploy both to the cluster and establish communication between them.\n\nYou will use Minishift, a tool for you to run OKD on a local system. \nMinishift allows developers to deploy a quick and easy OKD cluster for application development.\n\nMinishift is based on OKD 3.11.\nTo run OKD 4.1 or newer on your local system, you can use the CodeReady Containers tool instead.\nTo learn how to use CodeReady Containers, check out the\nhttps://openliberty.io/guides/openshift-codeready-containers.html[Deploying microservices to OpenShift using CodeReady Containers^] guide.\n\n// *********************************************************************************************\n\n== Additional prerequisites \n\nThe following tools need to be installed:\n\n* *Minishift:* With Minishift, you can try OKD by running a VM with a single-node cluster.\nYou can use Minishift with any OS, making it a convenient and flexible tool for testing and development.\nFor installation instructions, refer to the official \nhttps://docs.okd.io/latest/minishift/index.html[OKD Minishift documentation^].\n\nTo verify that Minishift is installed correctly, run the following command:\n\n[role=command]\n```\nminishift version\n```\n\nThe output is similar to:\n\n[role=\"no_copy\"]\n----\nminishift v1.34.1+c2ff9cb\n----\n\n* *Docker:* Docker is a containerization software for building the containers that you will eventually deploy onto the OKD cluster. For installation \ninstructions, refer to the official https://docs.docker.com/install/[Docker documentation^].\n\nTo verify that Docker is installed correctly, run the following command:\n\n[role=command]\n```\ndocker version\n```\n\nThe output is similar to:\n\n[role=\"no_copy\"]\n----\nClient: Docker Engine - Community\n Version:           19.03.5\n----\n\n// *********************************************************************************************\n\n//== Getting Started\n\n[role=command]\ninclude::{common-includes}/gitclone.adoc[]\n\n// *********************************************************************************************\n\n== Starting Minishift\n\n=== Deploying the cluster\n\nRun the following command to start Minishift and create the OKD cluster:\n\n[role=command]\n```\nminishift start\n```\n\nIf the cluster started successfully, you see the following output:\n\n[role=\"no_copy\"]\n----\nServer Information ...\nOpenShift server started.\n\nThe server is accessible via web console at:\n    https://192.168.99.103:8443/console\n----\n\n=== Logging in to the cluster\n\nTo interact with the OpenShift cluster, you need to use the `oc` command.\nMinishift already includes the `oc` binary.\nTo use the `oc` commands, run the following command to configure your PATH to include the binary:\n\n[role=command]\n```\nminishift oc-env\n```\n\nThe resulting output differs based on your OS and environment, but you get an output similar to the following:\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.linux_section]\n--\n[role=\"no_copy\"]\n----\nexport PATH=\"/root/.minishift/cache/oc/v3.11.0/linux:$PATH\"\n# Run this command to configure your command-line session:\n# eval $(minishift oc-env)\n----\n\nRun the appropriate command to configure your environment:\n\n[role=command]\n```\neval $(minishift oc-env)\n```\n--\n\n[.tab_content.mac_section]\n--\n[role=\"no_copy\"]\n----\nexport PATH=\"/Users/guidesbot@ibm.com/.minishift/cache/oc/v3.11.0/darwin:$PATH\"\n# Run this command to configure your command-line session:\n# eval $(minishift oc-env)\n----\n\nRun the appropriate command to configure your environment:\n\n[role=command]\n```\neval $(minishift oc-env)\n```\n--\n\n[.tab_content.windows_section] \n--\n[role=\"no_copy\"]\n----\nSET PATH=C:\\Users\\guides-bot\\.minishift\\cache\\oc\\v3.11.0\\windows;%PATH%\nREM Run this command to configure your command-line session:\nREM     @FOR /f \"tokens=*\" %i IN ('minishift oc-env') DO @call %i\n----\n\nRun the appropriate command to configure your environment:\n\n[role=command]\n```\n@FOR /f \"tokens=*\" %i IN ('minishift oc-env') DO @call %i\n```\n--\n\nYou can run through the development cycle by using OpenShift's web console through the URL provided in the command output of the `minishift start` \ncommand. You can also run the following command to open the web console:\n\n[role=command]\n```\nminishift console\n```\n\nYou can log in with the following credentials:\n\n[role=\"no_copy\"]\n----\nUser:     developer\nPassword: [any value]\n----\n\nThe web console provides a GUI alternative to their CLI tools that you can explore on your own.\nThis guide will continue with the CLI tools.\n\nYou can confirm your credentials by running the `oc whoami` command. You will get `developer` as your output.\n\nNext, create a new OpenShift project by running the following command:\n\n[role=command]\n```\noc new-project [project-name]\n```\n\nYou are now ready to build and deploy a microservice.\n\n// *********************************************************************************************\n\n== Building the system microservice\n\n//file 0\nDockerfile\n[source, Text, linenums, role=\"code_column\"]\n----\ninclude::finish/system/Dockerfile[]\n----\n\nA simple microservice named `system` will be packaged, containerized, and deployed onto the OKD cluster.\nThe `system` microservice collects the JVM properties of the host machine.\n\nNavigate to the `start` directory. \n\nThe source code of the `system` and `inventory` microservices is located at the `system` and `inventory` directories. \nFocus on the `system` microservice first, and you will learn about the `inventory` microservice later.\n\nIn the `start` directory, run the following command to package the `system` microservice:\n\n[role=command]\n```\nmvn -pl system package\n```\n\nThe `mvn package` command compiles, verifies, and builds the project.\nThe resulting compiled code is packaged into a `war` web archive that can be found under the `system/target` directory.\nThe archive contains the application that is needed to run the microservice on an Open Liberty,\nand it is now ready to be injected into a Docker container for deployment.\n\n== Containerizing the system microservice\n\n=== Reusing the Docker daemon\n\nTo simplify the local deployment process, you can reuse the built-in Minishift Docker daemon.\nReusing the Minishift Docker daemon allows you to use the internal Docker registry,\nso you don't have to build a Docker registry on your machine.\nTo reuse the Docker daemon, run the following command to point your command-line session to use the Minishift's daemon:\n\n[role=command]\n```\nminishift docker-env\n```\n\nThe result of the command is a list of bash environment variable exports that configure your environment to reuse the Docker daemon inside the single \nMinishift VM instance. The commands differ based on your OS and environment, but you get an output similar to the following example:\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.mac_section.linux_section]\n--\n[role=no_copy]\n----\nexport DOCKER_TLS_VERIFY=\"1\"\nexport DOCKER_HOST=\"tcp://192.168.99.103:2376\"\nexport DOCKER_CERT_PATH=\"/Users/guidesbot@ibm.com/.minishift/certs\"\n# Run this command to configure your command-line session:\n# eval $(minishift docker-env)\n----\n\nRun the `eval` command to configure your environment:\n\n[role=command]\n```\neval $(minishift docker-env)\n```\n--\n\n[.tab_content.windows_section]\n--\n[role=no_copy]\n----\nSET DOCKER_TLS_VERIFY=1\nSET DOCKER_HOST=tcp://9.26.69.218:2376\nSET DOCKER_CERT_PATH=C:\\Users\\maihameed\\.minishift\\certs\nREM Run this command to configure your command-line session:\nREM     @FOR /f \"tokens=*\" %i IN ('minishift docker-env') DO @call %i\n----\n\nRun the given `@FOR` command to configure your environment:\n\n[role=command]\n```\n@FOR /f \"tokens=*\" %i IN ('minishift docker-env') DO @call %i\n```\n--\n\n=== Building the Docker image\n\ninclude::{common-includes}/ol-kernel-docker-pull.adoc[]\n\nNow that the environment is set up, ensure that you are in the `start` directory and run the following command to build the `system` Docker image:\n\n[role=command]\n```\ndocker build -t system system/\n```\n\nThe command builds an image named `system` from the [hotspot file=0]`Dockerfile` provided in the `system` directory.\nTo verify that the images are built, run the following command to list all local Docker images:\n\n[role=command]\n```\ndocker images\n```\n\nYour `system` image should appear in the list of all Docker images:\n\n[role=no_copy]\n----\nREPOSITORY             TAG                 IMAGE ID            CREATED             SIZE\nsystem                 latest              e8a8393e9364        2 minutes ago       399MB\n----\n\n=== Accessing the internal registry\n\nTo run the microservice on the OKD cluster, you need to push the microservice image into a container image registry.\nYou will use the OpenShift integrated container image registry called OpenShift Container Registry (OCR).\nFirst, you must authenticate your Docker client to your OCR. Start by running the login command:\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.mac_section.linux_section]\n--\n[role=command]\n```\necho $(oc whoami -t) | docker login -u developer --password-stdin $(oc registry info)\n```\n--\n\n[.tab_content.windows_section]\n--\nBecause the Windows command prompt doesn’t support the command substitution that is displayed for Mac and Linux, run the following commands: \n[role=command]\n```\noc whoami\noc whoami -t\noc registry info\n```\n\nReplace the square brackets in the following `docker login` command with the results from the previous commands:\n[role=command]\n```\ndocker login -u [oc whoami] -p [oc whoami -t] [oc registry info]\n```\n--\n\nNow you must tag and push your `system` microservice to the internal registry so that it is accessible for deployment.\nRun the following command to tag your microservice:\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.mac_section.linux_section]\n--\n[role=command]\n```\ndocker tag system $(oc registry info)/$(oc project -q)/system\n```\n--\n\n[.tab_content.windows_section]\n--\nRun the following commands:  \n[role=command]\n```\noc registry info\noc project -q\n```\n\nReplace the square brackets in the following `docker tag` command with the results from the previous commands:\n[role=command]\n```\ndocker tag system [oc registry info]/[oc project -q]/system\n```\n--\n\nYour newly tagged image should appear in the list of all Docker images:\n\n[role=no_copy]\n----\nREPOSITORY                             TAG                 IMAGE ID            CREATED             SIZE\nsystem                                 latest              e8a8393e9364        2 minutes ago       399MB\n172.30.1.1:5000/my-project/system      latest              e8a8393e9364        2 minutes ago       399MB\n----\n\nNow push your newly tagged image to the internal registry by running the following command:\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.mac_section.linux_section]\n--\n[role=command]\n```\ndocker push $(oc registry info)/$(oc project -q)/system\n```\n--\n\n[.tab_content.windows_section]\n--\nRun the following commands:\n[role=command]\n```\noc registry info\noc project -q\n```\n\nReplace the square brackets in the following `docker push` command with the results from the previous commands:\n[role=command]\n```\ndocker push [oc registry info]/[oc project -q]/system\n```\n--\n\nThe microservice is now ready for deployment.\n\n== Deploying the system microservice\n\nNow that the `system` Docker image is built, deploy it using a resource configuration file.\nSince OKD is built on top of Kubernetes, it supports the same concepts and deployment strategies.\nThe OpenShift `oc` CLI tool supports most of the same commands as the Kubernetes `kubectl` tool.\nTo learn more about Kubernetes and resource configuration files,\ncheck out the https://openliberty.io/guides/kubernetes-intro.html[Deploying microservices to Kubernetes^] guide.\n\nThe provided [hotspot file=0]`deploy.yaml` configuration file outlines a [hotspot=deployment file=0]`deployment`\nresource that creates and deploys a container named [hotspot=container file=0]`system-container`.\nThis container will run the Docker-formatted image provided in the [hotspot=image file=0]`image` field.\nThe [hotspot=image file=0]`image` field should point to your newly pushed image. \n\n//file 0\ndeploy.yaml\n[source, yaml, linenums, role='code_column hide_tags=everythingButSystemDeployment']\n----\ninclude::finish/deploy.yaml[]\n----\n\nRun the following command to view the image stream:\n\n[role=command]\n```\noc get imagestream\n```\n\nYou should find your newly pushed image:\n\n[role=no_copy]\n----\nNAME      DOCKER REPO                         TAGS      UPDATED\nsystem    172.30.1.1:5000/my-project/system   latest    5 minutes ago\n----\n\nThe OpenShift image stream displays all the Docker-formatted container images that are pushed to the internal registry.\nYou can configure builds and deployments to trigger when an image is updated.\n\n[role=\"code_command hotspot file=0\", subs=\"quotes\"]\n----\n#Update the `deploy.yaml` file in the `start` directory.#\n`deploy.yaml`\n----\n[role=\"edit_command_text\"]\nThe system [hotspot=image file=0]`image` field specifies the name and tag of the container image that you want to use for the system container. Update the \nvalue of the system [hotspot=image file=0]`image` field to specify the image location found in the `DOCKER REPO` column from the output of the \nfollowing command:\n\n[role=command]\n```\noc get imagestream\n```\n\nAfter you update the value of the system [hotspot=image file=0]`image` field,\nrun the following command to apply the configuration file and create your OpenShift resource:\n\n[role=command]\n```\noc apply -f deploy.yaml\n```\n\nYou get an output similar to the following example:\n\n[role=no_copy]\n----\ndeployment.apps/system-deployment created\n----\n\nRun the following command to view your pods:\n\n[role=command]\n```\noc get pods\n```\n\nEnsure that your `system-deployment` pod is `Running`:\n\n[role=no_copy]\n----\nNAME                                 READY     STATUS    RESTARTS   AGE\nsystem-deployment-768f95cf8f-fnjjj   1/1       Running   0          5m\n----\n\nRun the following command to get more details on your pod:\n\n[role=command]\n```\noc describe pod system-deployment\n```\n\nThe pod description includes an events log, which is useful in debugging any issues that might arise.\nThe log is formatted similar to the following example:\n\n[role=no_copy]\n----\nEvents:\n  Type    Reason     Age   From                Message\n  ----    ------     ----  ----                -------\n  Normal  Scheduled  1d    default-scheduler   Successfully assigned my-project/system-deployment-768f95cf8f-fnjjj to localhost\n  Normal  Pulling    1d    kubelet, localhost  pulling image \"172.30.1.1:5000/my-project/system\"\n  Normal  Pulled     1d    kubelet, localhost  Successfully pulled image \"172.30.1.1:5000/my-project/system\"\n  Normal  Created    1d    kubelet, localhost  Created container\n  Normal  Started    1d    kubelet, localhost  Started container\n----\n\nThe container is deployed successfully, but it's isolated and cannot be accessed for requests.\nA service needs to be created to expose your deployment so that you can make requests to your container.\nYou also must expose the service by using a route so that external users can access the microservice through a hostname.\nUpdate your [hotspot file=1]`deploy.yaml` file to include service and route resources. \n\n\n[role='code_command hotspot file=1', subs=\"quotes\"]\n----\n#Update the `deploy.yaml` file in the `start` directory.#\n`deploy.yaml`\n----\n[role=\"edit_command_text\"]\nUpdate the configuration file to include the [hotspot=systemService file=1]`service` and [hotspot=systemRoute file=1]`route` resources.\n\n\n//file 1\ndeploy.yaml\n[source, yaml, linenums, role='code_column hide_tags=inventoryResources']\n----\ninclude::finish/deploy.yaml[]\n----\n\n\nTo update your resources, run the following command:\n\n[role=command]\n```\noc apply -f deploy.yaml\n```\n\nNotice that the cluster only picks up changes, and doesn't tear down and rebuild the deployment if it hasn't changed:\n\n[role=no_copy]\n----\ndeployment.apps/system-deployment unchanged\nservice/system-service created\nroute/system-route created\n----\n\nYou can view all of your routes by running the following command:\n\n[role=command]\n```\noc get routes\n```\n\nYou get an output similar to the following example:\n\n[role=no_copy]\n----\nNAME             HOST/PORT                                         PATH      SERVICES         PORT      TERMINATION   WILDCARD\nsystem-route     system-route-my-project.192.168.99.103.nip.io               system-service   \u003call\u003e                   None\n----\n\nAccess your microservice through the hostname provided in the output, \nby going to the `http://[hostname]/system/properties` URL, or running the following command.\nIn the following command, replace `[hostname]` with the hostname provided by the `oc get routes` command.\n\n[role=command]\n```\ncurl http://[hostname]/system/properties\n```\n\n// *********************************************************************************************\n\n== Deploying the inventory microservice\n\n//file 0\ndeploy.yaml\n[source, yaml, linenums, role=\"code_column\"]\n----\ninclude::finish/deploy.yaml[]\n----\n\nNow that the `system` microservice is running, you will package and deploy the `inventory` microservice,\nwhich adds the properties from the `system` microservice to the `inventory`.\nThis process demonstrates how to establish communication between pods inside a cluster.\n\n=== Building the microservice\n\nIn the `start` directory, run the following command to package the `inventory` microservice:\n\n[role=command]\n```\nmvn -pl inventory package\n```\n\n=== Containerizing the microservice\n\nRun the following command to use the `inventory` Dockerfile to create an image:\n\n[role=command]\n```\ndocker build -t inventory inventory/\n```\n\nNext, tag and push the image to the internal registry.\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.mac_section.linux_section]\n--\nRun the following command to tag your microservice:\n[role=command]\n```\ndocker tag inventory $(oc registry info)/$(oc project -q)/inventory\n```\n\nNow push your newly tagged image to the internal registry by running the following command:\n[role=command]\n```\ndocker push $(oc registry info)/$(oc project -q)/inventory\n```\n--\n\n[.tab_content.windows_section]\n--\nRun the following commands:\n[role=command]\n```\noc registry info\noc project -q\n```\n\nReplace the square brackets in the following command with the results from the previous commands to tag your microservice:\n[role=command]\n```\ndocker tag inventory [oc registry info]/[oc project -q]/inventory\n```\n\nRun the following command to push your microservice, ensuring to replace the square brackets:\n[role=command]\n```\ndocker push [oc registry info]/[oc project -q]/inventory\n```\n--\n\nThe microservice is now ready for deployment.\n\n=== Deploying the microservice\n\nYou can use the same [hotspot file=0]`deploy.yaml` configuration file to deploy multiple microservices.\nUpdate the configuration file to include the deployment, service, and route resources for your `inventory` microservice.\n\n[role=\"code_command hotspot file=0\", subs=\"quotes\"]\n----\n#Update the `deploy.yaml` file in the `start` directory.#\n`deploy.yaml`\n----\n[role=\"edit_command_text\"]\nUpdate the configuration file to add the [hotspot=inventoryResources file=0]`inventory` resources.\nMake sure to update the inventory [hotspot=inventoryImage file=0]`image` field with the appropriate\nimage link found in the `DOCKER REPO` column from the output of the following command:\n\n[role=command]\n```\noc get imagestream\n```\n\nNow run the following command to allow the cluster to pick up the new changes:\n\n[role=command]\n```\noc apply -f deploy.yaml\n```\n\nRun the following command to get the hostname of the newly exposed `inventory` service:\n\n[role=command]\n```\noc get route inventory-route\n```\n\nYou get an output similar to the following example:\n\n[role=no_copy]\n----\nNAME              HOST/PORT                                    PATH      SERVICES            PORT      TERMINATION   WILDCARD\ninventory-route   inventory-route-myproject.127.0.0.1.nip.io             inventory-service   \u003call\u003e                   None\n----\n\nGo to the following `http://[hostname]/inventory/systems` URL or run the following `curl` command to view the current inventory.\nIn the `curl` command, replace the `[hostname]` with your appropriate hostname:\n\n[role=command]\n```\ncurl http://[hostname]/inventory/systems\n```\n\nYou see a JSON response like the following example.\nYour JSON response might not be formatted.\nThe sample output was formatted for readability:\n\n[role=no_copy]\n----\n{\n    \"systems\": [],\n    \"total\": 0\n}\n----\n\nSince this is a fresh deployment, there are no saved systems in the inventory. Go to the `http://[hostname]/inventory/systems/system-service` URL or run \nthe following command to allow the `inventory` microservice to access the `system` microservice and save the `system` result in the `inventory`:\n\n[role=command]\n```\ncurl http://[hostname]/inventory/systems/system-service\n```\n\nYou receive your JVM system properties as a response.\nGo to the following `http://[hostname]/inventory/systems` URL or run the following command to recheck the inventory:\n\n[role=command]\n```\ncurl http://[hostname]/inventory/systems\n```\n\nYou see the following response:\n\n[role=no_copy]\n----\n{\n    \"systems\": [\n        {\n            \"hostname\": \"system-service\",\n            \"properties\": {\n                \"os.name\": \"Linux\",\n                \"user.name\": \"unknown\"\n            }\n        }\n    ],\n    \"total\": 1\n}\n----\n\nNotice that the system count incremented by 1 and provided a list of a few key fields that are retrieved from the system response.\n\n== Testing the microservices\n\npom.xml\n[source, xml, linenums, role='code_column']\n----\ninclude::finish/inventory/pom.xml[]\n----\n\nA few tests are included for you to test the basic functions of the microservices.\nIf a test failure occurs, then you might have introduced a bug into the code.\nTo run the tests, wait for all pods to be in the ready state before you proceed further.\nThe default parameters that are defined in the [hotspot file=0]`pom.xml` file are:\n\n[cols=\"15, 100\", options=\"header\"]\n|===\n| *Parameter*                                           | *Description*\n| [hotspot=systemIP]`system.ip`                         | IP or hostname of the `system-service` Kubernetes Service\n| [hotspot=inventoryIP]`inventory.ip`                   | IP or hostname of the `inventory-service` Kubernetes Service\n|===\n\nUse the following command to run the integration tests against your running cluster:\n\ninclude::{common-includes}/os-tabs.adoc[]\n[.tab_content.windows_section]\n--\nRun the following command, noting the values of the `system` and `inventory` route hostnames:\n\n[role=command]\n```\noc get routes\n```\n\nSubstitute `[system-route-hostname]` and `[inventory-route-hostname]` with the appropriate values and run the following command:\n\n[role=command]\n```\nmvn verify -Ddockerfile.skip=true -Dsystem.ip=[system-route-hostname] -Dinventory.ip=[inventory-route-hostname]\n```\n--\n[.tab_content.mac_section.linux_section]\n--\n[role=command]\n```\nmvn verify -Ddockerfile.skip=true \\\n-Dsystem.ip=$(oc get route system-route -o=jsonpath='{.spec.host}') \\\n-Dinventory.ip=$(oc get route inventory-route -o=jsonpath='{.spec.host}')\n```\n--\n\n* The `dockerfile.skip` parameter is set to `true` to skip building a new container image.\n* The `system.ip` parameter is replaced with the appropriate hostname to access your system microservice.\n* The `inventory.ip` parameter is replaced with the appropriate hostname to access your inventory microservice.\n\nIf the tests pass, you see an output for each service similar to the following example:\n\n[source, role=\"no_copy\"]\n----\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning it.io.openliberty.guides.system.SystemEndpointIT\nTests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.673 sec - in it.io.openliberty.guides.system.SystemEndpointIT\n\nResults:\n\nTests run: 2, Failures: 0, Errors: 0, Skipped: 0\n----\n\n[source, role=\"no_copy\"]\n----\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning it.io.openliberty.guides.inventory.InventoryEndpointIT\nTests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 2.222 sec - in it.io.openliberty.guides.inventory.InventoryEndpointIT\n\nResults:\n\nTests run: 4, Failures: 0, Errors: 0, Skipped: 0\n----\n\n== Tearing down the environment\n\nWhen you no longer need your deployed microservices, you can use the same configuration file to delete them.\nRun the following command to delete your deployments, systems, and routes:\n\n[role=command]\n```\noc delete -f deploy.yaml\n```\n\nTo completely delete your Minishift VM, cluster, and all associated files, refer to the official \nhttps://docs.okd.io/latest/minishift/getting-started/uninstalling.html[Uninstalling Minishift^] documentation.\n\nTo revert back to your default Docker settings, simply close your command-line session.\n\n== Great work! You're done!\n\nYou just deployed two microservices running in Open Liberty to an OKD cluster using the `oc` tool.\n\n// Multipane\ninclude::{common-includes}/attribution.adoc[subs=\"attributes\"]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenliberty%2Fguide-okd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenliberty%2Fguide-okd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenliberty%2Fguide-okd/lists"}