Toggle navigation
Info Circus - knowledge
作成
作成
下書き一覧
ストック
一覧
複合検索
サインイン
更新履歴
incmplt - Info Circus
2026/01/15 9:44
現在との差分
過去のナレッジの内容
コンテンツ
## Requirement * Ubuntu Server 24.04 LTS * Intel CPU (本環境は Hyper-V 環境で確認) ## Install Docker 以下のコマンドで、apt リポジトリを構成します。 ``` sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update ``` 公式のDocker パッケージをインストールします。 ``` sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` 確認のため hallo-world を実行して、Docker のインストールを確認します。 ``` sudo docker run hello-world ``` ユーザーアカウントで docker を管理できるように設定します。 ``` sudo usermod -aG docker $USER && newgrp docker ``` インストールした Docker のバージョンを確認し、ユーザーアカウントで docker コマンドを実行できることもあわせて確認します。 ``` $ docker --version Docker version 29.1.4, build 0e6fee6 ``` ## Install kubectl 公式ドキュメント https://kubernetes.io/ja/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management に従ってインストールを実施します。 ``` sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gnupg ``` k8s パッケージリポジトリの公開署名キーのダウンロードし有効にします。 ``` sudo mkdir -p -m 755 /etc/apt/keyrings curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg ``` k8s リポジトリを追加します。 ``` echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list ``` kubectl をインストールします。 ``` sudo apt-get update sudo apt-get install -y kubectl ``` kubectl のバージョンを確認します。 ``` Client Version: v1.32.11 Kustomize Version: v5.5.0 The connection to the server localhost:8080 was refused - did you specify the right host or port? ``` ## Install minikube 公式ドキュメント https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download に従ってインストールします。 ``` curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64 ``` インストールした minikube のバージョンを確認します。 ``` $ minikube version minikube version: v1.37.0 commit: 65318f4cfff9c12cc87ec9eb8f4cdd57b25047f3 ``` ## Install helm 公式ドキュメント https://helm.sh/docs/intro/install/ に従いインストールします。 ``` curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4 chmod 700 get_helm.sh ./get_helm.sh ``` ## execute minikube minikube を実行するときには docker ドライバーを指定して以下のように実行します。 ``` minikube start --driver=docker --memory=4096mb ```
現在のナレッジの内容
コンテンツ
## Requirement * Ubuntu Server 24.04 LTS * Intel CPU (本環境は Hyper-V 環境で確認) ## Install Docker 以下のコマンドで、apt リポジトリを構成します。 ``` sudo apt-get update sudo apt-get install ca-certificates curl sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update ``` 公式のDocker パッケージをインストールします。 ``` sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin ``` 確認のため hallo-world を実行して、Docker のインストールを確認します。 ``` sudo docker run hello-world ``` ユーザーアカウントで docker を管理できるように設定します。 ``` sudo usermod -aG docker $USER && newgrp docker ``` インストールした Docker のバージョンを確認し、ユーザーアカウントで docker コマンドを実行できることもあわせて確認します。 ``` $ docker --version Docker version 29.1.4, build 0e6fee6 ``` ## Install kubectl 公式ドキュメント https://kubernetes.io/ja/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management に従ってインストールを実施します。 ``` sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gnupg ``` k8s パッケージリポジトリの公開署名キーのダウンロードし有効にします。 ``` sudo mkdir -p -m 755 /etc/apt/keyrings curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.32/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg ``` k8s リポジトリを追加します。 ``` echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.32/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list ``` kubectl をインストールします。 ``` sudo apt-get update sudo apt-get install -y kubectl ``` kubectl のバージョンを確認します。 ``` Client Version: v1.32.11 Kustomize Version: v5.5.0 The connection to the server localhost:8080 was refused - did you specify the right host or port? ``` ## Install minikube 公式ドキュメント https://minikube.sigs.k8s.io/docs/start/?arch=%2Flinux%2Fx86-64%2Fstable%2Fbinary+download に従ってインストールします。 ``` curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube && rm minikube-linux-amd64 ``` インストールした minikube のバージョンを確認します。 ``` $ minikube version minikube version: v1.37.0 commit: 65318f4cfff9c12cc87ec9eb8f4cdd57b25047f3 ``` ## Install helm 公式ドキュメント https://helm.sh/docs/intro/install/ に従いインストールします。 ``` curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-4 chmod 700 get_helm.sh ./get_helm.sh ``` ## Execute minikube minikube を実行するときには docker ドライバーを指定して以下のように実行します。 ``` $ minikube start --driver=docker --memory=3072mb 😄 minikube v1.37.0 on Ubuntu 24.04 (hyperv/amd64) ✨ Using the docker driver based on user configuration 🧯 The requested memory allocation of 3072MiB does not leave room for system overhead (total system memory: 3868MiB). You may face stability issues. 💡 Suggestion: Start minikube with less memory allocated: 'minikube start --memory=3072mb' 📌 Using Docker driver with root privileges 👍 Starting "minikube" primary control-plane node in "minikube" cluster 🚜 Pulling base image v0.0.48 ... 💾 Downloading Kubernetes v1.34.0 preload ... ... ``` minikube を停止するには、以下のコマンドを実行します。 ``` minikube stop ``` 起動の確認ができたら、システムが起動したらすぐに使えるように systemd の設定をします。 minikube を systemd で管理するために、minikube.service を作成します。 以下の username の部分を、docker管理とminikubeを管理するアカウント名に置き換えます。 *vi /etc/systemd/system/minikube.service* ``` [Unit] Description=Minikube Cluster After=containerd.service docker.service [Service] Type=oneshot ExecStart=/usr/bin/minikube start --driver=docker RemainAfterExit=true ExecStop=/usr/bin/minikube stop StandardOutput=journal User=username Group=docker [Install] WantedBy=multi-user.target ``` minikube.service を作成したら、システムに読み込み起動の設定をします。 ``` sudo systemctl daemon-reload sudo systemctl enable --now minikube ```
戻る