Oc set: Difference between revisions
Jump to navigation
Jump to search
(→env) |
|||
(22 intermediate revisions by the same user not shown) | |||
Line 10: | Line 10: | ||
Sets [[OpenShift_Concepts#Environment_Variables|environment variables]] in deployment configurations, build configurations, etc. | Sets [[OpenShift_Concepts#Environment_Variables|environment variables]] in deployment configurations, build configurations, etc. | ||
List: | |||
oc set env <''object''> --list | |||
Set: | |||
oc set env <''object''> KEY_1=VAL_1 ... | oc set env <''object''> KEY_1=VAL_1 ... | ||
Line 19: | Line 25: | ||
=resources= | =resources= | ||
oc set resources dc/jenkins --limits=memory=1Gi | oc set resources dc/jenkins --limits=memory=2Gi --requests=memory=1Gi | ||
=<span id='volume'></span>volumes= | |||
The command queries or updates volumes on a pod template. | |||
oc set volume <''resource-type''>/<''resource-name''> <--add|--remove|--list> [options] | |||
==List All Volumes Defined on All Deployment Configurations in the Current Project== | |||
oc set volume dc --all | |||
==Delete the Definition of a Volume== | |||
oc set volumes dc/nexus3 \ | |||
--remove \ | |||
--name=nexus3-volume-1 | |||
=volumes= | ==Updating the Definition of a Volume== | ||
===PersistentVolumeClaim Volume=== | |||
oc set volumes dc/nexus3 \ | |||
--add \ | |||
--overwrite \ | |||
--name=nexus3-volume-1 \ | |||
--mount-path=/nexus-data/ \ | |||
--type=persistentVolumeClaim \ | |||
--claim-name=production-nexus-pvc | |||
===EmptyDir Volume=== | |||
oc set volumes dc/tomcat1 \ | |||
--add --name=emptydirvol1 \ | |||
--mount-path=/something \ | |||
--type=emptyDir | |||
==Adding the Definition of a New Volume== | |||
oc set volumes dc/nexus3 \ | |||
--add \ | |||
--name=nexus-data \ | |||
--mount-path=/nexus-data/ \ | |||
--type=persistentVolumeClaim \ | |||
--claim-name=production-nexus-pvc | |||
=probe= | =probe= | ||
* [[ | * [[OpenShift CI/CD Operations - Collocated Persistent Jenkins Set Up#Adjust_Readiness_Probe_Timeout|Adjust readiness probe timeout for Jenkins]] | ||
* [[OpenShift_Nexus#liveness_and_readiness_probe|Set up liveness and readiness probes for Nexus]] | |||
=deployment-hook= | =deployment-hook= | ||
Line 32: | Line 81: | ||
=build-secret= | =build-secret= | ||
oc set build-secret --source bc/<''build-configuration-name'''> somesecret | |||
{{Internal|OpenShift_Build_Operations#Source_Clone_Secret|Source Clone Secret}} | |||
=triggers= | =triggers= |
Latest revision as of 00:25, 6 February 2018
Internal
Overview
The command changes existing application resources.
env
Sets environment variables in deployment configurations, build configurations, etc.
List:
oc set env <object> --list
Set:
oc set env <object> KEY_1=VAL_1 ...
Unset:
ec set env <object> KEY_1-
resources
oc set resources dc/jenkins --limits=memory=2Gi --requests=memory=1Gi
volumes
The command queries or updates volumes on a pod template.
oc set volume <resource-type>/<resource-name> <--add|--remove|--list> [options]
List All Volumes Defined on All Deployment Configurations in the Current Project
oc set volume dc --all
Delete the Definition of a Volume
oc set volumes dc/nexus3 \ --remove \ --name=nexus3-volume-1
Updating the Definition of a Volume
PersistentVolumeClaim Volume
oc set volumes dc/nexus3 \ --add \ --overwrite \ --name=nexus3-volume-1 \ --mount-path=/nexus-data/ \ --type=persistentVolumeClaim \ --claim-name=production-nexus-pvc
EmptyDir Volume
oc set volumes dc/tomcat1 \ --add --name=emptydirvol1 \ --mount-path=/something \ --type=emptyDir
Adding the Definition of a New Volume
oc set volumes dc/nexus3 \ --add \ --name=nexus-data \ --mount-path=/nexus-data/ \ --type=persistentVolumeClaim \ --claim-name=production-nexus-pvc
probe
deployment-hook
image
build-secret
oc set build-secret --source bc/<build-configuration-name'> somesecret