内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
06_virtualization
»
05_container
»
17 Kubernetes IPマスカレード
トレース:
06_virtualization:05_container:17_kubernetes_ipmasquerade
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 17 Kubernetes IPマスカレード ====== Kubernetes作成したばかりだと、コンテナから外部へ通信できない。 そのためIPマスカレード設定を入れてあげる。 ===== 1. DaemonSet用意 ===== <code|DaemonSet.yaml> apiVersion: apps/v1 kind: DaemonSet metadata: name: ip-masq-agent namespace: kube-system spec: selector: matchLabels: k8s-app: ip-masq-agent template: metadata: labels: k8s-app: ip-masq-agent spec: hostNetwork: true containers: - name: ip-masq-agent image: gcr.io/google-containers/ip-masq-agent-amd64:v2.5.0 args: - --masq-chain=IP-MASQ # To non-masquerade reserved IP ranges by default, uncomment the line below. # - --nomasq-all-reserved-ranges securityContext: privileged: true volumeMounts: - name: config mountPath: /etc/config volumes: - name: config configMap: # Note this ConfigMap must be created in the same namespace as the # daemon pods - this spec uses kube-system name: ip-masq-agent optional: true items: # The daemon looks for its config in a YAML file at /etc/config/ip-masq-agent - key: config path: ip-masq-agent tolerations: - effect: NoSchedule operator: Exists - effect: NoExecute operator: Exists - key: "CriticalAddonsOnly" operator: "Exists" </code> ==== create ==== <code> kubectl create -f DaemonSet.yaml </code> ===== 2.ConfigMap作成 ===== ==== config ==== <code|config> nonMasqueradeCIDRs: - 10.0.0.0/8 resyncInterval: 60s </code> <code> kubectl create configmap ip-masq-agent \ --from-file config \ --namespace kube-system </code> {{tag>Kubernetes Nat}}
06_virtualization/05_container/17_kubernetes_ipmasquerade.txt
· 最終更新: 2022/04/19 06:30 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ