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 / 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
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 / main.go
Created January 17, 2021 03:12
errgroup.Groupの亜種(一時的なエラーの場合は部分的に再試行し、そうでなければ全て中止する)
package main
import (
"context"
"errors"
"fmt"
"os"
"strings"
"sync"
"time"
@mumoshu
mumoshu / main.go
Last active January 17, 2021 03:12
errgroup.Groupの亜種(最初のエラーで他のgoroutineをキャンセルする)
package main
import (
"context"
"errors"
"fmt"
"os"
"sync"
"time"
)
metric {
provider = "cloudwatch"
max = 10
query = <<EOS
[
{
"Id": "e1",
"Expression": "m1",
"Label": "ErrorCount"
},
---
# Source: datadog/charts/kube-state-metrics/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/name: kube-state-metrics
helm.sh/chart: kube-state-metrics-2.8.4
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: datadog
name: Pull Request ChatOps Template
on:
# https://help.github.com/en/articles/events-that-trigger-workflows#issue-comment-event-issue_comment
issue_comment:
types: [created]
jobs:
example:
name: Example ChatOps command
runs-on: ubuntu-latest
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: apps
namespace: kube-system
spec:
project: default
source:
repoURL: https://github.com/mumoshu/configrepo.git
targetRevision: HEAD
@mumoshu
mumoshu / datadog-cluster-agent.yaml
Created December 17, 2019 06:12
Datadog for EKS on Fargate
kind: ServiceAccount
apiVersion: v1
metadata:
name: datadog-cluster-agent
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: datadog-cluster-agent
@mumoshu
mumoshu / testapp.deployment.yaml
Created December 15, 2019 02:54
EKS on Fargate Datadog and Fluentbit sidecars example
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: testapp
name: testapp
spec:
replicas: 1
selector:
matchLabels: