When you deploy an application on OpenShift/Kubernetes, you need to create Deployments*1 resource on the cluster.
Deployments is one of the resources in Kubernetes and helps you to manage your application (Pod).
Deployments have fields to specify a container image url and environment variables. So that it is easy to deploy applications using same container images but using different environment variables. Here is an example.
1. 引诱-aaa-<pod_hash>
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-banking-aaa
labels:
app: app-banking-aaa
spec:
replicas: 3
selector:
matchLabels:
app: app-banking-aaa
template:
metadata:
labels:
app: app-banking-aaa
spec:
containers:
- name: app-banking
image: https://path-to-your-registry/your-app:tag1
env:
- name: ABC
value: abc
申请表-银行-bbb-<pod_hash>
apiVersion: apps/v1
kind: Deployment
metadata:
name: app-banking-bbb
labels:
app: app-banking-bbb
spec:
replicas: 3
selector:
matchLabels:
app: app-banking-bbb
template:
metadata:
labels:
app: app-banking-bbb
spec:
containers:
- name: app-banking
image: https://path-to-your-registry/your-app:tag1
env:
- name: VXZ
value: vxz
然而,你们许多人需要在部署方面增加更多的领域,上述部署有助于你们了解需要做些什么。
我认为,你还需要寻找特惠制和秘密资源,以确定部署中的环境变量。
*1:https://kubernetes.io/docs/concepts/workloads/ Controllers/dplo/