0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Alibaba Cloud Container Service for Kubernetes (ACK) を触ってみた

Last updated at Posted at 2023-01-19

私について

  • CKAD, CKA 保有
  • 業務では AWS EKS(Elastic Kubernetes Service) を基盤とするシステムの SRE
  • AWS は 10年近く触っているが、Alibaba Cloud に触れるのは初めて

今回の概要

  • 基本的に GUI で作成 (※ Terraform や CLI での作成はまた別の機会に)

今回の流れ

  • クラスタ作成
  • モニタリング、ロギング、監査機能確認
  • Nginx コンテナデプロイ
  • ロードバランサーデプロイ

クラスタ作成

ログイン後、左側のナビゲーションペイン展開 -> Container Service for Kubernetes をクリック

image.png

400エラーになってしまった
image.png

「Go to RAM console」をクリック
image.png

CS(Container Service ?) が必要とするアクセス権限を作成する
image.png
image.png

ACK / Clusters 画面が表示されるようになった
image.png

ページの右上隅にある Create Kubernetes Cluster をクリック
image.png

以下のパラメータで Cluster を作成

  • Cluster Name : {任意の名前}
  • Cluster Specification : Standard edition
  • Region : Japan (Tokyo)
  • Billing Method : Pay-As-You-Go
  • Kubernetes Version : 1.24.6-aliyun.1
  • Container Runtime : containerd 1.5.13
  • VPC : {任意のVPC}
  • Network Plug-in : Terway
  • vSwitch : {VPC 内に作成した vSwitch を選択}
  • Pod vSwitch : {VPC 内に作成した vSwitch を選択}
  • Service CIDR : 192.168.0.0/16
  • Configure SNAT : ✅
  • Access to API Server : slb.s2.small
  • Security Group : Create Advanced Security Group
  • Deletion Protection : □
  • Resource Group : default resource group

[ Next:Node Pool Configurations ] をクリック
image.png

Node Pool Configurations 画面では、

インスタンスタイプを1つ(または複数)選択
image.png

Key Pair を1つ選択
image.png

[ Next:Component Configurations ] をクリック
image.png

  • Ingress : Nginx Ingress

  • SLB Network Type : Public Network

  • SLB Specifications : slb.s2.small

  • Servcie Discovery : ✅

  • Volume Plug-in : CSI

  • Monitoring Agents : すべてチェック

  • Alerts : □ (チェックを外す)

  • Log Service : すべてチェック
    image.png

  • Log Collection for Control Plane Components : □

  • Cluster Inspection : ✅

[ Next:Confirm Order ] をクリック
image.png

2つステータスチェックに失敗している
image.png

ACK activations check アクティベートする
image.png

Log Service Prometheus Monitoring Apsara File Storage NAS をアクティベートする
image.png

Log Service Prometheus Monitoring をアクティベートする
image.png

Log Service をアクティベートする
image.png

これで全ての Dependaency Check が Pass した

Create Cluster をクリック
image.png

10分ほど待ち、すべて Created され、Cluster Status も Running となった。

image.png

ローカル PC からクラスターに接続

をインストールします

API Server Public Endpoint を生やします

目的:ローカル PC から kubectl でアクセスする為

クラスター一覧画面 > クラスター選択 > [Basic information] タブ内 > [Bind EIP] をクリック

image.png

Create EIP
image.png

Region を Japan にして、あとはデフォルトの値のまま、[Buy Now]
image.png

[Activate now]
image.png

サインを求められる
image.png

EIP が選べるようになる
image.png

[API Server Public Endpoint] が付与された
image.png

kubeconfig 情報を取得

クラスター一覧画面 > クラスター選択 > [Connection Infomaion] > [Public Access]
image.png

Mac の場合、$HOME/.kube/config に COPY した情報を記入

apiVersion: v1
clusters:
- cluster:
    server: https://XX.XX.XX.XX:XXXX
    certificate-authority-data: 
(以下略)

ターミナルにて kubectx と入力すると、ACK クラスターが選択できるようになっている

image.png

ターミナルにて kubectl コマンドと入力すると、ACK リソースが見れる

Pod 一覧

$ kubectl get po --all-namespaces

image.png

Deployment 一覧

$ kubectl get deployment --all-namespaces

image.png

k9s でもアクセスしてみる

image.png

GUI

Pod や Deployment が確認できる

image.png
image.png

その他にも Nodes Network Configurations Volumes Applications Operations Security 等のメニューがある

image.png

モニタリング

[Operations] > [Prometheus Monitoring] にて、
Prometheus による Monitoring が見れる

image.png

image.png

構築時に [Monitoring Agents : すべてチェック] としていた為と思われる

ロギング

[Operations] > [Log center] にて、
クラスター、ネットワーク、アプリケーションのロギングが見れる

image.png

image.png

構築時に [Log Service : すべてチェック] としていた為と思われる

イベント履歴

[Operations] > [Event Center] にて、これまでのイベントが確認できる
image.png

監査

[Security] > [Cluster Auditing] にて、監査系の情報が確認できる

image.png

クラスター操作履歴や CVE 脆弱性情報も確認できる

image.png
image.png
image.png

ACK コンソールを使用してアプリケーションをデプロイ

NGINX をデプロイ

[Workloads] > [Deployment] > [Create from YAML]

image.png

サンプル テンプレートとして [Resource - basic Deployment] を選択、Create
image.png

Deployment 画面や、Pod 画面で Nginx がデプロイされていることが確認できる

image.png

image.png

ロードバランサー(Ingress)デプロイし、NGINX を公開する

[Network] > [Services] > [Create] をクリック

image.png

Cluster IP Type の Service をデプロイ

image.png
名前を入力し、Typeで Cluster IPを選択し、 Backend で nginx-deployment-basic を選択し、サービスポートとコンテナーポートを 80 に設定

[Network] > [Ingress] > [Create] をクリック

image.png

名前にingress-demo、パスに/を入力し、サービスにnginx-svcを選択

image.png

生えた IP アドレスにアクセスします
image.png

Nginx のデフォルト画面が表示されました
image.png

後片付け

1. EIP の開放

[VPC] >[Elastic IP Addresses] 画面にて Release

image.png

2. Server Load Balancer (SLB) の削除

[Resource Management] > [My Resource]

image.png

Read Only mode や 削除保護を解除する

image.png

解除し、Release
image.png

現在の料金の確認

感想

クラスターが立ち上がるまでの構築ウィザードにて、入力したり、選択しなくてはいけないパラメータは多くて面食らうかもしれないが、
構築後は GUI 上で確認できる情報(メトリクス、ログ等々)は他パブリッククラウドと比べても一番と言っても良いほど、豊富で親切だと思う。

ウィザードもなかなか親切で、どうしたらいいのか困って詰まってしまうということもなかった。

各種コンポーネントがセットアップされる時間も、サクサクデプロイされたのも好印象。

参考資料

Container Service for Kubernetes (英語)

Container Service for Kubernetes (日本語)

Container Service for Kubernetes で Pod を作ってアクセスしてみよう | SBクラウド チャンネル - YouTube

Kubernetes on Alibaba Cloud

マルチクラウド時代のAlibaba Cloud活用事例と最新技術 - TECH PLAY Magazine

Alibaba CloudではじめるKubernetes - Speaker Deck

[ACK] Terwayについて - Qiita

Alibaba Cloud サーバレス Kubernetes クラスタ
のユーザーガイド

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?