OpenShift Interview Questions and Answers
1-What is OpenStack?
OpenStack is a cloud computing project aimed at providing infrastructure as a service (IaaS). OpenStack is a set of software components for managing and building Cloud Computing platforms for private and public clouds. OpenStack is an Open Source Cloud Computing platform.
2-Define OpenStack key components?
3-What are services generally run on a controller node?
4-What are the services generally run on a Compute Node?
5-Tell me the command how to spin a VM from Command Line?
# openstack server create --flavor {flavor-name} --image {Image-Name-Or-Image-ID} --nic net-id={Network-ID} --security-group {Security_Group_ID} –key-name {Keypair-Name} <VM_Name>
6-How to list the network namespace of a tenant in OpenStack?
# ip netns list
7-How to execute a command inside the network namespace in OpenStack?
# ip netns exec {network-space} <command>
8-How to upload and download a cloud image in Glance from the command line?
A Cloud image can be uploaded in a glance from command using OpenStack command,
~# openstack image create --disk-format qcow2 --container-format bare --public --file {Name-Cloud-Image}.qcow2 <Cloud-Image-Name>
Use below OpenStack command to download a cloud image from the command line,
~# glance image-download --file <Cloud-Image-Name> --progress <Image-ID>
9- How to reset the error state of a VM into active in OpenStack env?
There are some scenarios where some VMs went to an error state and this error state can be changed into an active state using the below commands,
~# nova reset-state --active {Instance_id}
10-How to get a list of available Floating IPs from the command line?
~]# openstack ip floating list | grep None
11-How to get a list of VMs which are provisioned on a specific Compute node?
#openstack server list –all-projects –long -c Name -c Host | grep -i {Compute-Node-Name}
12- How to view the console log of an OpenStack instance from the command line?
Console logs of an instance can be viewed from the command line using the following commands,
First, get the ID of an instance and then use the below command,
~# openstack console log show {Instance-id}
13-How to get the console URL of an OpenStack instance?
Console URL of an instance can be retrieved from the command line using the below OpenStack command,
~# openstack console url show {Instance-id}
OpenShift Interview Questions and Answers
1. How do you display or show the current IP ranges for services and pods in your OCP cluster?
oc get networks.operator.openshift.io cluster -o jsonpath='{.spec.clusterNetwork[*].cidr}'
oc get networks.operator.openshift.io cluster -o jsonpath='{.spec.serviceNetwork[*]}'2. How do you configure Egress and Namespace Egress for OpenShift?
Assign the label to nodes and create an EgressIP object:
oc label node <node-name> egress-assignable=
apiVersion: k8s.ovn.org/v1
kind: EgressIP
metadata:
name: example-egressip
spec:
egressIPs:
- 192.168.1.100
namespaceSelector:
matchLabels:
app: mynamespace
podSelector: {}3. How do you check which version of your OpenShift cluster?
oc version
oc get clusterversion4. What kind of authentication method is used for authenticating OpenShift?
OpenShift supports OAuth-based authentication, LDAP, and OpenID Connect. Check the configuration:
oc get oauth cluster -o yaml5. How do you troubleshoot the connectivity from POD to POD?
oc rsh <pod-name> ping <destination-pod-IP>
oc get networkpolicy -A
oc debug node/<node-name> -- chroot /host6. How do you configure routes to run on a specific set of nodes, for example, infra nodes?
oc label node <node-name> node-role.kubernetes.io/infra=
oc patch ingresscontroller default -n openshift-ingress-operator --type merge -p '
{
"spec": {
"nodePlacement": {
"nodeSelector": {
"matchLabels": {
"node-role.kubernetes.io/infra": ""
}
}
}
}
}'7. How do you make sure that you have a dedicated node for the infrastructure components?
oc label node <infra-node> node-role.kubernetes.io/infra=
oc adm taint nodes <infra-node> node-role.kubernetes.io/infra:NoSchedule8. What is the best monitoring tool to be used for OpenShift monitoring?
Prometheus and Grafana are the best tools for monitoring OpenShift.
9. How do you configure an alert in Prometheus?
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: custom-alerts
namespace: openshift-monitoring
spec:
groups:
- name: custom-rules
rules:
- alert: HighMemoryUsage
expr: node_memory_Active_bytes > 80
for: 5m
labels:
severity: critical
annotations:
summary: "High Memory Usage"
oc apply -f custom-alert.yaml10. What are the best logging tools for OpenShift?
Fluentd, Elasticsearch, Kibana, and Loki are popular logging tools for OpenShift.
11. How does the logging stack work in OpenShift?
OpenShift uses Fluentd for log collection, Elasticsearch for storage, Kibana for visualization, and Curator for log management.
12. How is the OpenShift upgrade done?
oc get clusterversion
oc adm upgrade --to-latest
watch oc get clusterversion13. What are the diagnostic tools for collecting logs and uploading them for support?
oc adm must-gather
oc logs -n openshift-logging
oc get events -A
oc adm inspect clusteroperators --dest-dir=<path>1. How do you display or show the current IP ranges for services and pods in your OCP cluster?
oc get networks.operator.openshift.io cluster -o jsonpath='{.spec.clusterNetwork[*].cidr}'
oc get networks.operator.openshift.io cluster -o jsonpath='{.spec.serviceNetwork[*]}'2. How do you configure Egress and Namespace Egress for OpenShift?
Assign the label to nodes and create an EgressIP object:
oc label node <node-name> egress-assignable=
apiVersion: k8s.ovn.org/v1
kind: EgressIP
metadata:
name: example-egressip
spec:
egressIPs:
- 192.168.1.100
namespaceSelector:
matchLabels:
app: mynamespace
podSelector: {}3. How do you check which version of your OpenShift cluster?
oc version
oc get clusterversion4. What kind of authentication method is used for authenticating OpenShift?
OpenShift supports OAuth-based authentication, LDAP, and OpenID Connect. Check the configuration:
oc get oauth cluster -o yaml5. How do you troubleshoot the connectivity from POD to POD?
oc rsh <pod-name> ping <destination-pod-IP>
oc get networkpolicy -A
oc debug node/<node-name> -- chroot /host6. How do you configure routes to run on a specific set of nodes, for example, infra nodes?
oc label node <node-name> node-role.kubernetes.io/infra=
oc patch ingresscontroller default -n openshift-ingress-operator --type merge -p '
{
"spec": {
"nodePlacement": {
"nodeSelector": {
"matchLabels": {
"node-role.kubernetes.io/infra": ""
}
}
}
}
}'7. How do you make sure that you have a dedicated node for the infrastructure components?
oc label node <infra-node> node-role.kubernetes.io/infra=
oc adm taint nodes <infra-node> node-role.kubernetes.io/infra:NoSchedule8. What is the best monitoring tool to be used for OpenShift monitoring?
Prometheus and Grafana are the best tools for monitoring OpenShift.
9. How do you configure an alert in Prometheus?
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: custom-alerts
namespace: openshift-monitoring
spec:
groups:
- name: custom-rules
rules:
- alert: HighMemoryUsage
expr: node_memory_Active_bytes > 80
for: 5m
labels:
severity: critical
annotations:
summary: "High Memory Usage"
oc apply -f custom-alert.yaml10. What are the best logging tools for OpenShift?
Fluentd, Elasticsearch, Kibana, and Loki are popular logging tools for OpenShift.
11. How does the logging stack work in OpenShift?
OpenShift uses Fluentd for log collection, Elasticsearch for storage, Kibana for visualization, and Curator for log management.
12. How is the OpenShift upgrade done?
oc get clusterversion
oc adm upgrade --to-latest
watch oc get clusterversion13. What are the diagnostic tools for collecting logs and uploading them for support?
oc adm must-gather
oc logs -n openshift-logging
oc get events -A
oc adm inspect clusteroperators --dest-dir=<path>
Comments
Post a Comment