Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yusuke Kuoka mumoshu

🏠
Working from home
View GitHub Profile
@mumoshu
mumoshu / main.go
Created Jan 17, 2021
errgroup.Groupの亜種(一時的なエラーの場合は部分的に再試行し、そうでなければ全て中止する)
View main.go
package main
import (
"context"
"errors"
"fmt"
"os"
"strings"
"sync"
"time"
@mumoshu
mumoshu / main.go
Last active Jan 17, 2021
errgroup.Groupの亜種(最初のエラーで他のgoroutineをキャンセルする)
View main.go
package main
import (
"context"
"errors"
"fmt"
"os"
"sync"
"time"
)
View gist:e42e8a319aab6885916270cd3c4d0c35
metric {
provider = "cloudwatch"
max = 10
query = <<EOS
[
{
"Id": "e1",
"Expression": "m1",
"Label": "ErrorCount"
},
View all.yaml
---
# 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
View github-actions-chatops-template.yaml
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
View app-of-apps.yaml
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 Dec 17, 2019
Datadog for EKS on Fargate
View datadog-cluster-agent.yaml
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 Dec 15, 2019
EKS on Fargate Datadog and Fluentbit sidecars example
View testapp.deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: testapp
name: testapp
spec:
replicas: 1
selector:
matchLabels:
@mumoshu
mumoshu / podinfo.demo.virtualnode.yaml
Last active Dec 14, 2019
AppMesh on EKS examples. Assume the cluster name is `test3`
View podinfo.demo.virtualnode.yaml
apiVersion: appmesh.k8s.aws/v1alpha1
kind: VirtualNode
metadata:
# Matches APPMESH_VIRTUAL_NODE_NAME=mesh/global/virtualNode/podinfo-demo envvar injected to pods by appmesh-inject
# so that appmesh-controller can locate this virtual node from the pod
name: podinfo
namespace: demo
spec:
meshName: global
listeners:
View eksctl-apply.sh
#!/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