新聞中心
Azure Arc是微軟推出的一款用于擴(kuò)展Azure服務(wù)的工具,它可以將Azure的服務(wù)和功能集成到本地環(huán)境中,Kubernetes是一種流行的容器編排平臺(tái),它可以幫助開發(fā)者管理和部署應(yīng)用程序,微軟如何將Azure Arc擴(kuò)展到Kubernetes呢?本文將詳細(xì)介紹這一過程。

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過有效、簡(jiǎn)單的方式提供給客戶,將通過不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:國(guó)際域名空間、網(wǎng)頁(yè)空間、營(yíng)銷軟件、網(wǎng)站建設(shè)、柏鄉(xiāng)網(wǎng)站維護(hù)、網(wǎng)站推廣。
Azure Arc簡(jiǎn)介
Azure Arc是一個(gè)開源項(xiàng)目,它允許用戶在本地環(huán)境中使用Azure服務(wù),通過Azure Arc,用戶可以在本地創(chuàng)建和管理Azure資源,如虛擬機(jī)、存儲(chǔ)帳戶、數(shù)據(jù)庫(kù)等,Azure Arc還支持跨云服務(wù)連接,如連接到AWS和Google Cloud平臺(tái)。
Kubernetes簡(jiǎn)介
Kubernetes是一個(gè)開源的容器編排平臺(tái),它可以幫助開發(fā)者管理和部署應(yīng)用程序,Kubernetes可以自動(dòng)部署、擴(kuò)展和管理容器化應(yīng)用程序,它提供了一種簡(jiǎn)單的方法來(lái)管理應(yīng)用程序的生命周期,從而降低了運(yùn)維成本。
將Azure Arc擴(kuò)展到Kubernetes的過程
1、安裝和配置Azure Arc
我們需要在本地環(huán)境中安裝并配置Azure Arc,以下是安裝和配置Azure Arc的步驟:
(1)注冊(cè)Azure Arc CLI:在命令行中運(yùn)行以下命令以注冊(cè)Azure Arc CLI。
az login --service-principal -u-p --tenant az extension add -n azure-arc
(2)安裝Azure Arc CLI:運(yùn)行以下命令以安裝Azure Arc CLI。
npm install -g @azure/cli@latest
(3)配置Azure Arc:運(yùn)行以下命令以配置Azure Arc,這將生成一個(gè)名為arc.json的文件,其中包含有關(guān)您的本地環(huán)境和Azure訂閱的信息。
arc init -c arc.json
2、將Azure服務(wù)添加到Azure Arc
接下來(lái),我們需要將Azure服務(wù)添加到Azure Arc,以下是將Azure服務(wù)添加到Azure Arc的步驟:
(1)列出可用的Azure服務(wù):運(yùn)行以下命令以列出可用于擴(kuò)展的Azure服務(wù)。
az extension list --query "[].name" -o table | tr ' ' ' ' | sed 's/ //g' > availableServices.txt
(2)將服務(wù)添加到Arc:運(yùn)行以下命令以將指定的Azure服務(wù)添加到Arc,在這個(gè)例子中,我們將添加Kubernetes服務(wù)。
az extension add -n azure-arc --src availableServices.txt --type azure-kubernetes --yes --resourceGroupName--location --subscriptionId --clientId --clientSecret --tenantId --username --password --confirmPassword --forceRefreshLoginToken true --scopes https://management.azure.com/.default https://monitoring.core.windows.net/.default https://storage.core.windows.net/.default https://kubernetes.azurecr.io/ https://microsoft.onmicrosoft.com/Graph/Auth/User.aspx https://graph.microsoft.com/v1.0/me https://graph.microsoft.com/v1.0/sites https://graph.microsoft.com/v1.0/domains https://graph.microsoft.com/v1.0/oauth2Permissions https://graph.microsoft.com/v1.0/tokens https://graph.microsoft.com/v1.0/applications https://graph.microsoft.com/v1.0/extensions https://graph.microsoft.com/v1.0/administratorAccess $tenantid $clientid $objectId $expiresIn $sessionState $correlationId $timestamp $partitionKey $rowKey $opaqueStoreToken $securityToken $keyId $signedHeaders $host $originalUrl $requestMethod $statusCode $statusDescription $cookieId $isMobileDeviceSession $locale $timezone $ipAddress $userId $userAgent $referer $originHost $originPath $scheme $hostNameAndPort $protocolVersion $acceptLanguage $acceptEncoding $contentType $refererHost $httpReferer $cacheControl $ifModifiedSince $ifUnmodifiedSince $range *
3、驗(yàn)證擴(kuò)展是否成功添加到Kubernetes集群
要驗(yàn)證擴(kuò)展是否成功添加到Kubernetes集群,我們需要檢查Kubernetes API服務(wù)器上的相關(guān)組件是否已啟用,可以通過以下命令查看這些組件的狀態(tài):
az aks show -g-n --query "addonProfiles" -o jsonpath='{$.addonProfiles}' | jq '[inputs] | map(select(.name == "kubernetes")) | flatten | to_entries | map([keys, values]) | map("[(.key)]="(tostring)(.value)"")' > kubeconfig.txt
4、更新Kubernetes配置文件以使用Azure Arc代理連接到集群
為了確保Kubernetes能夠使用Azure Arc代理連接到集群,我們需要更新其配置文件,在kubeconfig.txt文件中,您應(yīng)該看到類似于以下內(nèi)容的內(nèi)容:
apiVersion: v1
clusters:
cluster:
certificate-authority-data:
server: https://:/api/v1/namespaces//clusters//certificates/@?verify=true&trustedCA=false&authProviderNamespace=system:masters&name=default-token-abcdefghijkl-mnopqrstuvwxyzabcdefghijkldefault-token-abcdefghijkl-mnopqrstuvwxyzabcdefghijkl%3D%3D&contexts=system:node%3Cnamespace=%27default%27%3BcontextName=%27system:node%27&contexts=system:master%3Cnamespace=%27default%27%3BcontextName=%27system:master%27+user:athenz%3Aibm%3Aathenzuser%3Cnamespace=%27default%27%3BcontextName=%27system:master%27+user:athenz%3Aibm%3Aathenzuser%3Cnamespace=%27default%27%3BcontextName=%27system:master%27+user:athenz%3Aibm%3Aathenzuser%3Cnamespace=%27default%27%3BcontextName=%27system:master%27+user:athenz%3Aibm%3Aathenzuser%3Cnamespace=%27default%27%3BcontextName=%27system:master%27+user:athenz%3Aibm%3Aathenzuser%3Cnamespace=%27default%27%3BcontextName=%27system:master%27+user:athenzid=abcdefghijkl-mnopqrstuvwxyzabcdefghijklathenzid=abcdefghijkl-mnopqrstuvwxyzabcdefghijkl&kind=ClusterConfig&preferences=nil&timeoutSeconds=5m&readOnly=true&allowPrivileged=false&generateClientCertificate=false&clientCertificatePrivateKey=&embedCertExpiry=true&tlsCipherSuite=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256&insecureSkipVerify=false&certificate-authority=&embeddedcertspkiurl=https://:/api/v1/nodes/https://:/proxy/api/v1/sessionContexts/system:nodesystem:node&gorestsessionproxy=https://:/api/v1/sessionContexts/system:nodesystem:node&gorestsessionproxypath=https://:/api/v1/sessionContexts/system:nodesystem:node&gorestproxyheaders=Content-Type%3Dapplication%2Foctet-stream&gorestproxyheaders=User-Agent%3Dcurl%2Bpython+HEAD%2Fclusters&gorestproxyheaders=X-K8S-UUID%3Dabcdefghijkl-mnopqrstuvwxyzabcdefghijklX-K8S-UUID=abcdefghijkl-mnopqrstuvwxyzabcdefghijkl&gorestproxyheaders=X-K8S-APISERVER-
網(wǎng)頁(yè)題目:azurearbitrator
瀏覽地址:http://www.5511xx.com/article/dhopopc.html


咨詢
建站咨詢
