Skip to content

Instantly share code, notes, and snippets.

View mumoshu's full-sized avatar
🏠
Working from home

Yusuke Kuoka mumoshu

🏠
Working from home
View GitHub Profile
@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() {
@mumoshu
mumoshu / dockerbuild.sh
Created March 13, 2018 06:07
An example of secure, cacheful docker-multistage-build
#!/bin/bash
if [ ! -z "$DEBUG" ]; then
set -vx
fi
set -eu
REGISTRY=${REGISTRY:-}
if [ ! -z "${REGISTRY}" ]; then
FROM alpine:3.4
RUN apk --no-cache --update add bash curl less groff jq python py-pip && \
pip install awscli s3cmd https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz && \
apk del remove py-pip && \
mkdir /root/.aws
@mumoshu
mumoshu / action.yml
Created October 8, 2019 05:38
GitHub Actions v2 Gotcha: It seems like we're unable to use ${{ inputs.. }} from within `runs.using` of action.yml :(
name: 'VariantRun'
description: 'Run Variant task defined in your Variantfile https://github.com/mumoshu/variant'
inputs:
image:
description: 'Docker image for Variant containers'
required: false
default: 'Dockerfile'
runs:
using: 'docker'
image: '${{ inputs.image }}'
@mumoshu
mumoshu / setup.sh
Last active August 22, 2022 09:58 — forked from h3poteto/setup.sh
Setup Kubernetes using kubeadm. In case you provided a wrong control-plane node address, run `sudo kubeadm reset` and try again.
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "controle-plane-endpoint is required" 1>&2
exit 1
fi
CONTROLE_PLANE_ENDPOINT=$1
#!/usr/bin/env bash
set -e
if eksctl get cluster -f $FILE >/dev/null 2>&1; then
# See https://github.com/weaveworks/eksctl/blob/33ec1ed967c1ad03c985bf18774ea970d85c86f1/site/content/usage/03-cluster-upgrade.md#L41
eksctl update cluster -f $FILE
eksctl utils update-kube-proxy
eksctl utils update-aws-node
eksctl utils update-coredns
default, argocd-application-controller, ServiceAccount (v1) has changed:
# Source: helm-diff-dependencies/charts/argo-cd/templates/argocd-application-controller/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: true
metadata:
name: argocd-application-controller
labels:
helm.sh/chart: argo-cd-3.11.5
- app.kubernetes.io/name: argocd-override-application-controller
@mumoshu
mumoshu / build.sbt
Created January 10, 2012 06:08
DES and AES encryption in Scala
name := "DES and AES encryption in Scala"
version := "1.0"
scalaVersion := "2.9.1"
libraryDependencies += "commons-codec" % "commons-codec" % "1.6"
@mumoshu
mumoshu / main.go
Last active January 17, 2021 03:12
errgroup.Groupの亜種(最初のエラーで他のgoroutineをキャンセルする)
package main
import (
"context"
"errors"
"fmt"
"os"
"sync"
"time"
)
@mumoshu
mumoshu / main.go
Created January 17, 2021 03:12
errgroup.Groupの亜種(一時的なエラーの場合は部分的に再試行し、そうでなければ全て中止する)
package main
import (
"context"
"errors"
"fmt"
"os"
"strings"
"sync"
"time"