【发布时间】:2023-03-31 14:26:01
【问题描述】:
oc new-app 总是创建一个 DeploymentConfig。是否可以选择创建 Deployment 而不是 DeploymentConfig?
为什么? DeploymentConfig 是专有的遗留 Red Hat 唯一资源类型。我更喜欢现代跨平台行业标准部署。
【问题讨论】:
标签: openshift
oc new-app 总是创建一个 DeploymentConfig。是否可以选择创建 Deployment 而不是 DeploymentConfig?
为什么? DeploymentConfig 是专有的遗留 Red Hat 唯一资源类型。我更喜欢现代跨平台行业标准部署。
【问题讨论】:
标签: openshift
oc new-app总是创建一个 DeploymentConfig。是否可以选择创建 Deployment 而不是 DeploymentConfig?
oc 的当前版本创建部署已经有一段时间了:
$ oc new-app --docker-image=<IMAGE> --name=my-application
--> Found container image [..]
* An image stream tag will be created as "my-application:latest" that will track this image
--> Creating resources ...
imagestream.image.openshift.io "my-application" created
deployment.apps "my-application" created
service "my-application" created
--> Success
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
'oc expose service/my-application'
Run 'oc status' to view your app.
$ oc get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
my-application 1/1 1 1 7s
$ oc get deploymentconfig
No resources found in simon namespace.
所以您应该更新您的oc 客户端,因为您似乎使用的是旧版本(我上面的输出是使用 4.6 客户端)。
创建DeploymentConfig 的旧行为仍然可以通过使用
--as-deployment-config 选项:
$ oc new-app --docker-image=<IMAGE> --name=my-application --as-deployment-config
请注意,如果您想使用触发器、自动回滚、生命周期挂钩或自定义策略等功能,DeploymentConfigs 仍然占有一席之地 (DeploymentConfigs-specific features)
【讨论】: