0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

間違ってルート(route)のみを消すつもりが、サービス(service)まで消してしまった時の対処法

Posted at

ホスト名が間違ったり、デフォルトまま登録してしまい
一度、消してからやり直そうとした結果、ルートのみを消すつもりが、誤ってサービスまで消してしまった。
最初からDeploymentしかない場合の対処法です。

1. デプロイメント(Deployment)からサービス(Service)を作る

OpenShiftの場合

oc expose deployment/my-deployment --name my-service --port 80 --target-port 8080

Kubernetesの場合

kubectl expose deployment/my-deployment  --name my-service  --port 80 --target-port 8080

2. サービス(Service)からルート(Route)を作る

OpenShiftの場合

oc expose service/my-service --hostname service.apps.ocp4.example.com

Kubernetesの場合

kubectl expose service/my-service
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?