Skip to content

Instantly share code, notes, and snippets.

@mrunalp
mrunalp / test_vm.sh
Created April 27, 2017 21:34
Spawn a VM and run tests.
#!/bin/bash -ue
usage()
{
cat << _EOF_
Usage: $0 options
OPTIONS:
-h Display help.
-i Path to the image.
{
"ociVersion": "1.0.0-rc5-dev",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": true,
"user": {
"uid": 0,
package main
import (
"fmt"
"log"
"os"
"syscall"
"time"
)
diff --git a/cmd/kpod/load.go b/cmd/kpod/load.go
index ae346bc8..97783682 100644
--- a/cmd/kpod/load.go
+++ b/cmd/kpod/load.go
@@ -1,6 +1,8 @@
package main
import (
+ "fmt"
+ "os"
kubeletArguments:
container-runtime:
- remote
container-runtime-endpoint:
- /var/run/crio.sock
experimental-cri:
- 'true'
image-service-endpoint:
- /var/run/crio.sock
node-labels:
{
"default": [
{
"type": "insecureAcceptAnything"
}
],
"transports":
{
"docker-daemon":
{
@mrunalp
mrunalp / build_docker.sh
Created September 19, 2017 20:27
build_docker.sh
set -e
set -x
RUNC_GOPATH="$(mktemp -d)"
CONTAINERD_GOPATH="$(mktemp -d)"
PWD="$(pwd)"
function cleanup() {
rm -rf "${RUNC_GOPATH}"
rm -rf "${CONTAINERD_GOPATH}"
package crierrors
import "errors"
import "google.golang.org/grpc/codes"
import "google.golang.org/grpc/status"
var (
// ErrNotFound is a an error epresenting an object not found
// like a pod or a container.
ErrNotFound = errors.New("cri: not found")
@mrunalp
mrunalp / execute_disable.txt
Created May 20, 2022 01:21
OpenShift executable disable
[mrunalp@fedora ~]$ oc debug node/ci-ln-448x92k-72292-wppv7-worker-a-v29zc
W0519 18:18:56.438639 166726 warnings.go:70] would violate PodSecurity "restricted:latest": host namespaces (hostNetwork=true, hostPID=true), hostPath volumes (volume "host"), privileged (container "container-00" must not set securityContext.privileged=true), allowPrivilegeEscalation != false (container "container-00" must set securityContext.allowPrivilegeEscalation=false), unrestricted capabilities (container "container-00" must set securityContext.capabilities.drop=["ALL"]), restricted volume types (volume "host" uses restricted volume type "hostPath"), runAsNonRoot != true (pod or container "container-00" must set securityContext.runAsNonRoot=true), runAsUser=0 (container "container-00" must not set runAsUser=0), seccompProfile (pod or container "container-00" must set securityContext.seccompProfile.type to "RuntimeDefault" or "Localhost")
Starting pod/ci-ln-448x92k-72292-wppv7-worker-a-v29zc-debug ...
To use host binaries, run `c
apiVersion: v1
kind: Pod
metadata:
name: httpd
spec:
containers:
- name: httpd
image: httpd:2.4-alpine