Vagrantを使ってKubernetesを体験してみるためのハンズオンです。 Kubernetes自体の構築ではなく、Kubernetes上でアプリケーションを作成・公開するために、Kubernetesの主要なリソースおよびkubectlコマンドの使い方について説明しています。
Vagrantを使ってKubernetesを体験してみるためのハンズオンです。 Kubernetes自体の構築ではなく、Kubernetes上でアプリケーションを作成・公開するために、Kubernetesの主要なリソースおよびkubectlコマンドの使い方について説明しています。
はじめに 今までVagrantを使っていてこれからDockerを学びたい人(自分を含む)向けにVagrantとDockerのコマンドを機能別に対応関係をまとめました。 厳密に言うと異なりますが、概要の理解に繋がれば幸いです。 まだDockerの勉強中の身なので、アドバイス等あればコメントでお待ちしています。 Vagrantとは 仮想環境を管理するためのソフトウェア 参考 公式サイト 公式リファレンス Dockerとは コンテナ型の仮想環境を管理するソフトウェア 参考 公式サイト 公式リファレンス Docker入門(第一回)~Dockerとは何か、何が良いのか~ https://qiita.com/shiro01/items/04ca672a93384b463701 概念の対応関係 Vagrant Docker
何が問題なのか Vagrantの共有フォルダ上で、npm installを実行すると例えば以下のようなエラーが出ます。 ちなみに僕の環境では共有フォルダ以外は普通に実行できます。 $ npm install mongodb npm WARN test@1.0.0 No description npm WARN test@1.0.0 No repository field. npm ERR! code ENOENT npm ERR! syscall open npm ERR! path /home/vagrant/shared-folder/test/node_modules/string_decoder/node_modules/safe-buffer/package.json.1130074357 npm ERR! errno -2 npm ERR! enoent ENOENT: no
Command: vagrant snapshot This is the command used to manage snapshots with the guest machine. Snapshots record a point-in-time state of a guest machine. You can then quickly restore to this environment. This lets you experiment and try things and quickly restore back to a previous state. Snapshotting is not supported by every provider. If it is not supported, Vagrant will give you an error messag
Vagrantにて一つのVagrantfileで複数の仮想マシンを立ち上げる方法についてです。 環境 Vagrant 1.9.1 Vagrantfileの書き方 config.vm.defineブロックを使います。 初期状態では、次のように一つの仮想マシンが定義されています。 Vagrant.configure(2) do |config| config.vm.box = "bento/ubuntu-16.04" config.vm.network "private_network", ip: "192.168.33.10" # 省略 end 複数の仮想マシンに対応する場合は、config.vm.define <マシン名>のブロック内に定義を入れます。 もともとのマシンを活かす場合は、次のようにマシン名を”default“にします。 Vagrant.configure(2) do |con
本稿では、Vagrant に仮想マシン複数台を定義するマルチマシン(Malti-Machine)設定について解説します。 マルチマシン設定とは? マルチマシン設定とは、一つの Vagrantfile に複数のゲストマシンを定義する設定です。 例えばWEBサーバーとDBサーバーの両方を同時に起動する必要がある場合や、クライアントとサーバーの関係のマシンを起動する必要がある場合などに、マルチマシン設定が役立ちます。 設定 複数台分のマシンの設定を同一の Vagrantfile に config.vm.define を利用して定義します。 サーバーを2台定義する最低限の設定は次のようなイメージです。 ここでは例として Box として precise32 を指定して2台を定義します。 Vagrant.configure("2") do |config| config.vm.box = "preci
Vagrant & VirtualBoxで立ち上げた仮想環境へ、サーバーソフトのApache HTTP Serverをインストールして Webサーバーを構築する手順をメモします。 環境 : CentOS7 (CentOS Linux release 7.1.1503) ※Vagrant&VirtualBoxを使用した仮想環境の構築手順は前回の記事をご確認ください。 Apache HTTP Serverをインストールする起動中の仮想マシンへssh接続する。 $ vagrant sshyumコマンドを使用してApache HTTP Server(以下、Apache)のパッケージをインストールする。 $ sudo yum -y install httpd Apacheを起動する$ sudo systemctl start httpd.service (起動確認) $ sudo systemctl
エラーの具体例 下記のようなエラーが出力される場合は、既にAtlas上にBoxイメージが無い可能性が高いです。 「以前はこの設定で出来たんだけどな…」という場合はほぼこれです。 エラーメッセージ $ vagrant up Bringing machine 'stdsv1' up with 'virtualbox' provider... ==> stdsv1: Box 'centos/7' could not be found. Attempting to find and install... stdsv1: Box Provider: virtualbox stdsv1: Box Version: 1803.01 The box 'centos/7' could not be found or could not be accessed in the remote catalog. I
==> default: Running cleanup tasks for 'shell' provisioner... C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/provisioners/shell/provisioner.rb:179:in `gsub!': invalid byte sequence in Windows-31J ( ArgumentError) from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/provisioners/shell/provisioner.rb:179:in `with_script_file' from C:/HashiCorp/Vagrant/embedded/gems/gems/
> vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Checking if box 'centos/7' is up to date... ==> default: Clearing any previously set forwarded ports... ==> default: Clearing any previously set network interfaces... ==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat ==> default: Forwarding ports... default: 22 (guest) =>
VagrantのUbuntu環境で、Play Frameworkを使ったアプリの開発をしたいと思い試しています。 Playはソースコードが更新されると、自動的にコンパイルが走ってくれるauto-reloadingという機能が便利です。この機能をVagrantで試していて気がついたのですが、どうやら共有フォルダにあるソースコードは更新されてても、自動でコンパイルがかからないようです。controllersもviewsもどちらも変更してみましたが、やはりだめです。 そんなことはないんじゃないか?と思い、共有フォルダではないフォルダで試してみたら、ちゃんとreloadされていたので、原因は共有フォルダにあることが分かりました。 PlayKeys.playWatchServiceを試す → ダメ いろいろググっていたら「Play 2.3.2 auto reload is not working o
まとめ debug モジュールを使って状況を出力 Vagrantfile で Ansible の実行状況を詳しく出力 Vagrant の snapshot 機能を利用 Vagrant の provision 機能を利用 具体例。debug モジュールを使って状況を出力 次のようにして、プレイブックが実行されていることを確認しています。ファイルを追加したのはよいけれども、タイポしているのかどうしても実行できずにしょんぼりしたことがしばしばございましたの><。 --- - name: running test debug: msg: "running" debug – Print statements during execution — Ansible Documentation 具体例。Vagrantfile で Ansible の実行状況を詳しく出力 ansible.verbose =
Provisioner name: ansible_local The Vagrant Ansible Local provisioner allows you to provision the guest using Ansible playbooks by executing ansible-playbook directly on the guest machine. Warning: If you are not familiar with Ansible and Vagrant already, we recommend starting with the shell provisioner. However, if you are comfortable with Vagrant already, Vagrant is a great way to learn Ansible.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く