The response to Stan’s Robot Shop, Instana's sample containerized microservice application, has been fantastic – and when we wrote a primer on deploying Instana’s sample microservice application on Kubernetes, users ate it up.
So let’s talk OpenShift. If you didn’t catch our blog about managing OpenShift application performance with Instana, it’s worth a read.
As a Prime Red Hat partner, Instana has published several informational blog posts, including a discussion on Red Hat OpenShift basics and publishing a sample microservices application called Stan’s Robot Shop. This article outlines the steps for deploying the Robot Shop sample microservice application on OpenShift.
OpenShift Prerequisites for Microservices
Red Hat offers OpenShift as a managed container service, but this exercise uses minishift, which allows you to run a small OpenShift cluster on your laptop. I run minishift with Virtualbox, but other options are available. To see the performance results, you will also need an Instana account (if you don’t have one, you can sign up for a free Instana trial).
Installing Your Sample Microservices Application on OpenShift
To start you will need Stan’s Robot Shop code:
$ git clone https://github.com/instana/robot-shop
If you don’t have git installed, simply go to the Stan’s Robot Shop repository and select the download link on the top right of the page to get a zip file of the code.
Fire up minishift and open its console so you can see what is going on.
$ minishift start --vm-driver virtualbox
$ minishift console
This will start a small OpenShift cluster with 2 CPU and 2GB of memory, which is plenty to run Stan’s Robot Shop. Login to the console with the account “developer” using anything except blank for the password – no check is performed. In a different browser tab, open your Instana dashboard Infrastructure Map.
Since OpenShift is built on Kubernetes, we could just use the regular kubectl commands, but this would miss out on the extra automation features of OpenShift. The OpenShift equivalent of kubectl is oc, set this up:
$ eval $(minishift oc-env)
Next, we install the Instana agent on the cluster. You will find helper scripts under the OpenShift directory of the code you previously downloaded. Before running the script, edit the instana-agent-os.yaml
file and set secret key to base64 encoded agent key. You will find the agent key under Management Portal, accessible from the drop down menu at the top right of your Instana dashboard. The Agent Key is displayed after selecting Agent Key on the Management Portal home page.
$ echo -n "your agent key" | base64
$ cd OpenShift
$ ./agent-deploy.sh
The “instana-agent” project is created on the OpenShift dashboard and after a minute or two you will see your OpenShift cluster appear on the Instana dashboard.
The Instana agent has already discovered some containers running on the minishift virtual host, these are OpenShift, Docker registry and HA-Proxy. Congratulations you now have a running OpenShift environment fully monitored by Instana, you are on your way to microservice nirvana.
OpenShift has its own Docker registry that is used to stage images before they are deployed as applications. A Docker image is imported into this registry then a deployment or application is made from this image. By linking the two together updating the image in the local OpenShift registry automatically updates the deployment or application. The script used to deploy Stan’s Robot Shop uses this method of automation.
$ ./deploy.sh
After running this script, the robot-shop project will appear in the OpenShift dashboard. Drill into this project, Applications -> Pods, here you will be able to watch the Pods being created and started, it will take a few minutes to complete.
Once all the Pods are running, goto Applications -> Services and select the web service. To make this service externally available change the type from ClusterIP to NodePort and define the port as 30080. Select Actions drop down at the top right then select Edit YAML.
Stan’s Robot Shop is now available on port 30080 of the minishift IP address
$ minishift ip
Navigate to http://
Now you can click about and generate some load. Meanwhile over on the Instana dashboard, the agent will have automatically discovered all those new containers and started monitoring them.
As you generate some load every request is traced end to end and the service map is automatically built.
Monitoring Your Sample Microservice Application on OpenShift
Monitoring OpenShift with Instana is very easy.
You have reached microservice monitoring Guru status and achieved a Zen like inner peace not having to worry about how your application is performing. What are you going to do with all the time you have just got back?
In future posts I will cover End User Monitoring, application troubleshooting and other container orchestration systems. Stay tuned.
Sobre o autor
Mais como este
Navegue por canal
Automação
Últimas novidades em automação de TI para empresas de tecnologia, equipes e ambientes
Inteligência artificial
Descubra as atualizações nas plataformas que proporcionam aos clientes executar suas cargas de trabalho de IA em qualquer ambiente
Nuvem híbrida aberta
Veja como construímos um futuro mais flexível com a nuvem híbrida
Segurança
Veja as últimas novidades sobre como reduzimos riscos em ambientes e tecnologias
Edge computing
Saiba quais são as atualizações nas plataformas que simplificam as operações na borda
Infraestrutura
Saiba o que há de mais recente na plataforma Linux empresarial líder mundial
Aplicações
Conheça nossas soluções desenvolvidas para ajudar você a superar os desafios mais complexos de aplicações
Programas originais
Veja as histórias divertidas de criadores e líderes em tecnologia empresarial
Produtos
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Red Hat Cloud Services
- Veja todos os produtos
Ferramentas
- Treinamento e certificação
- Minha conta
- Suporte ao cliente
- Recursos para desenvolvedores
- Encontre um parceiro
- Red Hat Ecosystem Catalog
- Calculadora de valor Red Hat
- Documentação
Experimente, compre, venda
Comunicação
- Contate o setor de vendas
- Fale com o Atendimento ao Cliente
- Contate o setor de treinamento
- Redes sociais
Sobre a Red Hat
A Red Hat é a líder mundial em soluções empresariais open source como Linux, nuvem, containers e Kubernetes. Fornecemos soluções robustas que facilitam o trabalho em diversas plataformas e ambientes, do datacenter principal até a borda da rede.
Selecione um idioma
Red Hat legal and privacy links
- Sobre a Red Hat
- Oportunidades de emprego
- Eventos
- Escritórios
- Fale com a Red Hat
- Blog da Red Hat
- Diversidade, equidade e inclusão
- Cool Stuff Store
- Red Hat Summit