Skip to content

Instantly share code, notes, and snippets.

View lucj's full-sized avatar

Luc lucj

View GitHub Profile
@lucj
lucj / openfunction.log
Created January 13, 2022 08:18
openfunction controller logs
root@faas:~# k logs -n openfunction openfunction-controller-manager-9b69b8c7b-qt97s -c openfunction
I0113 08:10:16.188135 1 request.go:668] Waited for 1.026255862s due to client-side throttling, not priority and fairness, request: GET:https://10.96.0.1:443/apis/external.metrics.k8s.io/v1beta1?timeout=32s
2022-01-13T08:10:16.695Z INFO controller-runtime.metrics metrics server is starting to listen {"addr": "127.0.0.1:8080"}
2022-01-13T08:10:16.696Z INFO controller-runtime.builder Registering a mutating webhook {"GVK": "core.openfunction.io/v1alpha2, Kind=Serving", "path": "/mutate-core-openfunction-io-v1alpha2-serving"}
2022-01-13T08:10:16.696Z INFO controller-runtime.webhook registering webhook {"path": "/mutate-core-openfunction-io-v1alpha2-serving"}
2022-01-13T08:10:16.696Z INFO controller-runtime.builder skip registering a validating webhook, admission.Validator interface is not implemented {"GVK": "core.openfunction.io/v1alpha2, Kind=Serving"}
2022-01-13T08:10:16.696Z INFO controller-runtime.webhook
@lucj
lucj / config-sample.yaml
Created July 18, 2021 13:23
Default configuration of a KubeKey cluster
apiVersion: kubekey.kubesphere.io/v1alpha1
kind: Cluster
metadata:
name: sample
spec:
hosts:
- {name: node1, address: 172.16.0.2, internalAddress: 172.16.0.2, user: ubuntu, password: Qcloud@123}
- {name: node2, address: 172.16.0.3, internalAddress: 172.16.0.3, user: ubuntu, password: Qcloud@123}
roleGroups:
etcd:
@lucj
lucj / resources.yaml
Created June 29, 2021 12:51
"docker compose convert" for the kube backend
README.md
---------
This chart was created by converting a Compose file
Chart.yaml
----------
name: vote
description: A generated Helm Chart for vote from Skippbox Kompose
version: 0.0.1
apiVersion: v1
keywords:
@lucj
lucj / gvisor-install.sh
Created February 10, 2021 18:07
gVisor installation
(
set -e
URL=https://storage.googleapis.com/gvisor/releases/release/latest
wget ${URL}/runsc ${URL}/runsc.sha512 \
${URL}/gvisor-containerd-shim ${URL}/gvisor-containerd-shim.sha512 \
${URL}/containerd-shim-runsc-v1 ${URL}/containerd-shim-runsc-v1.sha512
sha512sum -c runsc.sha512 \
-c gvisor-containerd-shim.sha512 \
-c containerd-shim-runsc-v1.sha512
rm -f *.sha512
@lucj
lucj / kc-deploy.yml
Created January 21, 2021 21:02
Keycloak - Postgres
apiVersion: apps/v1
kind: Deployment
metadata:
name: keycloak
labels:
app: keycloak
spec:
selector:
matchLabels:
app: keycloak
@lucj
lucj / docker-compose.yaml
Created January 7, 2021 09:50
fluent-bit / loki / grafana on Docker Swarm
version: '3.8'
configs:
loki-conf:
file: ./loki.conf
fluent-bit-conf:
file: ./fluent-bit.conf
networks:
monitoring:
gateway {
name: "EXTERNAL"
listen: "0.0.0.0:7222"
authorization {
user: gwu
password: gwp
}
gateways: [
{name: "INTERNAL", url: "nats://gwu:gwp@internal1:7222"},
@lucj
lucj / k3s-multipass.sh
Created December 17, 2019 21:16
Setup a k3s kubernetes cluster using Multipass VMs
for node in node1 node2 node3;do
multipass launch -n $node
done
# Init cluster on node1
multipass exec node1 -- bash -c "curl -sfL https://get.k3s.io | sh -"
# Get node1's IP
IP=$(multipass info node1 | grep IPv4 | awk '{print $2}')
@lucj
lucj / consumer-mTLS.py
Created November 11, 2019 17:27
NATS consumer - mTLS
import asyncio
import json
import ssl
import sys
from nats.aio.client import Client as NATS
async def error_cb(e):
print("Error:", e)
async def run(loop):
@lucj
lucj / consumer.py
Created November 11, 2019 17:09
NATS subscriber
import asyncio
import json
import ssl
import sys
from nats.aio.client import Client as NATS
async def error_cb(e):
print("Error:", e)
async def run(loop):