Deploying Your Application to Critical Stack

This tutorial will walk you through deploying your application to Critical Stack through the UI and making it accessible via a public URL.

Getting Started

Before we get started, you’ll need:

  1. Access to a public container registry (Docker Hub is easiest, Artifactory works too) : Docker Hub
  2. A Critical Stack deployment with a master node and at least 1 worker node. Worker nodes are needed to expose your application externally with a Load Balancer.
  3. A user account provisioned for you. Make sure to take note of your namespace when you log in.

Deploying Your Application

  1. Login to Critical Stack. Under Data Center > Workloads select Deployments. Create a Simple Deployment in Critical Stack. Call the app name whatever you like (in this example I used my-first-deployment). Next, point to the tagged Docker image recently pushed into the image registry (docker.io/<your-user-name>/hello-go:0.0.1). Leave the rest of the inputs at their defaults:

    simple deployment

  2. Under Data Center > Workloads select Deployments and confirm that the deployment created in the previous step is Available (a non-zero number is visible in the Available column).

    available

  3. Under Data Center > Services and Discovery select Services. Create a Simple Service in Critical Stack.

    1. Call the service name whatever you like (in this example I used my-first-deployment-svc).
    2. Match the Selector name to the app/pod name which was deployed in the previous step.
    3. Select Load Balancer as the option for Mode
    4. Call the listener name whatever you like but something unique relative to the service name (in this example I used my-first-deployment-listener).
    5. Select TCP as the protocol
    6. Under the Port field, enter the desired port which will be used by the Load Balancer connecting the app to the “live” public internet (typically port 80).
    7. Under the Target Port field, enter the port number supported by your app and exposed in your Dockerfile (in this example, port 3000)
    create service
  4. Under Data Center > Services and Discovery select Endpoints, confirm that the service created has the just created listener configured to the port supported by the app and exposed in the Dockerfile (in this example, port 3000).

    get dynamic port
  5. Under Data Center > Services and Discovery select Services, check the service listing and note the dynamic port and the DNS Name which was assigned to it. In this example it is port 32151 (but your port number and DNS Name will likely be different). Copy this DNS value as it is the auto-generated, publicly facing domain name.

    Note it may take a few minutes for the Load Balancer to be created and for the DNS Name to be available.

    confirm endpoint
  6. Paste the DNS value copied from the previous step into a browser. This confirms that the app we have deployed onto our Critical Stack cluster is fully live and available to the public internet.

    go to public URL

Conclusion

We pulled a Docker image into a Critical Stack deployment as a container instance, and accessed the application via a public URL.