Git Product home page Git Product logo

elk-acs-kubernetes's Introduction

Deploy Elastic Stack on Kubernetes in Azure Container Service (ACS)

Deploy to Azure

This repository contains tools and helm charts to help deploy the Elastck stack on Kubernetes in Azure Container Service (ACS).

How the solution works

  • Deploy a Kubernetes cluster on Azure.
  • Deploy a Virtual Machine served as the Controller Node to manage and configure Kubernetes cluster on Azure.
  • Register Controller Node's FQDN as the entry to Kubernetes dashbord.
  • Authentication supported for Kubernetes dashbord:
  • Deploy a Azure Container Registry if no public registry is provided.
  • Build docker images for Elastic Stack and push images to the Azure Container Register. If public registry that stores docker images for Elastic Stack is provided, this step is skipped.
  • Install Elastic Stack defined as Helm Charts on Kubernetes.

Elastic Stack on Kubernetes Architecture

Elastic Stack on Kubernetes Architecture

Prerequesites

Instructions

  1. Follow tutorial Create Azure Service Principal using Azure portal to create an Azure Service Principal and assign it Contributor role access to your subscription.

    • Assign application a contributor role to your subscription. The subsciption is the one where you will deploy the Elastic Stack.

    Note: Application ID, Password and Tenant ID will be used in later stages of the deployment.

  2. Go to Azure Marketplace, find Elastic Stack on Kubernetes solution template and click Create.

  3. In Basics panel, Controller Username and Controller Password need to be valid Ubuntu credential and will be used to access Kibana.

    Password must be at least 12 characters long and contain at least one lower case, upper case, digit and special character.

    Resource Group should be a new or an empty one to create your Kubernetes.

    Note: Due to Azure Container Service - Kubernetes (AKS) in preview isn't available across all regions globally. Deployments in following regions have been verified: East US, South Central US and West Europe. More regions will be supported as AKS enters general availability. Not all VM sizes are supported across all regions. You can check product availabilities from Azure products available by region

  4. In Common Settings panel, provide the following:

    • Dns prefix - The DNS name prefix of your Kubernetes controller. The dns prefix and region location will format your Kubernetes dashboard host name. So the dns prefix and location pair must be globally unique.

    • Registry url- The URL of a public registry that hosts elasticsearch , kibana and logstash docker images. If this field is empty, the solution will automatically create an Azure Container Registry instance.

    In the following field, you need to enter your Azure Event Hub connect information. If you want the logstash to get logs from log shipper instead of Azure Event hub, keep the Event hub namespace/key name/key value as undefined.

    The Event hub namespace, key name, key value and event hubs can format the event hub's connection string: Endpoint=sb://<namespace>.servicebus.windows.net/;SharedAccessKeyName=<key-name>;SharedAccessKey=<key-value>;EntityPath=<eventhub-name>. The key should be given access with listen.

    • Event hub namespace - e.g. "myeventhub".
    • Event hub key name - event hub SETTINGS find Shared access policies e.g. "RootManageSharedAccessKey".
    • Event hub key value - SAS policy key value.
    • List of event hubs - event hub ENTITIES find Event Hubs and list the event hubs from which you'd pull events e.g. "insights-logs-networksecuritygroupevent,insights-logs-networksecuritygrouprulecounter". Event hubs in the list must be existed and are comma seperated.

    If you are pulling events out of various event hubs with different partition counts, you are advised to deploy multiple instances of the solution.

    • Event hub partition count - partition count of event hubs (all listed event hubs must have the same partition count).

    • Thread wait interval(s) - logstash event hub plugin thread wait interval in seconds.

    • Data node storage account sku - storage account sku used by Elasticsearch data node.

    • Authentication Mode - authentication mode for accessing Kubernetes dashboard.

      • Basic Authentication mode uses Controller Username and Controller Password.

      • Azure Active Directory mode uses Azure AD service principal for authentication. You need to provide your service principal information which you get at Step 1:

  5. In Kubernetes Cluster Settings panel, provide the following:

    • Agent Count - number of agent nodes of Kubernetes cluster
    • Agent Node Size
    • Master Count - number of masters of Kubernetes cluster
  6. In Security Settings panel, provide the following:

    You can generate the SSH public key/private key pair using js-keygen

    • SSH public key - ssh public key for controller node to talk to Kubernetes cluster
    • Base64 encoded SSH private key - base64 encoded ssh private key

    The Sercive principal client ID and Service principal client secret are used to create and manage the Kubernetes cluster, they can be the client id and secret you get from Step 1. Ensure the Service principal used here has contributor access to your subscription and in the same AAD tenant as your subscription.

    • Service principal client ID - Application ID
    • Service principal client secret - Your generated key
  7. Click OK in Summary panel and create the solution.

    The creation may cost around half an hour. You can continue the next step while the creation.

  8. If you choose the AAD mode to login your Kubernetes dashboard in step 4, You need to set the redirect information in Azure Service Principal you created in step 1.

    1. Go to your Azure Service Principal: Click Azure Active Directory -> App registrations, search your Service Princial name and click it.

    2. Spell out your Kubernetes dashboard host name and note it as <host-name>. The format should be http://<dns-prefix>control.<resource-location>.cloudapp.azure.com.

      Both dns-prefix and resource-location are set in Basic Panel. dns-prefix is specified in Basic Settings, resource-location is the region where you deploy your Elastic Stack. Deployments in following regions have been verified: East US, South Central US and West Europe.

    3. Set the Sign-on URL: In the Settings page, click Properties, set the Home page URL to <host-name> you spelled out. Click Save.

    4. Set the redirect URL: In the Settings page, click Reply URLs, remove the exiting URL, add URL <host-name>/callback. Click Save.

      Add Azure Service Principal redirect URL

    5. Grant your Service Principal permissions: In the Settings page, click Required permissions -> Windows Azure Active Directory, tick Read all users' basic profiles and Sign in and read user profile. Click Save in Enable Access pane then Grant Permissions in Required permissions pane. Click Yes to confirm the action.

      Add Azure Service Principal access

Acccess your Elastic Stack on Kubernetes

After the deployment succeeds, you can find the Kubernetes dashboard and kibana/elasticsearch/logstash endpoints

How the logs are consumed by your Elastic Stack

The solution supports two ways to ship logs to Elastic Stack:

Troubleshooting

  • For resource deployment failure, you can find more information from Azure Portal.
  • For solution template failure, you can extract logs by ssh to controllervm. Deployment log is at /tmp/output.log.

Related

License

This project is under MIT license.

config/openidc.lua is derived from https://github.com/pingidentity/lua-resty-openidc with some modifications to satisfy requirements and this file (config/openidc.lua) is under Apache 2.0 license.

elk-acs-kubernetes's People

Contributors

microsoftopensource avatar msftgits avatar yaweiw avatar yuwzho avatar zhzy0077 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.