Skip to content

Instantly share code, notes, and snippets.

View rimusz's full-sized avatar

Rimantas (Rimas) Mocevicius rimusz

View GitHub Profile
@toricls
toricls / lima-on-m1-mac-installation-guide.md
Last active April 25, 2024 15:30
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima

@mitchellh
mitchellh / example.nix
Created May 10, 2020 16:29
Nix function for creating a derivation (package) that installs binaries from releases.hashicorp.com
self: super: {
consul-bin = self.callPackage ./hashicorp-generic.nix {
name = "consul";
version = "1.7.3";
sha256 = "0k03n7h5h8miqhh3n3y47894vhwdcp8m611w55f826swmq9angl1";
};
# and so on...
}
@alexellis
alexellis / inlets-kind.md
Last active January 19, 2021 07:19
Expose Kubernetes ClusterIP services with inlets.dev

KinD with inlets.dev

Expose Kubernetes ClusterIP services with inlets.dev

Get KinD:

# Linux

sudo curl -Lo /usr/local/bin/kind \
#!/usr/bin/env bash
set -e
set -o pipefail
kubectl proxy &
proxy_pid="$!"
trap 'kill "$proxy_pid"' EXIT
for ns in $(kubectl get namespace --field-selector=status.phase=Terminating --output=jsonpath="{.items[*].metadata.name}"); do
@mumoshu
mumoshu / helmify-kustomize
Last active April 15, 2024 10:49
Run `helmify-kustomize build $chart $env` in order to generate a local helm chart at `$chart/`, from kustomize overlay at `${chart}-kustomize/overlays/$env`
#!/usr/bin/env bash
cmd=$1
chart=$2
env=$3
dir=${chart}-kustomize
chart=${chart/.\//}
build() {
@alexellis
alexellis / job.yaml
Last active January 26, 2024 07:10
Use a Kubernetes Job and Kaniko to build an OpenFaaS function from Git
# Alex Ellis 2018
# Example from: https://blog.alexellis.io/quick-look-at-google-kaniko/
# Pre-steps:
# kubectl create secret generic docker-config --from-file $HOME/.docker/config.json
# Other potential optimizations (suggested by @errordeveloper)
# - Store "templates" in a permanent volume
# - Download source via "tar" instead of git clone
@ipedrazas
ipedrazas / deployment.go
Created June 25, 2018 12:51
From kubectl to GO lang type
// Generated by https://quicktype.io
type Deployment struct {
APIVersion string `json:"apiVersion"`
Kind string `json:"kind"`
Metadata DeploymentMetadata `json:"metadata"`
Spec DeploymentSpec `json:"spec"`
Status Status `json:"status"`
@Philmod
Philmod / cloudbuild.yaml
Created September 21, 2017 13:18
concurrent docker builds on Google Container Builder
steps:
- name: 'gcr.io/cloud-builders/docker'
args:
- 'build'
- '-f'
- 'Dockerfile.alpine'
- '-t'
- 'gcr.io/$PROJECT_ID/large-docker-alpine:latest'
- '.'
waitFor: ['-']
@ahmetb
ahmetb / gcrgc.sh
Last active May 10, 2024 15:17
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software

Google Compute Engine NFS Container VM

This script creates a Container VM on Google Compute Engine running a NFS V4 server exposed on Port 2049 with the /exports directory mounted to a persistent disk. This means:

  • If the NFS VM Crashes, the persistent disk will still hold the NFS Files
  • The persistent disk can be snapshotted to backup NFS Files

To run: