
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
This guide provides a complete command-line walkthrough for setting up an Azure Kubernetes Cluster with Cloud Native Operations 2.0 Discovery. It includes instructions for installing the Hipstershop sample application, which is optional. This Kubernetes Informer based discovery method provides a cloud native way of near real time discovery and should be applied as a new Kubernetes cluster gets created. Hereby enabling security, governance and event management use cases.
The commands have been tested on an Azure-based VM running Red Hat 9 Linux OS.
Prerequisites:
- azure cli - https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=dnf
- git ( sudo yum install git -y)
- kubectl - https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/
- helm (see below)
Pick a resourcegroup, cluster and locations as per your own need.
Commands:
az login
az group create --name RLk8sRG --location eastus
az aks create --resource-group RLk8sRG --name RLAKSCluster --node-count 1 --enable-addons monitoring --node-vm-size Standard_DS3_v2 --generate-ssh-keys
az aks get-credentials --resource-group RLk8sRG --name RLAKSCluster
kubectl get nodes
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
sudo chmod 777 /usr/local/bin/helm
git clone https://github.com/yuxiaoba/Hipster-Shop.git
cd Hipster-Shop
kubectl create namespace hipster-shop
kubectl apply -f ./release/kubernetes-manifests.yaml --namespace hipster-shop
kubectl get pods --namespace hipster-shop
kubectl get svc frontend-external --namespace hipster-shop
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend-external LoadBalancer 10.0.123.123 1.156.177.247 80:32752/TCP 17h
Create a new user:
Now create a new namespace, enter the servicenow user credentials as secrets and use helm to deploy the CNO 2.0 k8s-informer deployment.
kubectl create namespace cno20
kubectl create secret generic k8s-informer-SERVICNENOWINSTANCE --from-literal=.user=USERNAME --from-literal=.password="password-set-in-servicenow-instance" -n cno20
helm install -n cno20 --set acceptEula=Y --set instance.name=SERVICNENOWINSTANCE --set clusterName="RLk8sRG" k8s-informer https://install.service-now.com/glide/distribution/builds/package/informer/2.1.1/informer-helm-2.1.1...
Will start showing
kubectl logs -f deployment/k8s-informer-INSTANCENAME.service-now.com --namespace cno20
helm status k8s-informer --namespace cno20
helm get all k8s-informer --namespace cno20
export POD_NAME=$(kubectl get pods --namespace cno20 -l "app=k8s_informer-INSTANCENAME.service-now.com" -o jsonpath="{.items[0].metadata.name}")
kubectl get pod $POD_NAME --namespace cno20
az aks list --output table
az aks nodepool add --resource-group RLk8sRG --cluster-name RLAKSCluster --name nodepool2 --node-count 1 --node-vm-size Standard_DS3_v2
kubectl get nodes
kubectl cordon aks-nodepool1-26034126-vmss000000
kubectl drain aks-nodepool1-26034126-vmss000000 --ignore-daemonsets --delete-local-data
az aks nodepool delete --resource-group RLk8sRG --cluster-name RLAKSCluster --name aks-nodepool1-26034126-vmss000000
helm uninstall k8s-informer -n cno20
kubectl get secrets --all-namespaces
kubectl delete secret k8s-informer-cred-INSTANCENAME -n cno20
- 3,212 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.