Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
#!/bin/bash | |
# | |
# Copy data from a Time Machine volume mounted on a Linux box. | |
# | |
# Usage: copy-from-time-machine.sh <source> <target> | |
# | |
# source: the source directory inside a time machine backup | |
# target: the target directory in which to copy the reconstructed | |
# directory trees. Created if it does not exists. | |
# |
#clone the repo | |
git clone http://git.ipxe.org/ipxe.git | |
cd ipxe/src | |
cat >ubuntu-amd64-installer.ipxe <<EOF | |
#!ipxe | |
dhcp | |
echo Starting Ubuntu x64 installer for ${hostname} | |
set base-url http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64 | |
kernel ${base-url}/linux |
groups: | |
- name: datetime | |
rules: | |
- record: daily_saving_time_belgium | |
expr: | | |
(vector(0) and (month() < 3 or month() > 10)) | |
or | |
(vector(1) and (month() > 3 and month() < 10)) | |
or | |
( |
oc debug node/ip-1-2-3-4.internal --image=registry.tld/namespace/image:tag
echo '{ "propagationPolicy": "Background" }' | curl -k -X DELETE -d @- -H "Authorization: Bearer $TOKEN" -H 'Accept: application/json' -H 'Content-Type: application/json' https://openshift-master.$DOMAIN/api/v1/namespaces/$NAMESPACE/pods/$PODNAME
ps -eo pid,etimes,comm,user | awk '{if ($3 = /haproxy/ && $2>43200) print $1}' | xargs kill -15
oc patch namespace $NAMESPACE -p '{"metadata":{"annotations":{"openshift.io/node-selector":"region=infra"}}}'
oc get nodes -Lname --output=jsonpath='{range .items[*].metadata}{.name}{" "}{.labels.name}{"\n"}'
[CoreDNS][coredns] was designed from the ground up to provide robust, plugin-based DNS server for use in cloud environments. Namely, it serves as the default primary service discovery mechanism for Kubernetes.
Using CoreDNS allows us to have a lightweight DNS server on RockNSM (11 Mb binary is all that's needed!) to facilitate multi-node service discovery. Alternatively, if another existing DNS service is available, this can be used instead. Aligning with the way the Kubernetes manages service discovery also allows us to build new RockNSM features in parallel with the coming Kubernetes support.
oc rsh -n default router-YY-XXXXX
)ps ax
)socat /var/lib/haproxy/run/haproxy.sock stdio
echo "prompt" | socat /var/lib/haproxy/run/haproxy.sock stdio
echo "help" | socat /var/lib/haproxy/run/haproxy.sock stdio
echo "show stat" | socat /var/lib/haproxy/run/haproxy.sock stdio
# after an accidental "oc delete pv --all" all PVs on the cluster are marked as "Terminating". | |
# As a result all PV have to be re-created, which is done by the script. | |
# Before force-deleting the PV, all deployments accessing the PV via PVC are being scaled down, and scaled up again afterwards. | |
# | |
# (by the way, the "Terminating" status is not a real status, but is what oc/kubectl print out | |
# when an object has a DeletionTimestamp, which is immutable and cannot be deleted anymore. See | |
# https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/describe/versioned/describe.go#L1374-L1378 | |
# if pv.ObjectMeta.DeletionTimestamp != nil { | |
# w.Write(LEVEL_0, "Status:\tTerminating (lasts %s)\n", translateTimestampSince(*pv.ObjectMeta.DeletionTimestamp)) | |
# } else { |
#!/bin/sh | |
# ref: https://piunikaweb.com/2019/03/25/samsung-galaxy-s10-remove-bundled-bloatwares-without-root/ | |
# install the following app to see the packages names: | |
# use the following command to generate the unistall command, for easy copy and paste: | |
# adb shell 'pm list packages' | sed -e 's/^/adb uninstall --user 0 /' | grep FILTER_HERE | sort | |
#things to install if removing keyboard | |
# F-Droid | |
# APK Analyser |