If you’re starting from a repository with just a Dockerfile, mogenius has a pipeline starter for Github actions that seamlessly deploys your application to Kubernetes. This is the worklow that the pipeline starter creates:

  1. The container image is built based on the Dockerfile in your repository.
  2. The image is pushed to your container registry.
  3. The mogenius operator is receives an API call to trigger the deployment.
  4. A deployment is created on Kubernetes.
  5. The new image from your Github actions workflow is set.
  6. Which each commit to your repository, the workflow is automatically triggered again.

To deploy a container with the pipeline starter, go to your workspace dashboard.
Click Add resource and select Pipeline starter from the list.

Connect your Github account

First, you’ll be asked to set up the Github integration for the pipeline starter. After logging in with Github, select the Github organization, user, and repository permissions that you want to use. This will create an application in your Github account that manages the mogenius integration.

General settings

After the integration is set up you’ll define basic settings for the application you want to deploy:

  • Name: The name of the deployment. This can’t be changed later.
  • Kind: By default this is set to deployment. You can change it to DaemonSet or StatefulSet.
  • Namespace: The namespace where your workload should run.
  • Git repository: The repository of your application. The pipeline starter will be pushed to this repository.
  • Branch: The branch that should be used for the pipeline.
  • Dockerfile path: The location and name of your Dockerfile in the repository. By default this is set to root.
  • Docker context: The context that should be used during Docker build.

API Key

At the end of the workflow, the pipeline starter will trigger the mogenius operator to deploy the new image. This requires a workspace API key. If you stored an existing API key in a vault that you want to use, you can copy and paste it. If you want to use a new API key, create it with the button below the form field.

Container registry credentials

You’ll need to provide credentials to access the container registry when pushing the image and pulling it from Kubernetes later. If an ImagePullSecret exists on your cluster, you can select it from the dropdown menu to use the credentials that were stored there.

Next, enter the credentials to authenticate with your container registry. Enter user, registry URLs, and access token in the respective form fields. The access token requires read and write access to your registry in order to push and pull images.

If you’re creating a new ImagePullSecret, enter a name for the secret. You’ll see a preview of the dockerconfigjson below. This will be base64 encoded and used in the ImagePullSecret. You can also modify the content of the dockerconfigjson in the preview manually.

Deploy the pipeline starter

Click Create to deploy the pipeline starter. This will push the pipeline starter to your repository and trigger the new worklow to build your image. The deployment will happen automatically and you should see your Pod restarting soon, pulling the new image. Please note, that while the initial workflow is running, it is normal that you Pod isn’t starting. As soon as the image is ready, Kubernetes will pull it automatically.

With the Git integration, you can follow the progress of the Github actions workflow in mogenius.