Skip to content

Instantly share code, notes, and snippets.

...
- initcontainers
- name: blocker
- command:
- sh
- -x
- -c
- |
broken = true
till_not_broken broken:

k8sgpt

Per https://k8sgpt.ai/

K8sGPT is a tool for scanning your kubernetes clusters, diagnosing and triaging issues in simple english. It has SRE experience codified into its analyzers and helps to pull out the most relevant information to enrich it with AI.

K8sGPT Is For…

  • Workload health analysis - Find critical issues with your workloads.
  • Fast triage, AI analysis - Look at your cluster a glance or use AI to analyze your cluster in depth
@ronaldpetty
ronaldpetty / 1_4_fullsync.md
Created February 22, 2024 05:10
full 1.4 sync
ubuntu@ip-172-31-16-114:~$ script -B forMW.log -T -E always
Script started, output log file is 'forMW.log', input log file is 'forMW.log', timing file is '-E'.
ubuntu@ip-172-31-16-114:~$ kubectl apply -f ./deploykf-app-of-apps.yaml
application.argoproj.io/deploykf-app-of-apps created
ubuntu@ip-172-31-16-114:~$ bash ./deploykf/scripts/sync_argocd_apps.sh

==========================================================================================
Getting admin password from 'Secret/argocd-initial-admin-secret'...
==========================================================================================
ubuntu@ip-172-31-16-114:~$ bash ./deploykf/scripts/sync_argocd_apps.sh >& 1_4_sync.log
ubuntu@ip-172-31-16-114:~$ cat 1_4_sync.log 
E0222 04:27:27.583819  203292 portforward.go:379] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:40663->127.0.0.1:45624: write tcp4 127.0.0.1:40663->127.0.0.1:45624: write: broken pipe
E0222 04:27:37.892570  203292 portforward.go:379] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:40663->127.0.0.1:42474: write tcp4 127.0.0.1:40663->127.0.0.1:42474: write: broken pipe
E0222 04:27:37.905920  203292 portforward.go:379] error copying from remote stream to local connection: readfrom tcp4 127.0.0.1:40663->127.0.0.1:42476: write tcp4 127.0.0.1:40663->127.0.0.1:42476: write: broken pipe
time="2024-02-22T04:27:37Z" level=fatal msg="Operation has completed with phase: Failed"
TIMESTAMP                  GROUP                            KIND            NAMESPACE                     NAME                              STATUS    H

WARNING

t3.large (2/8) is not enough (cpu) t3.xlarge (4/16) is not enough (cpu) t3.2xlarge (8/32) trying...

# got "too many files" during kubeflow install
sudo sysctl fs.inotify.max_user_watches=524288
sudo sysctl fs.inotify.max_user_instances=512
@ronaldpetty
ronaldpetty / kafka-clients-sample.md
Created October 4, 2023 14:26
Kafka client sample
## FORMAT
```
$ curl -sLO https://rx-m-data.s3.us-west-1.amazonaws.com/tree_of_life.zip
$ unzip tree_of_life.zip
[rocky@ip-172-31-22-94 demo_big_graph]$ head -n 2 treeoflife_nodes.csv
node_id,node_name,child_nodes,leaf_node,tolorg_link,extinct,confidence,phylesis
@ronaldpetty
ronaldpetty / md
Created August 19, 2022 18:29
post reboot steps
```
if [ -z ${K8S_VERSION+x} ]; then K8S_VERSION="--kubernetes-version=stable-1" ; else K8S_VERSION="--kubernetes-version=$K8S_VERSION"; fi
sudo kubeadm init --cri-socket=unix:///run/cri-dockerd.sock $K8S_VERSION
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
kubectl taint node --all node-role.kubernetes.io/master-
kubectl taint node --all node-role.kubernetes.io/control-plane-
```
@ronaldpetty
ronaldpetty / md
Created July 29, 2022 17:30
sa core example
![](images/2022-07-28-15-30-32.png)
```
~$ pip install SQLAlchemy
Defaulting to user installation because normal site-packages is not writeable
Collecting SQLAlchemy
Downloading SQLAlchemy-1.4.39-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 8.5 MB/s eta 0:00:00
import threading
import time
class X:
def __init__(self):
self.a = 1
self.b = 2
self.lock = threading.RLock()
def changeA(self):