作成した openshift の単一ノード開発クラスターをテストしようとしています。適切な特権アカウントを設定していないため、クラスターで基本的なコマンドを実行できません。
特に、次のことを行う必要があります。
- サービス エンドポイントをクエリするコンテナを作成するポッドを実行する
- 安全でないエンドポイントを介して apiserver にクエリを実行する
- のようなコマンドを実行します
kubectl get pods
これらすべてを実行できるデフォルトのアカウントはありますか? このような低レベルの開発タスクのために、複雑なユーザー アカウントを手動で設定するのは避けたいと思います。
以下は、例として、これを行うために私が行ったいくつかの、ややばかげた試みです。
まず、次のような「管理者」アカウントを作成しました。
sudo -u vagrant $oc login https://localhost:8443 -u=admin -p=admin --config=/data/src/github.com/openshift/origin/openshift.local.config/master/openshift-registry.kubeconfig
次に、管理者としてログインしようと何度かハッキングを試みました。
[vagrant@localhost ~]$ sudo chmod 777 /openshift.local.config/master/admin.kubeconfig
[vagrant@localhost ~]$ oc login
Server [https://localhost:8443]:
The server uses a certificate signed by an unknown authority.
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): y
Authentication required for https://localhost:8443 (openshift)
Username: admin
Password: admin
Login successful.
Using project "project1".
[vagrant@localhost ~]$ oc get nodes --config=/openshift.local.config/master/admin.kubeconfig
これにより、次のエラーが発生します。
サーバーからのエラー: ユーザー「admin」はクラスター内のすべてのノードを一覧表示できません
構成を除外すると、次のエラーも表示されます。
[vagrant@localhost ~]$ oc get nodes
Error from server: User "admin" cannot list all nodes in the cluster
ノードを一覧表示し、openshift のスタンドアロン開発クラスターで基本的な kube 操作を実行する簡単な方法はありますか?