Giter Club home page Giter Club logo

telepresence-demo's Introduction

Telepresence Demo

構成図

Telepresenceを使って、クラスタにあったGoのコンテナをローカルのものに差し替えつつ下記の操作が可能なことが分かるデモです。

  1. クラスタの他のPodからの通信を受ける
  2. ローカルのコンテナからServiceの名前解決を行う
  3. ローカルのコンテナからServiceへ通信する

バージョン情報

  • telepresence: 0.101
  • macOS: 10.14.5
  • Docker Desktop: 2.1.0.0
  • kubectl: v1.15.2
  • Kubernetes: GKE, v1.13.7-gke.8
  • go: 1.12.7

事前準備

Telepresence CLIのインストール

Telepresence公式の手順に沿ってインストールする

Kubernetes リソースのデプロイ

kubectl apply -f ./k8s-manifest/telepresence-demo.yaml

# 動作確認
CURL_POD=$(kubectl get po -l app=curl -ojsonpath='{.items[0].metadata.name}')
kubectl exec $CURL_POD -- curl -v devapp:8080
# nginx のデフォルトページが出ればOK

Dockerイメージの差し替え

# go-demo/facade.go の内容を変更
# 注: 本来は接続先は環境変数に設定して再ビルドを避ける方が良いが、デモ用のサンプルコードなので……
sed -i -e "s/backend-1/backend-2/" ./go-demo/facade.go

# Dockerイメージをビルド
docker build -t go-demo:v2 ./go-demo/

# 差し替え
telepresence --swap-deployment devapp --docker-run go-demo:v2 /demoapp
# 下記のログが表示されれば準備OK
# T: Setup complete. Launching your container.

# 動作確認
CURL_POD=$(kubectl get po -l app=curl -ojsonpath='{.items[0].metadata.name}')
kubectl exec $CURL_POD -- curl -v devapp:8080
# Apache httpdのデフォルトページ (It works!) が出ればOK

telepresence-demo's People

Watchers

 avatar  avatar

telepresence-demo's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.