Skip to main content
In this lesson you’ll push a Docker image to Docker Hub and update Flux-managed manifests to deploy that image to a Flux-enabled Kubernetes cluster. The workflow shows how to:
  • Log in to Docker Hub
  • Pull an existing upstream image
  • Tag and push that image to your Docker Hub repository
  • Update a Kubernetes Deployment to reference the pushed image
  • Create Flux GitRepository and Kustomization objects to deploy the manifest
  • Verify the application is running and confirm the bug fix present in version 7.8.0
Quick links:

Prerequisites

Make sure to replace siddharth67 in the examples below with your own Docker Hub username wherever applicable. For improved security, prefer using a Docker access token instead of your password when running docker login.
Never commit Docker credentials or access tokens to git. Use secret management or CI/CD secret stores when automating image pushes.

1) Log in to Docker Hub

If you are authenticated to another registry, log out first, then log in to Docker Hub:
Successful login will show:

2) Pull the existing image

Pull the upstream image used as the source for this demo:
Example output (condensed):

3) Tag the image for your Docker Hub repository

Tag the pulled image to point at your Docker Hub repository and the desired image name. Replace your-username with your Docker Hub username:
Instructor example (preserves original username for clarity):

4) Push the image to Docker Hub

Push the tagged image up to your Docker Hub repository:
Example push output (condensed):
After the push completes, verify the 7.8.0 tag is visible in your Docker Hub repository UI for your-username/bb-app-flux-demo.

5) Update the deployment manifest

Edit the Deployment YAML stored in the bb-app-source repository (branch 8-demo) so the image: field points to your pushed image. This minimal example highlights the image: field to change:
Before committing, replace siddharth67 with your Docker Hub username in the image: field.

6) Publish manifests and create Flux objects

The demo uses two repositories:
  • A source repo that contains application manifests (bb-app-source branch 8-demo)
  • A Flux repo that contains Flux GitRepository and Kustomization manifests (e.g., flux-clusters)
From the flux-clusters/dev-cluster directory, create a GitRepository source and Kustomization for the 8-demo branch. The commands below use --export to save the generated objects to YAML files:
Example exported manifests: GitRepository (8-demo-source-git-bb-app.yml)
Kustomization (8-demo-kustomize-git-bb-app.yml)
Commit and push these files to the repository monitored by Flux (for example, your flux-clusters repo). To accelerate reconciliation after pushing, run:

7) Verify deployment

Confirm Flux created the 8-demo namespace and applied the manifests:
The application in this demo is exposed on a NodePort. The demo uses:
Open that URL in your browser and exercise the app. Version 7.8.0 includes a bug fix: the high score is persisted to the database.
A screenshot of a web-based game titled "BLOCK BUSTER" showing deployment info at the top (pod name, IP, namespace, node, app version) and a large dark play area with "PRESS START" in the center and a green "START GAME" button at the bottom.
In the demo, after pressing Start and ending the game quickly, a score like 1200 will be persisted and displayed in the high score field after restarting — confirming the fix in 7.8.0.

Next steps

  • Automate image updates with Flux Image Automation Controller and an ImageRepository object to fetch tags from Docker Hub automatically.
  • Integrate CI to build and push images and then let Flux detect and roll out updates.
Useful command reference: For more on Flux GitRepository and Kustomization, see the Flux documentation: https://fluxcd.io/docs/ That’s all for this demo.

Watch Video