Link Search Menu Expand Document

Prerequisites

Table of contents

  1. Introduction
  2. Request a ServiceNow Instance
    1. Request ServiceNow Instance
  3. Get some Accounts
    1. Get a GitHub Account
    2. Get an Azure Account
    3. Get a Docker Hub Account
  4. Setup your Workstation
    1. Install WSL Ubuntu for Windows
    2. Create SSH Keys
    3. Install Azure CLI for WSL Ubuntu
    4. Install Azure CLI for macOS
  5. Deploy Azure Kubernetes
    1. Install Azure Kubernetes with Azure CLI
    2. Configure Kubectl for Azure Kubernetes
  6. Configure your Projects
    1. Configure GitHub
    2. Configure Docker Hub
    3. Configure Azure DevOps Project
  7. Deploy Boutique
    1. Fork Boutique GitHub Repository
    2. Builld All Boutique Images
    3. Create Boutique Application namespace
    4. Deploy All Boutique Images using Helm Pipeline
    5. Check Boutique Deployment

Introduction

This site provides documentation, training, and other notes for implementing the Cloud Native Service Operations for ServiceNow Solutions. The instructions provided are geared towards developers and assume a basic level of competency and familiarity with the tools listed. Following is a list of prerequisite tools, configuration steps, and accesses needed before implementing the Cloud Native Service Operation solutions.

Request a ServiceNow Instance

Request ServiceNow Instance

ServiceNow (SN) is a leading Cloud Computing platform built to help companies manage Digital IT, Employee, Customer and Creator Workflows for the Enterprise. You will need a ServiceNow instance to implement these solutions and learn. Procedure is as follows:

NOTE: Create yourself a User Account with an Administrator admin Role

Get some Accounts

Get a GitHub Account

GitHub is the leading Source Code hosting platform for Version Control & Collaboration for your distributed teams. Cloud Native teams use Git to store both code and declarative descriptions of the infrastructure. Procedure is as follows:

  1. You probably allready have a GitHub Account, or you can sign-up for one as follows:

    • Browse to GitHub and Sign Up for your own account.

Get an Azure Account

Azure is a public cloud computing platform from Microsoft with solutions including Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) that can be used for services such as analytics, virtual computing, storage, networking, and much more. It can be used to replace or supplement your on-premise servers. Procedure is as follows:

  1. You probably allready have an Azure Account, or you can request one as follows:

    • Browse to Azure and get a Free account

Get a Docker Hub Account

Docker Hub is the leading Docker Public Registry for finding and sharing Docker Container Images with your distributed teams. Cloud Native teams use automated build proceses to push freshly built Docker Images to Docker Hub and to deploy them to Kubernetes. You will need a Docker Hub account to store your Docker Images. Procedure is as follows:

  1. You probably allready have a Docker Hub Account, or you can register for one as follows:

    • Browse to Docker Hub and Register for your own account.

Setup your Workstation

Install WSL Ubuntu for Windows

Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables (in ELF format) natively on Windows 10, Windows 11, and Windows Server 2019. For Windows environments we recommend using WSL for all Bash commands. Installation is as follows:

  1. Start a PowerShell

  2. Install WSL for Windows

     wsl --install
    

NOTE: For more detailed instructions consult the Microsoft WSL for Windows Install Docs

  1. Start a Bash Shell

Create SSH Keys

SSH (Secure Shell) keys are acces credentials that are used in the SSH protocol and are foundational to modern Infrastructure-as-a-Service platforms such as AWS, Google Cloud, and Azure. Procedure is as follows:

  1. Start a Bash Shell

  2. Create a Service Account SSH Key as follows:

     ssh-keygen -t rsa -b 4096 -C "olympus@demo.com" -f $HOME/.ssh/olympus
    

    Command prompts and output are as follows:

     Generating public/private rsa key pair
     Enter file in which to save the key (~/.ssh/olympus):
     Enter passphrase (empty for no passphrase):
     Your identification has been saved in ~/.ssh/olympus
     Your public key has been saved in ~/.ssh/olympus.pub
    
  3. Create a Personal SSH Key as follows:

     ssh-keygen -t rsa -b 4096 -C "YOUR EMAIL ADDRESS"
    

    Command prompts and output are as follows:

     Generating public/private rsa key pair
     Enter file in which to save the key (~/.ssh/id_rsa):
     Enter passphrase (empty for no passphrase):
     Your identification has been saved in ~/.ssh/id_rsa
     Your public key has been saved in ~/.ssh/id_rsa.pub
    
  4. Set SSH Permissions

     chmod -R 700 ~/.ssh
     chmod 644 ~/.ssh/authorized_keys
    
  5. Safeguard both SSH Keys

Install Azure CLI for WSL Ubuntu

The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation. If you have a Windows Workstation with WSL Ubuntu, the installation is as follows:

  1. Start a Bash Shell

  2. Get Updates

     sudo apt-get update
     sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg
    
  3. Download and install the Microsoft signing key

     curl -sL https://packages.microsoft.com/keys/microsoft.asc \
     | gpg --dearmor \
     | sudo tee /etc/apt/trusted.gpg.d/microsoft.gpg > /dev/null
    
  4. Add the Azure CLI software repository

     AZ_REPO=$(lsb_release -cs)
     echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" \
     | sudo tee /etc/apt/sources.list.d/azure-cli.list    
    
  5. Install the Azure CLI

     sudo apt-get update
     sudo apt-get install azure-cli
    

    NOTE: For more detailed instructions consult the Microsoft Azure CLL Docs for WSL on Ubuntu

  6. Test Login

     az login
    

Install Azure CLI for macOS

The Azure command-line interface (Azure CLI) is a set of commands used to create and manage Azure resources. The Azure CLI is available across Azure services and is designed to get you working quickly with Azure, with an emphasis on automation. If you have a MacOS Workstation, the installation is as follows:

  1. Start a Bash Shell

  2. Install the Azure CLI

     brew update && brew install azure-cli
    

    NOTE: For more detailed instructions consult the Microsoft Azure CLL Docs for macOS

  3. Test Login

     az login
    

Deploy Azure Kubernetes

Install Azure Kubernetes with Azure CLI

Azure Kubernetes Service (AKS) simplifies deploying a managed Kubernetes cluster in Azure by offloading the operational overhead to Azure. As a hosted Kubernetes service, Azure handles critical tasks, like health monitoring and maintenance. Installation is as follows:

  1. Start a Bash Shell

  2. Login to Azure

     az login
    
  3. Create Resource Group (See Example below)

     az group create -n "olympus" -l "eastus"
    

    NOTE: In this example we are creating a resource group called olympus and using the eastus region.

  4. Get latest AKS Versions available for your region (See Example below)

     az aks get-versions -l "eastus" -o table
    

    NOTE: We recommend avoiding preview releases for stability

  5. Deploy AKS (See Example below)

     az aks create --resource-group "olympus" --name "olympus" --node-count 4 --kubernetes-version "1.21.9" --ssh-key-value $HOME/.ssh/olympus.pub --node-vm-size "Standard_DS2_v2" --node-osdisk-size 30 --enable-managed-identity
    

    NOTE: In this example we are creating a 4 node AKS cluster called olympus in the eastus region with 30 Gig Disks with our SSH key called olympus

Configure Kubectl for Azure Kubernetes

Kubectl is a command line tool used to run commands against Kubernetes clusters. It does this by authenticating with the Master Node of your cluster and making API calls to do a variety of management actions. If you’re just getting started with Kubernetes, prepare to be spending a lot of time with kubectl. Configuration for Azure Kubernetes (AKS) is as follows:

  1. Start a Bash Shell

  2. Login to Azure

     az login
    
  3. Get AKS Credentials (See Example below)

     az aks get-credentials --resource-group olympus --name olympus --file ~/.kube/config-aks
    

    NOTE: In this example we are getting credentials in Kubectl format for our k8s cluster called olympus in the resource group olympus and saving it in the ./kube/ local folder and calling the file config-aks

  4. Configure kubectl environment variable

     export KUBECONFIG=$HOME/.kube/config-aks
    
  5. Set kubectl context for AKS (See Example below)

     kubectl config use-context olympus
    
  6. Test AKS Cluster Connection

     kubectl cluster-info
     kubectl get nodes -A
    

    Boutique Frontend

Configure your Projects

Configure GitHub

You will need a Github Personal Access Token (aka. PAT) to kickoff deployment processes from Azure DevOps Pipelines. You will also need to configure GitHub with your Personal SSH Key so you can pull code down to your workstation. Procedure is as follows:

  1. Browse to GitHub

  2. Navigate to Your Profile > Settings > Developer Settings > Personal Access Tokens

  3. Press Generate new token and enter the following:

    Field Value
    Note Any memorable string (e.g. myrepo)
    Expiration 30 days (or longer)
    Scope repo:*
  4. Safeguard your Personal Access Token

  5. Navigate to Your Profile > Settings > SSH and GPG keys

  6. Press New SSK key and enter the following:

    Field Value
    Title Any memorable string (e.g. mykey)
    Key Paste in YOUR PERSONAL SSH PUBLIC KEY
  7. Press Add SSH Key

Configure Docker Hub

You will need a Docker Hub Access Token to kickoff deployment processes from Azure DevOps Pipelines. Procedure is as follows:

  1. Browse to Docker Hub

  2. Navigate to Your Profile > Account Settings > Security

  3. Press New Access Token and enter the following:

    Field Value
    Description Any memorable string (e.g. mytoken)
    Scope Read, Write, Delete
  4. Safeguard your Access Token

Configure Azure DevOps Project

You can create connections from Azure Pipelines to external and remote services for executing tasks in a job. Your Azure DevOps Pipelines will need to connect to GitHub to retrieve source code and also connect to Kubernetes to deploy Docker images from Docker Hub. Procedure is as follows:

  1. Sign In to Azure DevOps

  2. Create a new project as follows:

    Field Value
    Project name Any memorable name (e.g. cassandra)
    Visibility Public
  3. Navigate to Project Settings > Pipelines > Service Connections

  4. Create a new service connection for GitHub as follows:

    Field Value
    Service or connection type GitHub
    Authentication method Personal Access Token
    Personal Access Token YOUR GITHUB PERSONAL ACCESS TOKEN
    Service connection name github
    Grant access permission to all pipelines True
  5. Create a new service connection for Kubernetes as follows:

    Field Value
    Service or connection type Kubernetes
    Authentication method Azure Subscription
    Azure Subscription YOUR AZURE SUBSCRIPTION ID
    Cluster YOUR AKS CLUSTER NAME (e.g. olympus)
    Namespace default
    Use cluster admin credentials True
    Service connection name olympus
    Grant access permission to all pipelines True

Deploy Boutique

Fork Boutique GitHub Repository

A fork is a copy of a repository so you can leverage someone else’s project as a starting point for your own ideas. Forking a repository allows you to freely experiment with changes without affecting the original upstream repository. We are leveraging Google’s Boutique application which we forked ourselves earlier under a new repository called cassandra where we customized it further for this site.

Boutique Architecture

Procedure is as follows:

  1. Sign In to GitHub

  2. Navigate to Import Repository and enter the following:

    Field Value
    Your old repository’s clone URL https://github.com/cloudnativenow/cassandra.git
    Your new repository owner YOUR GIT ACCOUNT
    Your new repository name Any memorable name (e.g. cassandra)
    Privacy Public

Builld All Boutique Images

The Boutique application consists of 12 Docker Images which need to be built and pushed to your Docker Hub public registry using the provided docker-publish-all Pipeline. Procedure is as follows:

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Pipelines > All and create an azure-pipelines folder, if it does not exist.

  4. Navigate to the azure-pipelines folder and press Create Pipeline

  5. For the Where is your code? prompt, select GitHub

  6. For the Select a repository prompt, select your GitHub Repository.

  7. Press Approve and Install

  8. Enter your GitHub password if prompted.

  9. At the Configure your pipeline prompt, select Existing Azure Pipelines YAML file

  10. At the Select an existing YAML file prompt, set fields as follows:

    Field Value
    Branch main
    Path /azure-pipelines/docker-publish-all.yml
  11. Press Continue to review your pipeline YAML.

  12. Create the following Pipeline Variables:

    Name Value Keep this value secret Let users override this value when running this pipeline
    REPO_USERNAME YOUR DOCKER HUB ID False True
    REPO_PAT YOUR DOCKER PAT True True
    REPO_PREFIX YOUR DOCKER HUB ID False True
  13. Using the Run Button, select Save Pipeline

  14. Rename Pipeline as follows:

    Field Value
    Name docker-publish-all
    Select folder \azure-pipelines
  15. Press Run Pipeline

  16. Review Variables and press Run

NOTE: Be patient, the pipeline takes at least 10 minutes to complete.

  1. Monitor the Pipeline and make sure it runs successfully

  2. Browse to Docker Hub to verify your images.

  3. You should see 12 new Docker Images pushed under your account.

Create Boutique Application namespace

  1. Start a Bash Shell

  2. Configure kubectl environment variable

     export KUBECONFIG=$HOME/.kube/config-aks
    
  3. Set kubectl context for AKS (See Example below)

     kubectl config use-context olympus
    
  4. Create Boutique Application namespace (e.g. cassandra)

     kubectl create ns cassandra
    

Deploy All Boutique Images using Helm Pipeline

The Boutique application consists of 12 Docker Images which need to be depoyed to your Azure Kubernetes using the provided kubernetes-deploy-all Helm Pipeline. Procedure is as follows:

  1. Sign In to Azure DevOps

  2. Select the Boutique Project (e.g. cassandra) you configured earlier.

  3. Navigate to Pipelines > All and create an azure-pipelines folder, if it does not exist.

  4. Navigate to the azure-pipelines folder and press Create Pipeline

  5. For the Where is your code? prompt, select GitHub

  6. For the Select a repository prompt, select your GitHub Repository.

  7. Press Approve and Install

  8. Enter your GitHub password if prompted.

  9. At the Configure your pipeline prompt, select Existing Azure Pipelines YAML file

  10. At the Select an existing YAML file prompt, set fields as follows:

    Field Value
    Branch main
    Path /azure-pipelines/kubernetes-deploy-all.yml
  11. Press Continue to review your pipeline YAML.

  12. Create the following Pipeline Variables:

    Name Value Keep this value secret Let users override this value when running this pipeline
    SERVICE_NAMESPACE cassandra False True
    REPO_PREFIX YOUR DOCKER HUB ID False True
  13. Using the Run Button, select Save Pipeline

  14. Rename Pipeline as follows:

    Field Value
    Name kubernetes-deploy-all
    Select folder \azure-pipelines
  15. Press Run Pipeline

  16. Review parameters and press Run

Check Boutique Deployment

After all 12 Boutique Pods have been deployed, you should check all the pod statuses. In addition, retrieve and safeguard the frontend-external service EXTERNAL-IP for your demos. Procedure is as follows:

  1. Start a Bash Shell

  2. Configure kubectl environment variable

     export KUBECONFIG=$HOME/.kube/config-aks
    
  3. Set kubectl context for AKS (See Example below)

     kubectl config use-context olympus
    
  4. Test AKS Cluster Connection

     kubectl cluster-info
     kubectl get nodes -A
    

    Boutique Frontend

  5. Retrieve the frontend-external service EXTERNAL-IP

     kubectl get service frontend-external -n cassandra
    
  6. Browse to the EXTERNAL-IP to view the Boutique Application

    Boutique Frontend