EX288 Merge Flashcards

1
Q

<p>Create image stream</p>

A

<p>oc import-image stream-name --from URL/${USER}/image-name --confirm</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

<p>Get OCP internal registry URL</p>

A

<p>oc get route -n openshift-image-registry</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

<p>Enable access to internal registry</p>

A

<p>oc patch config.imageregistry cluster -n openshift-image-registry --type merge -p '{"spec":{"defaultRoute":true}}'</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

<p>Create webhook</p>

A

<p>oc set triggers bc/name --from-gitlab</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

<p>Mount cm into deployment</p>

A

<p>oc set env deployment/my-deployment-name --from configmap/mycm</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

<p>Create secrets for OCP to access external registry using username & password</p>

A

<p>oc create secret docker-registry quayio<br></br>--docker-server=$SERVER<br></br>--docker-username=$USERNAME<br></br>--docker-password=$PASSWORD</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

<p>Link secrets to access external registry</p>

A

<p>oc secret link builder credential-name --for=pull<br></br>oc secret link default credential-name --for=pull</p>

<p>oc secrets link deployer quayio --for=pull</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

<p>Set a command as post commit build hook</p>

A

<p>oc set build-hook bc/name --post-commit --command -- bundle exec rake test --verbose</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

<p>Set a post commit build hook using the shell approach</p>

A

<p>oc set build-hook bc/name --post-commit --script="curl http://api.com/user/${USER}"</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

<p>How do you check if credentials have been added properly for accessing external registry?</p>

A

<p>oc describe serviceaccount default</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

<p>Determine which SCC permissions are required for a pod to run</p>

A

<p>oc get pod podname -o yaml | oc adm policy scc-subject-review -f -</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

<p>Create a service account</p>

A

<p>oc create sa nginx-sa</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

<p>Connect the service accountnginx-sato the SCCanyuid:</p>

A

<p>oc adm policy add-scc-to-user anyuid -z nginx-sa</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

<p>Bind the service accountnginx-sato the pod orsccnginxdeployment to allow it to run with its new permissions</p>

A

<p>oc set sa deploy podname nginx-sa</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

<p>List of steps to resolve nginx CrashLoopBackoff</p>

A

<p></p>

<ul> <li>oc get pod podname -o yaml | oc adm policy scc-subject-review -f -</li> <li>oc create sa nginx-sa</li> <li>oc adm policy add-scc-to-user anyuid -z nginx-sa</li> <li>oc set sa deploy sccnginx nginx-sa</li></ul>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

<p>Kubernetes main resource types</p>

A

<p>POD (po)<br></br>Persistent Volumes (pv)<br></br>Persistent Volume Claims (pvc)<br></br>Build Config (bc)<br></br>Deployment / deployment Confg (dc)<br></br>Services (svc)<br></br>Config Maps (cm)<br></br>Secrets</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

<p>Login to OCP cluster using CLI</p>

A

<p>oc login -u user1 -p passwd URL</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

<p>Forward port to mysql server</p>

A

<p>oc port-forward mysql 3306:3306</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

<p>Deploy mysql using template</p>

A

<p>oc new-app <br></br> --template=mysql-persistent <br></br> -p MYSQL_USER=user1 <br></br><br></br>-p MYSQL_PASSWORD=mypa55 <br></br><br></br>-p MYSQL_DATABASE=testdb <br></br><br></br> -p MYSQL_ROOT_PASSWORD=r00tpa55 <br></br><br></br>-p VOLUME_CAPACITY=10Gi</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

<p>Deploy mysql using image from registry</p>

A

<p>oc new-app --image=myregistry.com/mycompany/myapp --name=myapp</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

<p>Deploy app using github url</p>

A

<p>oc new-app https://github.com/openshift/ruby-hello-world --name=ruby-hello</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

<p>Deploy mysql using mysql image</p>

A

<p>oc new-app mysql MYSQL_USER=user MYSQL_PASSWORD=pass MYSQL_DATABASE=testdb -l db=mysql</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

<p>Get list of pv</p>

A

<p>oc get pv</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

<p>Create pv</p>

A

<p>oc create -f pvc.yaml</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

<p>get certain resources</p>

A

<p>oc get RESOURCE_TYPE RESOURCE_NAME</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

<p>Show detailed of the resource</p>

A

<p>oc describe resource_type resource_name</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

<p>oc create</p>

A

<p>oc create</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

<p>edit resource</p>

A

<p>oc edit deploymentconfig/parksmap-katacoda</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

<p>Delete resource</p>

A

<p>oc delete RESOURCE_TYPE name</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

<p>Search by label</p>

A

<p>oc get svc,deployments -l app=nexus</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

<p>Create a route</p>

A

<p>oc expose svc quotedb --name quote<br></br><br></br>oc expose object_type object_name</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

<p>Restart an OCP build</p>

A

<p>oc start-build myapp</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

<p>Create an app with s2i</p>

A

<p>oc new-app -i php http://services.lab.example.com/app --name=myapp</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

<p>Get list of image streams for a specific project.</p>

A

<p>oc get is -n openshift</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

<p>Get list of builds</p>

A

<p>oc get builds</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

<p>Get list of bc</p>

A

<p>oc get buildconfig</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
37
Q

<p>Get list of templates inside a project where you are not currently</p>

A

<p>oc get templates -n openshift</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
38
Q

<p>Explain: oc process --parameters mysql-persistent -n openshift</p>

A

<p>list available parameters/resources from a template</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
39
Q

<p>Process a template and redirect output to a file</p>

A

<p>oc process -o yaml -f filename > myapp.yaml</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
40
Q

<p>Which OCP resource is responsible for the build step in the S2I process</p>

A

<p>BuildConfig (BC)</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
41
Q

<p>How do you retrieve logs resulting from the S2I build step?</p>

A

<p>oc logs bc/appname</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
42
Q

<p>How do you retrieve logs resulting from the S2I deployment step?</p>

A

<p>oc logs -f deployment/appname</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
43
Q

<p>How do you troubleshoot volume issues in OCP?</p>

A

<p>1) Delete the persistent volume claim<br></br>2) Delete the persistent volume. <br></br>3) Recreate the persistent volume</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
44
Q

<p>Delete persistent volume</p>

A

<p>oc delete pv</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
45
Q

<p>Monitor logs from a build</p>

A

<p>oc logs -f bc/temps</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
46
Q

<p>Flag to configure oc new-app to create a DeploymentConfig resource instead of a Deployment</p>

A

<p>--as-deployment-config</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
47
Q

<p>Flag to provide the image stream to be used</p>

A

<p>--image-stream<br></br><br></br>-i</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
48
Q

<p>Flag to specify if deployment is docker or pipeline or source</p>

A

<p>--strategy</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
49
Q

<p>Flag to provide the URL to a Git repository to be used as input to an S2I build</p>

A

<p>--code</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
50
Q

<p>Flag to provide the URL to a container image to be deployed.</p>

A

<p>--docker-image</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
51
Q

<p>Flag to show the result of the operation without performing it</p>

A

<p>--dry-run</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
52
Q

<p>Flag to provide the path to a directory to treat as the root when creating an app from a git URL</p>

A

<p>--context-dir</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
53
Q

<p>Build app from git url using specific builder image</p>

A

<p>oc new-app php~http://gitserver.example.com/mygitrepo<br></br><br></br>oc new-app -i php http://gitserver.example.com/mygitrepo<br></br><br></br>oc new-app php:7.0~http://gitserver.example.com/mygitrepo<br></br><br></br>oc new-app -i php:7.0 http://gitserver.example.com/mygitrepo</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
54
Q

<p>Diff between tilde (~) and --image-stream (-i) options</p>

A

<p>-i : requires git client installed locally</p>

<p>- i:language detection needs to clone the repo forinspection</p>

<p>~ : no language detection</p>

<p>~ : no git client needed</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
55
Q

<p>Command to retrieve a file inside a running container file system</p>

A

<p>oc cp frontend-1-zvjhb:/var/log/httpd/error_log \<br></br>/tmp/frontend-server.log</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
56
Q

<p>Diff between Linux cp and oc cp</p>

A

<p>oc cp does not copy a file to a folder.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
57
Q

<p>execute commands inside the container</p>

A

<p>oc rsh frontend-1-zvjhb ps ax</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
58
Q

<p>Start and interactive shell to container</p>

A

<p>oc rsh -t frontend-1-zvjhb</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
59
Q

<p>create a new configuration map that stores string literals</p>

A

<p>oc create cm config_map_name \<br></br>--from-literal key1=value1 \<br></br>--from-literal key2=value2</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
60
Q

<p>create a new secret that stores string literals</p>

A

<p>oc create secret generic secret_name \<br></br>--from-literal username=user1 \<br></br>--from-literal password=mypa55w0rd</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
61
Q

<p>create a new configuration map that stores the contents of a file or a directory containing a set of files</p>

A

<p>oc create cm config_map_name \<br></br>--from-file /home/demo/conf.txt</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
62
Q

<p>create a new secret that stores the contents of a file or a directory containing a set of files</p>

A

<p>oc create secret generic secret_name \<br></br>--from-file /home/demo/mysecret.txt</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
63
Q

<p>Command to retrieve cm in json</p>

A

<p>oc get configmap/myconf -o json</p>

64
Q

<p>Command to edit cm</p>

A

<p>oc edit configmap/myconf</p>

65
Q

<p>Command to alter a cm</p>

A

<p>oc patch cm/myconf --patch '{"data":{"key1":"newvalue1"}}'</p>

66
Q

<p>inject all values stored in a cm into a deployment</p>

A

<p>oc set env deployment/my-deployment-name --from configmap/mycm</p>

67
Q

<p>Create secrets to allow OCPto connect to docker registry</p>

A

<p>oc create secret docker-registry registrycreds \<br></br>--docker-server registry.example.com \<br></br>--docker-username youruser \<br></br>--docker-password yourpassword</p>

68
Q

<p>Link secrets to default service account</p>

A

<p>oc secrets link default registry-creds-name --for=pull</p>

69
Q

<p>Link secrets registrycreds to builder image</p>

A

<p>oc secrets link builder registrycreds --for=pull,mount</p>

70
Q

<p>Create a route to expose the internal OCP registry</p>

A

<p>oc patch config.imageregistry cluster -n openshift-image-registry \<br></br>--type merge -p '{"spec":{"defaultRoute":true}}'</p>

71
Q

<p>Show the route of the internal OCP registry</p>

A

<p>oc get route -n openshift-image-registry</p>

72
Q

<p>Log in into the internal registry from CLI</p>

A

<p>1) TOKEN=$(oc whoami -t)<br></br>2) podman login -u myuser -p ${TOKEN} internal-registry-url</p>

73
Q

<p>allows a user to pull images from the internal registry in a given project</p>

A

<p>oc policy add-role-to-user system:image-puller \<br></br>user_name -n project_name</p>

74
Q

<p>Get image stream tags in a project</p>

A

<p>oc get istag -n openshift</p>

75
Q

<p>create an image stream tag resource for a container image hosted on an external registry</p>

A

<p>oc import-image myimagestream[:tag] --confirm \<br></br>--from registry/myorg/myimage[:tag]<br></br><br></br>oc import-image myimagestream:1.0 --confirm \<br></br>--from registry/myorg/myimage</p>

76
Q

<p>create one image stream tag resource for each container image tag that exists in the source registry server</p>

A

<p>oc import-image myimagestream --confirm --all \<br></br>--from registry/myorg/myimage</p>

77
Q

<p>update an image stream tag to match one current image IDs on the source registry server</p>

A

<p>oc import-image myimagestream[:tag] --confirm</p>

78
Q

<p>Starts a new build manually.</p>

A

<p>oc start-build name</p>

79
Q

<p>Cancel a build</p>

A

<p>oc cancel-build name</p>

80
Q

<p>Deletes a build configuration.</p>

A

<p>oc delete bc/name</p>

81
Q

<p>Delete a build</p>

A

<p>oc delete build/name-1</p>

82
Q

<p>Describes details about a build configuration resource and the associated builds,</p>

A

<p>oc describe bc name</p>

83
Q

<p>Describe a build providing the build name:</p>

A

<p>oc describe build name-1</p>

84
Q

<p>How do you change the number of most recent builds that are persisted</p>

A

<p>Edit the bc and change following properties:<br></br><br></br>successfulBuildsHistoryLimit, and the failedBuildsHistoryLimit</p>

85
Q

<p>change log level for bc</p>

A

<p>oc set env bc/name BUILD_LOGLEVEL="4"</p>

86
Q

<p>Deploy app using pre-created image</p>

A

<p>oc new-app --docker-image=registry.access.redhat.com/rhel7-mysql57</p>

87
Q

<p>What are the oc-new app option flags?</p>

A

<p>--as-deployment-config</p>

<p></p>

<p>--image-stream</p>

<p>--strategy</p>

<p>--code</p>

<p>--docker-image</p>

<p>--dry-run</p>

<p>--context-dir</p>

88
Q

<p>Parameters for--strategy</p>

A

<ol> <li>docker</li> <li>source</li> <li>pipeline</li></ol>

89
Q

<p>Explain --strategy</p>

A

<p>Helps in disambiguating if URL contains both docker file and source code</p>

90
Q

<p>Explain--as-deployment-config</p>

A

<p>Used in oc new-app to use deployment config for the deployment of the app instead of deployment.</p>

91
Q

<p>Createimage stream namedmyisfor acme/awesomecontainer image comingfrom insecure registry.com</p>

A

<p>oc import-image myis --confirm --from registry.com/acme/awesome --insecure</p>

92
Q

<p>What are image stream tags for?</p>

A

<p>1) points to new container tag</p>

<p>2) alternative friendlyname for the container image</p>

<p></p>

<p>Examples:</p>

<p>1) ruby:2.5for container imagerhel8/ruby-25.</p>

<p>2) ruby:2.6for container imagerhel8/ruby-26</p>

93
Q

<p>What are different types of secrets?</p>

A

<ol> <li>basic-auth</li> <li>opaque</li> <li>service-account-token</li> <li>ssh-auth</li> <li>tls</li></ol>

94
Q

<p>Two type of bc triggers</p>

A

<p>Image change triggers<br></br>Webhook triggers</p>

95
Q

<p>How do you view the triggers associated with a build configuration</p>

A

<p>oc describe bc/name</p>

96
Q

<p>Add an image change trigger to a build</p>

A

<p>oc set triggers bc/name --from-image=project/image:tag</p>

97
Q

<p>How do you remove an image change trigger from a bc</p>

A

<p>oc set triggers bc/name --from-image=project/image:tag --remove</p>

98
Q

<p>Add a webhook to a bc</p>

A

<p>oc set triggers bc/name --from-gitlab<br></br><br></br>oc set triggers bc/name --from-github<br></br><br></br>oc set triggers bc/name --from-bitbucket</p>

99
Q

<p>Remove a webhook from a bc</p>

A

<p>oc set triggers bc/name --from-gitlab --remove<br></br><br></br>oc set triggers bc/name --from-github --remove<br></br><br></br>oc set triggers bc/name --from-bitbucket --remove</p>

100
Q

<p>What are the two types of post commit hooks?</p>

A

<p>Command: A executed using the exec system call.<br></br><br></br>Shell script: Runs a build hook with the /bin/sh -ic command</p>

101
Q

<p>Create a command post-commit build hook</p>

A

<p>oc set build-hook bc/name --post-commit \<br></br>--command -- bundle exec rake test --verbose</p>

102
Q

<p>Create a shell script post-commit build hook</p>

A

<p>oc set build-hook bc/name --post-commit \<br></br>--script="curl http://api.com/user/${USER}"</p>

103
Q

<p>How do you tell S2I where to find its mandatory scripts (run, assemble)</p>

A

<p>Set io.openshift.s2i.scripts-url as label in the builder image</p>

104
Q

<p>Ways to customize the s2i script:</p>

A

<p>1) override the default S2I scripts by providing your own S2I scripts in the .s2i/bin <br></br><br></br>2) create a wrapper script that invokes the default scripts, and then adds the necessary customization before or after the invocation</p>

105
Q

<p>using skopeo how do you determine the location of the s2i script for rhscl/php-73-rhel7 S2I builder image</p>

A

<p>skopeo inspect <br></br>docker://myregistry.com/rhscl/php-73-rhel7 | grep io.openshift.s2i.scripts-url</p>

106
Q

<p>Command for skafolding s2i builder image</p>

A

<p>s2i create image_name directory</p>

107
Q

<p>How do yous pecify the maven repo URL when creating an app?</p>

A

<p>--build-env MAVEN_MIRROR_URL=${URL}</p>

108
Q

<p>How to specify a build env variable for oc new-app?</p>

A

<p>--build-env ENV_VAR_NAME=VALUE</p>

<p></p>

<p>Do not put a space after the environment variableENV_VAR_NAME=VALUE. The environment variable follows theNAME=VALUEformat.</p>

109
Q

<p>Types of post commit build hookds</p>

A

<ol> <li>Command</li> <li>Shell script</li></ol>

110
Q

<p>Set a command as post commit build hook</p>

A

<p>oc set build-hook bc/name --post-commit --command -- bundle exec rake test --verbose</p>

111
Q

<p>Set a post commit build hook using the shell approach</p>

A

<p>oc set build-hook bc/name --post-commit \ --script="curl http://api.com/user/${USER}"</p>

112
Q

<p>Start a build called hook and display logs</p>

A

<p>oc start-build hook -F</p>

113
Q

<p>Where do you put your s2i customizations</p>

A

<p>In your project under.s2i/bin</p>

114
Q

<p>How do you invoke the s2i run script during customization?</p>

A

<p>exec /usr/libexec/s2i/run</p>

<p></p>

<p>You must useexectoensurethat the defaultrunscript still runs withprocess ID 1.</p>

115
Q

<p>Create app from template stored in local file</p>

A

<p>oc new-app --file mytemplate.yaml -p PARAM1=value1</p>

116
Q

<p>Apply values to a template and storethe resultin a local file</p>

A

<p>oc process -f mytemplate.yaml -p PARAM1=value1 > myresourcelist.yaml</p>

117
Q

<p>list only parameters defined by atemplate</p>

A

<p>oc process -f mytemplate.yaml --parameters</p>

118
Q

<p>Print the list of env variable in a bc</p>

A

<p>oc set env bc/hook --list</p>

119
Q

<p>How do you validate a helm chart?</p>

A

<p>helm lint hello-world</p>

120
Q

<p>How do you render the template locally for quick feedback?</p>

A

<p>helm template ./hello-world</p>

121
Q

<p>How do you install a helmchart into the Kubernetes cluster:</p>

A

<p>helm install --name hello-world ./hello-world</p>

122
Q

<p>How to find out which charts are installed on a cluster?</p>

A

<p>helm ls --all</p>

123
Q

<p>How to upgrade a release to a specified or current version of the chart or configuration</p>

A

<p>helm upgrade hello-world ./hello-world</p>

124
Q

a

A

<p>helm rollback hello-world 1</p>

125
Q

<p>How to uninstall a release completely from k8s?</p>

A

<p>helm uninstall hello-world</p>

126
Q

<p>How to create a versioned archive file of a helm chart?</p>

A

<p>helm package ./hello-world</p>

127
Q

<p>How to search a helm repo?</p>

A

<p>helm search repo</p>

128
Q

<p>show the status of a helm release</p>

A

<p>helm status RELEASE_NAME</p>

129
Q

<p>downloads the charts added as dependencies to a chart</p>

A

<p>helm dependency update</p>

130
Q

<p>Initialize a helm project</p>

A

<p>helm create hello-world</p>

131
Q

<p>Configure helm deployment to use a specific image</p>

A

<p>In values.yaml, change the value of image.repository and image.tag.</p>

132
Q

<p>Add mariadb dependency</p>

A

<p>in Chats.yaml add:</p>

<p><br></br>dependencies:<br></br> - name: mariadb<br></br> version: 11.0.13<br></br> repository: https://charts.bitnami.com/bitnami<br></br><br></br><br></br>Then run: helm dependency update</p>

133
Q

<p>Specify environment variables with helm</p>

A

<p>In values.yaml, add:<br></br><br></br><br></br>env:<br></br>- name: "QUOTES_HOSTNAME"<br></br> value: "famousapp-mariadb"<br></br>- name: "QUOTES_DATABASE"<br></br> value: "quotesdb"<br></br>- name: "QUOTES_USER"<br></br> value: "quotes"<br></br>- name: "QUOTES_PASSWORD"<br></br> value: "quotespwd"</p>

134
Q

<p>Tree types of probes</p>

A

<p>startup, readiness, liveness</p>

135
Q

<p>What does readiness probe determines?</p>

A

<p>whether or not a container is ready to serve requests</p>

136
Q

<p>What happens if an app fails readiness probe?</p>

A

<p>OpenShift removes the IP address for the container from the endpoints of all services.</p>

137
Q

<p>What happens container fails liveness probe?</p>

A

<p>OCP kills the container and tries to redeploy it</p>

138
Q

<p>Readiness probe config key</p>

A

<p>spec.containers.readinessprobe</p>

139
Q

<p>Liveness probe config key</p>

A

<p>spec.containers.livenessprobe</p>

140
Q

<p>Five options that control probes</p>

A

<ol> <li>initialDelaySeconds</li> <li>timeoutSeconds</li> <li>periodSeconds</li> <li>successThreshold</li> <li>failureThreshold</li></ol>

141
Q

<p>Three protocols for probe execution</p>

A

<ol> <li>http</li> <li>exec</li> <li>tcp socket</li></ol>

142
Q

<p>How do you edit deployment using the GUI</p>

A

<p>Edith the deployment YAML by going toWorkloads→Deployment→</p>

143
Q

<p>Create http readiness probe using oc</p>

A

<p>oc set probe deployment myapp --readiness--get-url=http://:8080/healthz --period=20</p>

144
Q

<p>Create tcp liveness probe using oc</p>

A

<p>oc set probe deployment myapp --liveness--open-tcp=3306 --period=20--timeout-seconds=1</p>

145
Q

<p>Get help with probe creation</p>

A

<p>oc set probe --help</p>

146
Q

<p>Continuously run "oc get pods"</p>

A

<p>watch -n 2 oc get pods</p>

147
Q

<p>Set an env variable on a dc</p>

A

<p>oc set env dc/mysql HOOK_RETRIES=5</p>

148
Q

<p>Start a deployment</p>

A

<p>oc rolloutlatest dc/name</p>

149
Q

<p>view the history of deployments</p>

A

<p>oc rollout history dc/name</p>

150
Q

<p>See details of a specific deployment</p>

A

<p>oc rollout history dc/name --revision=1</p>

151
Q

<p>Retry a deployment that failed previously</p>

A

<p>oc rollout retry dc/name</p>

152
Q

<p>scale the number of pods in a deployment</p>

A

<p>oc scale dc/name --replicas=3</p>

153
Q

<p>Two types of events that trigger a deployment:</p>

A

<ul> <li>Configuration change</li> <li>Image change</li></ul>

154
Q

<p>Set a deployment trigger for a deployment configuration</p>

A

<p>oc set triggers dc/name--from-image=myproject/origin-ruby-sample:latest -c helloworld</p>

155
Q

<p>Deploy java app by specifying maven repo</p>

A

<p>oc new-app --as-deployment-config --name quip</p>

<p></p>

<p>--build-env MAVEN_MIRROR_URL=URL</p>

<p>https://github.com/user/app-deploy</p>

156
Q

<p>Activate readiness and liveness probes for anapplication</p>

A

<p>oc set probe dc/quip --liveness --readiness --get-url=http://:8080/ready --initial-delay-seconds=30 --timeout-seconds=2</p>