Nutanix Cloud Native and Calm: Better Together!

Calm Data Model Blog 1 Pictures

Table of Contents

Written by Michael Haigh, Technical Marketing Engineer at Nutanix

Previously we covered how easy it is for developers and administrators to deploy an application onto Nutanix Cloud Native due to its adherence to open API standards.  We deployed an Oscar e-commerce site, backing it with containers running on Nutanix Karbon, a PostgreSQL database cloned by Nutanix Era, and the static image content stored on Nutanix Buckets.

Nutanix Calm and Nutanix Cloud Native

Today, we’re going automate this entire deployment in Nutanix Calm.  Calm models applications end-to-end using blueprints, allowing you to deploy those applications across clouds and automate their entire lifecycle from creation to deletion, including rolling updates during the application’s lifecycle.  Blueprints can also be published to the Nutanix Markeplace – Calm’s built in self service portal – giving different users and groups direct access to resources without losing control over policy. If you’d like to learn more about Calm, please check out our datasheet here.

Prerequisite Checklist
Component RequirementsDocumentation
Nutanix Cloud Native ComponentsSee first blog post for more info
Calm Version 2.4.0Nutanix Calm Upgrade Guide
Karbon Added as a Provider in CalmNutanix Calm Administration and Operations Guide
Nutanix Cloud Native Oscar Application Deployed by Nutanix Calm

Nutanix Calm Blueprint Import

To get started, download the Nutanix Cloud Native Oscar App blueprint, either with a CLI tool like wget, or by opening the link in your browser and saving the page as a JSON file.  Navigate to Calm within your Prism Central instance, select the blueprint icon on the left, and click the “Upload Blueprint” button.

In the file browser that pops up, navigate to and select the recently downloaded blueprint.  You’ll then need to give the blueprint a name, and select your project of choice. Be sure to select a project that is tied to your Karbon Kubernetes cluster.

Nutanix Cloud Native Calm Blueprint Upload

Nutanix Calm Blueprint Customization

Next, we’ll need to make some minor modifications to the blueprint to customize it to your environment.  The only two sections that need modification are the credentials, and the application profile variables.  We’ll start with the credentials:

  • era_creds: this is the credential you would use to log in to the UI of your Era server.
  • db_server_creds: this is a private key which will allow for SSH access to the database servers that get deployed via this Calm blueprint.  To generate and output a key, run the following two commands from a Mac or Linux computer:
ssh-keygen -t rsa -f ~/calmkey -C centos@domain.com cat ~/calmkey
  • buckets_creds: this is the Nutanix Buckets endpoint credential that allows read and write access to your bucket.
  • kube_creds: this is our Karbon Kubernetes cluster credential.  Kubernetes deployments in Nutanix Calm are currently Tech Preview, and limited to Deployments, Containers, and Services. In the previous blog post we saw the django-migration.yaml create a kubernetes Job, which seeds our new database with application data. To get around this Tech Preview Calm limitation, within the blueprint we’ll be calling the kubernetes API with these credentials to create the same Job.
Calm Blueprint Credentials

Once your credentials are filled in, click the “Back” button, and fill in the following Application Profile variables, which are along the right pane of your browser.  If you’ve navigated around the blueprint on your own, and they’re no longer on the right pane, then scroll down to the “Application Profile” section of the left pane, and click on the “Default” app profile.

VariableRequires Change?Description
bucket_ipYesThe Nutanix Buckets object storage endpoint IP
buckets_nameYesThe name of the pre-created Nutanix Buckets object storage bucket
compute_profileNoThe desired Compute Profile of your Postgres DB Server
database_parameterNoThe desired Database Parameters of your Postgres DB
db_name_prefixNoPrefix for the database name (a time stamp is appended)
db_passwordYesPassword for the postgres user, set to any value you’d like
db_public _keyYesThe public key that matches the private key in “db_server_creds” which can be outputted with the following command:

 

cat ~/calmkey.pub
era_ipYesThe IP address of your Era Server
kube_namespaceYesThe Kubernetes namespace that will be used for deployment.  If you’re not familiar with adding a namespace set this to ‘default’
kubemaster_ipYesThe IP address of the Karbon Kubernetes Master node.  Can be found with the command:

 

   kubectl describe node `kubectl get nodes \
       | grep master | awk '{print $1}'` | grep InternalIP
network_profileNoThe desired Network Profile of your Postgres DB Server
sla_nameNoThe desired Time Machine SLA of the Postgres DB in Era
software_profileNoThe desired Software Profile of your Postgres DB Server
Calm Blueprint Variables

Once you’ve completed filling out the credentials and the variables, save your blueprint.  It is expected that you get yellow Warnings that start with “Macro used in value of key”, however you should not get any red Errors, or other Warnings.

Nutanix Calm Blueprint Launch

While still in the blueprint canvas, click the “Launch” button in the upper right.  On the page that appears, name your application, and optionally change any of the runtime variables that were previously set.  Click the “Create” button, and then on the Application page that you’re directed to, view the status of the deployment from the Audit tab.

Application Manage Tab

Once the deployment is complete (the application will change to a Running state), you’ll access the application in the same manner as last time, by running the following kubectl commands (be sure to substitute in the namespace that you specified via the Calm variable):

kubectl describe nodes | grep InternalIP
kubectl -n <namespace> get svc oscar-django-service
Kubectl commands

Take an IP from the first command, append the 3XXXX port number from the second command, and enter the combination in to a web browser.  You should see the same, fully functional e-commerce website as last time, except now you can manage the entire lifecycle of the application from Nutanix Calm.

Oscar Application Running on Nutanix Cloud Native

Stay tuned for our next post in this series where we’ll be doing a deep dive into how the blueprint works!

© 2024 Nutanix, Inc. All rights reserved. Nutanix, the Nutanix logo and all Nutanix product, feature and service names mentioned herein are registered trademarks or trademarks of Nutanix, Inc. in the United States and other countries. Other brand names mentioned herein are for identification purposes only and may be the trademarks of their respective holder(s). This post may contain links to external websites that are not part of Nutanix.com. Nutanix does not control these sites and disclaims all responsibility for the content or accuracy of any external site. Our decision to link to an external site should not be considered an endorsement of any content on such a site. Certain information contained in this post may relate to or be based on studies, publications, surveys and other data obtained from third-party sources and our own internal estimates and research. While we believe these third-party studies, publications, surveys and other data are reliable as of the date of this post, they have not independently verified, and we make no representation as to the adequacy, fairness, accuracy, or completeness of any information obtained from third-party sources.