Skip to content

Instantly share code, notes, and snippets.

View chrischdi's full-sized avatar

Christian Schlotter chrischdi

View GitHub Profile
apiVersion: v1
kind: Service
metadata:
name: foo
labels:
app: foo
spec:
ports:
- port: 8080
name: web
diff --git a/pkg/util/mount/nsenter_mount.go b/pkg/util/mount/nsenter_mount.go
index 5f013bb7ce..0b0eca412d 100644
--- a/pkg/util/mount/nsenter_mount.go
+++ b/pkg/util/mount/nsenter_mount.go
@@ -167,6 +167,12 @@ func (n *NsenterMounter) IsLikelyNotMountPoint(file string) (bool, error) {
return true, err
}
+ // Check the directory is a corrupted mountpoint
+ if _, err = os.Stat(file); IsCorruptedMnt(err) {

Keybase proof

I hereby claim:

  • I am chrischdi on github.
  • I am chrischdi (https://keybase.io/chrischdi) on keybase.
  • I have a public key whose fingerprint is 91D6 B86B DAA4 E938 0896 E4E7 B9DE 486A 090A B7E0

To claim this, I am signing this object:

@chrischdi
chrischdi / memory.md
Created December 7, 2018 12:57
kubernetes-policy-agent memory

Here is how I start the policy-controller (args from container-spec snippet of a k8s pod):

    args:
      - --addr=https://127.0.0.1:7925
      - --tls-cert-file=/etc/kubernetes/ssl/policy-controller/policy-controller-cert.pem
      - --tls-private-key-file=/etc/kubernetes/ssl/policy-controller/policy-controller-key.key
      - --opa-url=https://localhost:8181/v1
      - --opa-ca-file=/etc/kubernetes/ssl/policy-controller/opa-ca.ca
      - --opa-auth-token-file=/etc/kubernetes/ssl/policy-controller/policy-controller.authorization.token
 - --log-level=info
@chrischdi
chrischdi / memory.md
Last active December 7, 2018 12:21
opa memory problem

Memory utilization: image

Snippet how opa is started (it is a container spec for a kubernetes pod):

  - name: opa
    image: reg-dhc.app.corpintra.net/caas/opa:0.10.1
    imagePullPolicy: Always
    args:
 - run
@chrischdi
chrischdi / hetzner.tf
Last active August 29, 2018 21:17
Gist containing a script to install a single-node kubernetes cluster using kubeadm and cri-containerd. Expanded by a terraform file how to deploy the script to hetzner cloud.
variable "hcloud_token" {
}
provider "hcloud" {
token = "${var.hcloud_token}"
}
resource "hcloud_server" "kube-master" {
name = "kube-master"
image = "ubuntu-18.04"
variable "hcloud_token" {
}
provider "hcloud" {
token = "${var.hcloud_token}"
}
resource "hcloud_server" "kube-master" {
name = "kube-master"
image = "ubuntu-18.04"
@chrischdi
chrischdi / Makefile
Last active August 29, 2015 14:06 — forked from daringer/Makefile
Asus Fan Control
obj-m := asus_fan.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
all:
$(MAKE) -C $(KDIR) M=$(PWD) modules
install:
# just copy the .ko file anywhere below:
# /lib/modules/$(uname -r)/