Skip to content

Instantly share code, notes, and snippets.

Install GRUB modules for BIOS and EFI:

yum install grub2-pc-modules grub2-efi-x64-modules

Install xorriso and mtools rpms that are used by grub2-mkrescue while creating the ISO image:

yum install xorriso mtools

The CDROM ISO image is in LOCKED status. ssh to the RHEV Engine VM and unlock the particular disk:

/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -t disk 6032270c-1cf7-4050-af4a-e903dd94b727

Unlock all objects:

/usr/share/ovirt-engine/setup/dbutils/unlock_entity.sh -t all

After RHVH restart, the RHEV Engine VM doesn't come up. SSH to RHVH:

# fetch etcd client credentials
FILES='
/etc/kubernetes/static-pod-resources/configmaps/etcd-serving-ca/ca-bundle.crt
/etc/kubernetes/static-pod-resources/secrets/etcd-client/tls.crt
/etc/kubernetes/static-pod-resources/secrets/etcd-client/tls.key
'
APISERVER_POD=$(oc get pod --namespace openshift-kube-apiserver --selector apiserver=true --output jsonpath='{.items[0].metadata.name}')

Forwarding logs to external LogStash (on-premise)

These instructions can be run from a command line using oc authenticated to the target cluster. They were derived from the OpenShift documentation for installing the Cluster Logging Operator using the CLI. Here is an ansible playbook that was also used during testing.

Create the namespace for logging

Create a file named logging_namespace.yml with the following content:

@noseka1
noseka1 / fluentd.conf
Last active July 25, 2020 15:33
Fluentd configuration
# dump all forwarded input to stdout
<source>
@type forward
bind 0.0.0.0
port 24224
</source>
<source>
@type forward
@noseka1
noseka1 / nfs-client-pod.yaml
Created July 31, 2020 22:39
Mount NFS on pod
apiVersion: v1
kind: Pod
metadata:
name: nfs-client
spec:
containers:
- image: quay.io/noseka1/openshift-toolbox:basic
name: openshift-toolbox
volumeMounts:
- name: nfs-volume
@noseka1
noseka1 / mount-nfs-clusterrole.yaml
Last active August 7, 2020 15:55
Allow cluster-wide mounting of NFS volumes
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: mount-nfs
rules:
- apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
verbs:

CodeReady Containers

Configuring CRC

$ ./crc config set consent-telemetry yes
$ ./crc config set disable-update-check false
@noseka1
noseka1 / Using jq with Kubernetes and OpenShift.md
Last active August 19, 2021 16:37
Using jq with Kubernetes and OpenShift

Examples

$ oc get pod <POD_NAME> -o json | jq -r '.spec.volumes[] | select(.name=="config").secret.secretName'

References

JSONPath in kubectl CLI.md