Skip to content

Instantly share code, notes, and snippets.

View pingkunga's full-sized avatar
🎯
Focusing

Chatri Ngambenchawong pingkunga

🎯
Focusing
View GitHub Profile
@pingkunga
pingkunga / testreadiness.yaml
Created November 19, 2023 02:45
Sample Simulate Readiness
apiVersion: apps/v1
kind: Deployment
metadata:
name: busybox-deployment
spec:
replicas: 1
selector:
matchLabels:
app: busybox
template:
@pingkunga
pingkunga / ุถามเพิ่ม
Created November 12, 2023 03:19
ุถามเพิ่มข้อ 4
ถามเพิ่ม สงสัยอันนี้
```
apiVersion: apps/v1
kind: Deployment
metadata:
creationTimestamp: null
labels:
app: pingd
name: pingd
@pingkunga
pingkunga / metric-server.yaml
Created November 8, 2023 10:34
metric-server for K8S via docker-desktop 4.24.2
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: metrics-server
name: metrics-server
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@pingkunga
pingkunga / Error Metric Server
Created November 7, 2023 23:26
Error Metric Server
controlplane $ kubectl describe pod metrics-server-5d79fcb458-cx7rp
Error from server (NotFound): pods "metrics-server-5d79fcb458-cx7rp" not found
controlplane $ kubectl get pod metrics-server-5d79fcb458-cx7rp
Error from server (NotFound): pods "metrics-server-5d79fcb458-cx7rp" not found
controlplane $ kubectl describe pod metrics-server-5d79fcb458-cx7rp -n kube-system
Name: metrics-server-5d79fcb458-cx7rp
Namespace: kube-system
Priority: 2000000000
Priority Class Name: system-cluster-critical
Service Account: metrics-server
@pingkunga
pingkunga / downwardapi_sample.yaml
Created November 4, 2023 21:34
downwardapi_sample
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
release: stable
environment: dev
tier: frontend
app.kubernetes.io/name: "inv-app"
@pingkunga
pingkunga / Pod Life Cycle
Created October 27, 2023 06:34
K8S Pod Life Cycle
stateDiagram-v2
Pending: Pending
note left of Pending
kube-scheduler หา node
pod pull image / create container
end note
Running: Running
note left of Running
At least one container is still running,
or is in the process of starting or restarting
@pingkunga
pingkunga / Dockerfile
Last active October 4, 2023 05:18
Light Weight Container with docker git zip and basic security
FROM alpine:latest
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
RUN apk --update add zip git curl --no-cache
RUN apk cache clean
RUN adduser -D invs
RUN rm -rf /bin/cat
RUN rm -rf /bin/touch
RUN rm -rf /bin/ls
RUN rm -rf /bin/touch
RUN rm -rf /bin/sh
@pingkunga
pingkunga / VBAExcelToPipeDelimitedFile
Last active September 19, 2023 08:53
VBA Convert Excel to Pipe Delimited File
'How to
' 1. Aceess VBA Project (ALT + F11)
' 2. Add Module
' 3. Tools > References : Add a reference to Microsoft VBScript Regular Expressions 5.5
' 4. Paste Code and Run
'Ref: https://stackoverflow.com/questions/25184019/trim-all-types-of-whitespace-including-tabs
Sub ExcelToPipeDelimitedText()
Const Delimiter As String = "|"
Dim iSheet As Worksheet
@pingkunga
pingkunga / excalidraw_https_with_traefik.yaml
Created September 9, 2023 23:51
docker compose excalidraw https with traefik
version: '3.3'
services:
traefik2:
image: traefik:latest
restart: always
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
public class InvsRequestHandler : AbstractBaseRequestHandler, IRTRequestHandler
{
protected override void run()
{
try
{
while (true)
{
NetworkStream ns = clientSocket.GetStream();
StringBuilder response = new StringBuilder();