In the upstream Kubernetes project, a new first-class object type called
deployments was added in version 1.2. 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: extensions/v1beta1
kind: Deployment
metadata:
name: hello-openshift
spec:
replicas: 1
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.