Skip to main content
In this walkthrough, you’ll connect your Kubernetes deployment to Docker Hub and automate updates via Flux GitOps. We’ll cover:
  1. Logging in to Docker Hub
  2. Pulling an existing image
  3. Retagging and pushing to your account
  4. Updating the Kubernetes Deployment manifest
  5. Deploying via Flux
  6. Verifying the live application

Prerequisites

The image shows a Docker login page where a user is prompted to enter their username or email address to continue to Docker Hub.

1. Log in to Docker Hub

First, clear any existing sessions and then authenticate:
For security, use a Docker Hub access token instead of your account password.

2. Pull the Base Image

Fetch the pre-built Block Buster image from the original repository:

3. Retag and Push to Your Docker Hub

Tag the image under your own namespace and push:
Replace <your-username> consistently. Never commit credentials or tokens into Git repositories.
After a successful push, confirm that the bb-app-flex-demo repository with tag 7.8.0 appears in your Docker Hub account.

4. Update the Kubernetes Deployment Manifest

Switch to the 8-demo branch and edit the deployment to reference your image:
Open deployment.yaml and update the container image:
Commit and push your change:

5. Deploy with Flux

In your Flux cluster repository, create a GitRepository source and Kustomization:
Trigger an immediate reconciliation and verify:

6. Verify the Application

Point your browser to the NodePort (e.g., localhost:30008) and confirm the high score persistence in version 7.8.0:
The image shows a screenshot of a block-breaking game called "Block Buster" with a "Game Over" message. The game interface includes colorful blocks, a paddle, and a ball, along with game information like score and lives.

You’ve now integrated Docker Hub with Kubernetes and automated your deployment using Flux GitOps. Next up: creating a FluxRepository to track image updates and automate version bumps.

Watch Video