私はPluralSightのコースを卒業しています。コースの作成者がドッキング画像をkubernetesに置き、ブラウザでアクセスします。私は彼のことを再現しようとしていますが、ウェブサイトにアクセスすることはできません。間違ったIPに接続している可能性があります。Googleコンテナがサービスに接続
私は10 pods
を実行しているReplicationController
を持っている:
rc.yml
apiVersion: v1
kind: ReplicationController
metadata:
name: hello-rc
spec:
replicas: 10
selector:
app: hello-world
template:
metadata:
labels:
app: hello-world
spec:
containers:
- name: hello-pod
image: nigelpoulton/pluralsight-docker-ci:latest
ports:
- containerPort: 8080
私は、RCを公開しようとした:
kubectl expose rc hello-rc --name=hello-svc --target-port=8080 --type=NodePort
$ kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-svc 10.27.254.160 <nodes> 8080:30488/TCP 30s
kubernetes 10.27.240.1 <none> 443/TCP 1h
私のGoogleのコンテナのエンドポイントは、次のとおりです。 35.xxx.xx.xxx
、kubectl describe svc hello-svc
を実行している場合、NodePortはです。
したがって、35.xxx.xx.xxx:30488
でアプリにアクセスしようとしましたが、サイトにアクセスできません。
アップルトゥーから私から、Pluralsightコースを通過する目的のために、私はファイアウォールの穴をポップする方が簡単でした。現実世界では、私は「LoadBalancer」が行く方法だと確信しています。 – quickshiftin