Skip to main content

Deploy your first app

This tutorial walks you through the deployment of your first app.

Prerequisites#

You need some tools on your machine in order to use Kubernetes.

Register a Namespace#

Apps are deployed to a namespace within a cluster.

  • Open https://cloud.mayope.net/ and login with your email and set password.
  • Click on Namespace in the left sidebar and enter a name e.g. my-namespace on the bottom form.
  • Click on Request Namespace. A new line appears in the namespace list above. The namespace's state is initially SETUP. It will change to ONLINE once the setup is done. If it stays on DIRTY after 10 minutes, please submit a ticket.

Access your Kubernetes namespace#

  • Open https://cloud.mayope.net/ and login with your email and password.
  • Click on Namespace in the left sidebar.
  • Look for your created namespace and click on kubeconfig in the action column.
  • Copy the KubeConfig string from popup window.
  • Create the file ~/.kube/config and paste the copied string in it.
  • Open a console and type kubectl get pods.
  • You should see something like:
No resources found in my-namespace-5fd09b14-02ab-427f-9b7d-8e16fe8eebc7 namespace.

Request your Docker Registry#

You can request a private docker registry.

  1. Log into https://cloud.mayope.net.
  2. Click on the Docker Registry menu option.
  3. Enter your registry size and click on Request Docker Registry.
  4. The requested registry should become online in a couple of minutes.
  5. As soon as your registry is online, click on your created registry.
  6. Copy host, username and password from the Docker Registry detail view into following command and execute it in a console: docker login <host> --username <username> --password <password>

Deploy your first Web App#

Let's deploy an example app. You get an autogenerated domain, if none host is specified in your ingress.

  • Open a console and clone our example app: https://github.com/mayope/hello-kubernetes.git
  • Find out the host name of your registry: kubectl get ingress docker-registry
  • Change the registry host name in following file of the cloned repository:
    • hello-kubernetes/build.gradle.kts: Line 8
      Ensure, you only replace the host only and not the rest of the url.
  • Change directory: cd hello-kubernetes
  • Run: .\gradlew deploy
  • Get the host name of your app: kubectl get ingress hello
  • Your host name should look like ingress-1a8766c2-8c7a-4371-99d7-c3d65a535d28.dyn.mayope.net.
  • Open https://<HOST> in you web browser.
  • You should see: Hello Kubernetes !