Skip to content

Instantly share code, notes, and snippets.

View bryanl's full-sized avatar
🚩
Out in the streets

Bryan Liles bryanl

🚩
Out in the streets
View GitHub Profile
# Copyright 2018 The Knative Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2 # tells deployment to run 2 pods matching the template
template:
@bryanl
bryanl / hungry.yaml
Created December 2, 2019 17:40
hungry
apiVersion: v1
kind: Namespace
metadata:
name: lab-5
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
lab: lab-5
package main
import (
"flag"
"log"
"os"
"os/exec"
"path/filepath"
"github.com/sirupsen/logrus"
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:aggregated-metrics-reader
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["metrics.k8s.io"]
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: httpbin
project: httpbin
name: httpbin
spec:
replicas: 1
selector:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: crontabs.stable.example.com
spec:
group: stable.example.com
versions:
- name: v1
served: true
storage: true
[I] ➜ go tool pprof http://localhost:3001/debug/pprof/heap
Fetching profile over HTTP from http://localhost:3001/debug/pprof/heap
Saved profile in /Users/bryan/pprof/pprof.alloc_objects.alloc_space.inuse_objects.inuse_space.013.pb.gz
Type: inuse_space
Time: Aug 1, 2019 at 3:28pm (EDT)
Entering interactive mode (type "help" for commands, "o" for options)
(pprof) top
Showing nodes accounting for 676.12MB, 90.43% of 747.64MB total
Dropped 171 nodes (cum <= 3.74MB)
Showing top 10 nodes out of 94
package objectstore
import (
"sync"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/types"
"github.com/vmware/octant/third_party/k8s.io/client-go/dynamic/dynamicinformer"
/*
Copyright (c) 2019 VMware, Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"context"
"fmt"