Kubernetes provides a first-class object type in Azure Red Hat OpenShift called
deployments . This object type (referred to here as Kubernetes deployments
for distinction) serves as a descendant of the deployment configuration object
type.
Like deployment configurations, Kubernetes deployments describe the desired
state of a particular component of an application as a pod template. Kubernetes
deployments create replica sets (an iteration of
replication controllers), which orchestrate pod lifecycles.
For example, this definition of a Kubernetes deployment creates a replica set to
bring up one hello-openshift pod:
Example Kubernetes deployment Definition hello-openshift-deployment.yaml
apiVersion: apps/v1
kind: deployment
metadata:
name: hello-openshift
spec:
replicas: 1
selector:
matchLabels:
app: hello-openshift
template:
metadata:
labels:
app: hello-openshift
spec:
containers:
- name: hello-openshift
image: openshift/hello-openshift:latest
ports:
- containerPort: 80
After saving the definition to a local file, you could then use it to create a
Kubernetes deployment:
$ oc create -f hello-openshift-deployment.yaml
You can use the CLI to inspect and operate on Kubernetes deployments and replica
sets like other object types, as described in
Common
Operations, like get
and describe
. For the object type, use deployments
or deploy
for Kubernetes deployments and replicasets
or rs
for replica
sets.
See the Kubernetes documentation for more details about
deployments and
Replica Sets,
substituting oc
for kubectl
in CLI usage examples.