Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Kubernetes on AWS

You're reading from   Kubernetes on AWS Deploy and manage production-ready Kubernetes clusters on AWS

Arrow left icon
Product type Paperback
Published in Nov 2018
Publisher Packt
ISBN-13 9781788390071
Length 270 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Ed Robinson Ed Robinson
Author Profile Icon Ed Robinson
Ed Robinson
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Google's Infrastructure for the Rest of Us FREE CHAPTER 2. Start Your Engines 3. Reach for the Cloud 4. Managing Change in Your Applications 5. Managing Complex Applications with Helm 6. Planning for Production 7. A Production-Ready Cluster 8. Sorry My App Ate the Cluster 9. Storing State 10. Managing Container Images 11. Other Books You May Enjoy

Building and launching a simple application on Minikube

Let's take our first steps to building a simple application on our local minikube cluster and getting it to run.

The first thing we need to do is build a container image for our application. The simplest way to do this is to create a Dockerfile and use the docker build command.

Use your favorite text editor to create a file called Dockerfile with the following content:

Dockerfile 
FROM nginx:alpine 
RUN echo "<h1>Hello World</h1>" > /usr/share/nginx/html/index.html 

To build the application, first ensure your Docker client is pointing to the Docker instance inside the Minikube VM by running:

    eval $(minikube docker-env)

Then use Docker to build the image. In this case, we are tagging the image hello, but you could use any tag you wanted:

    docker build -t hello:v1 .

Kubectl has a run command...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image