Kubernetes指南
Linux性能优化实战eBPF 核心技术与实战SDN指南个人博客
EN
EN
  • Overview
  • Introduction
    • Kubernetes Introduction
    • Kubernetes Concepts
    • Kubernetes 101
    • Kubernetes 201
    • Kubernetes Cluster
  • Concepts
    • Concepts
    • Architecture
    • Design Principles
    • Components
      • etcd
      • kube-apiserver
      • kube-scheduler
      • kube-controller-manager
      • kubelet
      • kube-proxy
      • kube-dns
      • Federation
      • kubeadm
      • hyperkube
      • kubectl
    • Objects
      • Autoscaling
      • ConfigMap
      • CronJob
      • CustomResourceDefinition
      • DaemonSet
      • Deployment
      • Ingress
      • Job
      • LocalVolume
      • Namespace
      • NetworkPolicy
      • Node
      • PersistentVolume
      • Pod
      • PodPreset
      • ReplicaSet
      • Resource Quota
      • Secret
      • SecurityContext
      • Service
      • ServiceAccount
      • StatefulSet
      • Volume
  • Setup
    • Setup Guidance
    • kubectl Install
    • Single Machine
    • Feature Gates
    • Best Practice
    • Version Support
    • Setup Cluster
      • kubeadm
      • kops
      • Kubespray
      • Azure
      • Windows
      • LinuxKit
      • kubeasz
    • Setup Addons
      • Addon-manager
      • DNS
      • Dashboard
      • Monitoring
      • Logging
      • Metrics
      • GPU
      • Cluster Autoscaler
      • ip-masq-agent
  • Extension
    • API Extension
      • Aggregation
      • CustomResourceDefinition
    • Access Control
      • Authentication
      • RBAC Authz
      • Admission
    • Scheduler Extension
    • Network Plugin
      • CNI
      • Flannel
      • Calico
      • Weave
      • Cilium
      • OVN
      • Contiv
      • SR-IOV
      • Romana
      • OpenContrail
      • Kuryr
    • Container Runtime
      • CRI-tools
      • Frakti
    • Storage Driver
      • CSI
      • FlexVolume
      • glusterfs
    • Network Policy
    • Ingress Controller
      • Ingress + Letsencrypt
      • minikube Ingress
      • Traefik Ingress
      • Keepalived-VIP
    • Cloud Provider
    • Device Plugin
  • Cloud Native Apps
    • Apps Management
      • Patterns
      • Rolling Update
      • Helm
      • Operator
      • Service Mesh
      • Linkerd
      • Linkerd2
    • Istio
      • Deploy
      • Traffic Management
      • Security
      • Policy
      • Metrics
      • Troubleshooting
      • Community
    • Devops
      • Draft
      • Jenkins X
      • Spinnaker
      • Kompose
      • Skaffold
      • Argo
      • Flux GitOps
  • Practices
    • Overview
    • Resource Management
    • Cluster HA
    • Workload HA
    • Debugging
    • Portmap
    • Portforward
    • User Management
    • GPU
    • HugePage
    • Security
    • Audit
    • Backup
    • Cert Rotation
    • Large Cluster
    • Big Data
      • Spark
      • Tensorflow
    • Serverless
  • Troubleshooting
    • Overview
    • Cluster Troubleshooting
    • Pod Troubleshooting
    • Network Troubleshooting
    • PV Troubleshooting
      • AzureDisk
      • AzureFile
    • Windows Troubleshooting
    • Cloud Platform Troubleshooting
      • Azure
    • Troubleshooting Tools
  • Community
    • Development Guide
    • Unit Test and Integration Test
    • Community Contribution
  • Appendix
    • Ecosystem
    • Learning Resources
    • Domestic Mirrors
    • How to Contribute
    • Reference Documents
由 GitBook 提供支持
在本页
  • AKS: A Deep Dive
  • Getting Started
  • Connect with Dashboard
  • Manually enlarge or shrink your cluster
  • Upgrade your cluster
  • Using Helm
  • Cluster deletion
  • Looking at acs-engine
  • Azure's Container Registry
  • Virtual Kubelet
  • References
  1. Setup
  2. Setup Cluster

Azure

上一页Kubespray下一页Windows

最后更新于1年前

Azure's container services, specifically the Azure Container Service (AKS) and Azure Container Service (ACS), offer unique opportunities for deployment and management of containerized applications. AKS, recently debuted by Microsoft Azure, runs separately from ACS. Through AKS, users can easily deploy and manage containerized applications without needing specialist knowledge of container business processes. Even better? The AKS platform doesn't require any additional user maintenance - it offers automatic upgrades, fault repair, and scaling of resource pools as needed. What’s more, users only pay for virtual machines running their containers - AKS’s cluster management is completely free of charge.

Since 2015, Microsoft Azure's ACS has supported a range of container orchestration tools, including Kubernetes, DCOS, and Dockers Swarm. What's also cool about ACS is that its core function is open source – users can check it out and download it from their Github page at .

AKS: A Deep Dive

Getting Started

Following are simple steps to get started with AKS. The process will require the Azure CLI software to be installed on your computer. If it's not already installed, you can do that from .

Before you can create AKS clusters, you first need to enable AKS using the following command:

# Enable AKS
az provider register -n Microsoft.ContainerService

The next step is to create a resource group to manage all the related resources:

# Create Resource Group
az group create --name group1 --location centralus

Now, you are ready to create your AKS clusters:

# Create aks
az aks create --resource-group group1 --name myK8sCluster --node-count 3 --generate-ssh-keys

It’s almost done! Once your cluster is created, install and configure kubectl:

# Install kubectl
az aks install-cli

# Configure kubectl
az aks get-credentials --resource-group=group1 --name=myK8sCluster

Using version 2.0.24 of azure-cli might result in the az aks get-credentials command failing. You can fix this by upgrading to a newer version or reverting back to version 2.0.23.

Connect with Dashboard

# Create dashboard
az aks browse --resource-group group1 --name myK8SCluster

Manually enlarge or shrink your cluster

az aks scale --resource-group=group1 --name=myK8SCluster --agent-count 5

Upgrade your cluster

Get your cluster's current version and check the ones you can upgrade to:

# Current version and upgradable versions
az aks get-versions --name myK8sCluster --resource-group group1 --output table

# Upgrade to version 1.11.3
az aks upgrade --name myK8sCluster --resource-group group1 --kubernetes-version 1.11.3

The graphic below shows the process of deploying a version 1.7.7 cluster and upgrading it to version 1.8.1:

Using Helm

Other tools and services in the Kubernetes community can also be used, such as deploying the Nginx Ingress Controller with Helm:

helm init --client-only
helm install stable/nginx-ingress

Cluster deletion

Your cluster can be deleted when no longer required:

az group delete --name group1 --yes --no-wait

Looking at acs-engine

In acs-engine, each cluster is described through a json file. For example, a Kubernetes cluster can be described as follows:

{
  "apiVersion": "vlabs",
  "properties": {
    "orchestratorProfile": {
      ...
    },
    "masterProfile": {
      ...
    },
    "agentPoolProfiles": [
      {
        ...
      }
    ],
    ...
}

Azure's Container Registry

Around the same time that AKS was launched, Azure also debuted their Azure Container Registry (ACR) services. This service hosts users' private images.

# Create ACR
az acr create --resource-group myResourceGroup --name <acrName> --sku Basic --admin-enabled true

# Login to the registry:
az acr login --name <acrName>

# Tag your image:
az acr list --resource-group myResourceGroup --query "[].{acrLoginServer:loginServer}" --output table
docker tag azure-vote-front <acrLoginServer>/azure-vote-front:redis-v1

# Push your image to the registry
docker push <acrLoginServer>/azure-vote-front:redis-v1

# List available images
az acr repository list --name <acrName> --output table

Virtual Kubelet

You can use Helm to deploy your Virtual Kubelet:

RELEASE_NAME=virtual-kubelet
CHART_URL=https://github.com/virtual-kubelet/virtual-kubelet/raw/master/charts/virtual-kubelet-0.4.0.tgz

helm install "$CHART_URL" --name "$RELEASE_NAME" --namespace kube-system --set env.azureClientId=<YOUR-AZURECLIENTID-HERE>,env.azureClientKey=<YOUR-AZURECLIENTKEY-HERE>,env.azureTenantId=<YOUR-AZURETENANTID-HERE>,env.azureSubscriptionId=<YOUR-AZURESUBSCRIPTIONID-HERE>,env.aciResourceGroup=<YOUR-ACIRESOURCEGROUP-HERE>,env.nodeName=aci, env.nodeOsType=<Linux|Windows>,env.nodeTaint=azure.com/aci

References

Although AKS is expected to be the future of Azure's container services, many users value being able to manage their own container clusters to ensure maximum flexibility (such as customizing master services). Such users can utilize the open-source for creating and managing their clusters. Acs-engine is, actually, core to ACS. It is a command line tool that assists with deployment and management of Kubernetes, Swarm, and DC/OS clusters, by transforming a container cluster descriptor file into a group of ARM (Azure Resource Manager) templates.

Azure's container instances (ACI) offer a simplified way to run containers in Azure as ACI effectively absolves users from having to configure any virtual machines or other sophisticated services. Ideal for fast growth and resource adjustment, ACI is designed to be relatively straightforward. The allows ACI to function as an unlimited Node for a Kubernetes cluster, making Node quantity a non-issue. ACI then automatically manages the cluster's resources based on the containers in operation.

https://github.com/Azure/acs-engine
here
acs-engine
Virtual Kubelet
AKS – Managed Kubernetes on Azure
Azure Container Service (AKS)
Azure/acs-engine Github
acs-engine/examples