Skip to content

Commit c6457aa

Browse files
committed
Add the basics for Helm installation
0 parents  commit c6457aa

16 files changed

+2260
-0
lines changed

.github/actions/ci.yaml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
6+
pull_request:
7+
8+
workflow_dispatch:
9+
10+
permissions:
11+
actions: none
12+
checks: none
13+
contents: read
14+
deployments: none
15+
issues: none
16+
packages: none
17+
pull-requests: none
18+
repository-projects: none
19+
security-events: none
20+
statuses: none
21+
22+
# Cancel in-progress runs for pull requests when developers push
23+
# additional changes
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
27+
28+
jobs:
29+
test:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
35+
- name: Echo Go Cache Paths
36+
id: go-cache-paths
37+
run: |
38+
echo "GOCACHE=$(go env GOCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
39+
echo "GOMODCACHE=$(go env GOMODCACHE)" >> ${{ runner.os == 'Windows' && '$env:' || '$' }}GITHUB_OUTPUT
40+
41+
- name: Go Build Cache
42+
uses: actions/cache@v3
43+
with:
44+
path: ${{ steps.go-cache-paths.outputs.GOCACHE }}
45+
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.**', '**.go') }}
46+
47+
# Install Go!
48+
- uses: actions/setup-go@v3
49+
with:
50+
go-version: "~1.20"
51+
52+
- name: Test
53+
run: go test ./...

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coder-logstream-kube
2+
build

.helmignore

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.vscode
2+
*.mod
3+
*.sum
4+
*.go
5+
*.md
6+
scripts/
7+
build/
8+
.github/
9+
.git/
10+
.gitignore
11+
.helmignore

Chart.yaml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: v2
2+
name: coder-logstream-kube
3+
description: Stream Kubernetes Pod events to the Coder startup logs
4+
home: https://github.com/coder/coder-logstream-kube
5+
6+
# version and appVersion are injected at release and will always be shown as
7+
# 0.1.0 in the repository.
8+
#
9+
# If you're installing the Helm chart directly from git it will have this
10+
# version, which means the auto-generated image URI will be invalid. You can set
11+
# "image.tag" to the desired tag manually.
12+
type: application
13+
version: "0.1.0"
14+
appVersion: "0.1.0"
15+
16+
# This matches the required version from Coder.
17+
kubeVersion: ">= 1.19.0-0"
18+
19+
keywords:
20+
- coder
21+
- terraform
22+
sources:
23+
- https://github.com/coder/coder-logstream-kube/tree/main
24+
icon: https://helm.coder.com/coder_logo_black.png
25+
maintainers:
26+
- name: Coder Technologies, Inc.
27+
28+
url: https://coder.com/contact

README.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# coder-logstream-kube
2+
3+
[![discord](https://img.shields.io/discord/747933592273027093?label=discord)](https://discord.gg/coder)
4+
[![release](https://img.shields.io/github/v/tag/coder/coder-logstream-kube)](https://github.com/coder/envbuilder/pkgs/container/coder-logstream-kube)
5+
[![godoc](https://pkg.go.dev/badge/github.com/coder/coder-logstream-kube.svg)](https://pkg.go.dev/github.com/coder/coder-logstream-kube)
6+
[![license](https://img.shields.io/github/license/coder/coder-logstream-kube)](./LICENSE)
7+
8+
Stream Kubernetes Pod events to the Coder startup logs.
9+
10+
- Easily determine the reason for a pod provision failure, or why a pod is stuck in a pending state.
11+
- Visibility into when pods are OOMKilled, or when they are evicted.
12+
- Filter by namespace, field selector, and label selector to reduce Kubernetes API load.
13+
14+
![Log Stream](./scripts/demo.png)
15+
16+
## Usage
17+
18+
Apply the Helm chart to start streaming logs into your Coder instance:
19+
20+
```console
21+
helm repo add coder-v2 https://helm.coder.com/v2
22+
helm install coder-logstream-kube coder-v2/coder-logstream-kube \
23+
--namespace coder \
24+
--set url=<your-coder-url>
25+
```
26+
27+
> *Note*
28+
> For additional customization (like customizing the image, pull secrets, annotations, etc.), you can use the
29+
> [values.yaml](https://github.com/coder/coder-logstream-kube/blob/main/values.yaml) file directly.
30+
31+
Ensure your Coder template is using a `kubernetes_deployment` resource with the `wait_for_rollout` property set to false.
32+
33+
```hcl
34+
resource "kubernetes_deployment" "hello_world" {
35+
wait_for_rollout = false
36+
...
37+
}
38+
```
39+
40+
This will ensure all pod events will be sent during initialization and startup.

go.mod

+191
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
module github.com/coder/coder-kubernetes-logs
2+
3+
go 1.20
4+
5+
// Required to import the codersdk!
6+
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20230418202606-ed9307cf1b22
7+
8+
require (
9+
cdr.dev/slog v1.5.3
10+
github.com/coder/coder v0.23.6-0.20230522192129-95839109db09
11+
github.com/coder/retry v1.3.1-0.20230210155434-e90a2e1e091d
12+
github.com/spf13/cobra v1.7.0
13+
github.com/stretchr/testify v1.8.2
14+
github.com/zeebo/assert v1.3.0
15+
k8s.io/api v0.27.1
16+
k8s.io/apimachinery v0.27.1
17+
k8s.io/client-go v0.27.1
18+
)
19+
20+
require (
21+
cloud.google.com/go/compute v1.19.0 // indirect
22+
cloud.google.com/go/compute/metadata v0.2.3 // indirect
23+
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
24+
github.com/Microsoft/go-winio v0.6.0 // indirect
25+
github.com/OneOfOne/xxhash v1.2.8 // indirect
26+
github.com/agext/levenshtein v1.2.3 // indirect
27+
github.com/agnivade/levenshtein v1.1.1 // indirect
28+
github.com/akutz/memconn v0.1.0 // indirect
29+
github.com/alexbrainman/sspi v0.0.0-20210105120005-909beea2cc74 // indirect
30+
github.com/ammario/tlru v0.3.0 // indirect
31+
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
32+
github.com/armon/go-radix v1.0.0 // indirect
33+
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
34+
github.com/beorn7/perks v1.0.1 // indirect
35+
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
36+
github.com/cespare/xxhash/v2 v2.2.0 // indirect
37+
github.com/charmbracelet/lipgloss v0.7.1 // indirect
38+
github.com/coder/terraform-provider-coder v0.6.23 // indirect
39+
github.com/coreos/go-iptables v0.6.0 // indirect
40+
github.com/coreos/go-oidc/v3 v3.6.0 // indirect
41+
github.com/davecgh/go-spew v1.1.1 // indirect
42+
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
43+
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
44+
github.com/fatih/color v1.15.0 // indirect
45+
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
46+
github.com/ghodss/yaml v1.0.0 // indirect
47+
github.com/go-chi/chi/v5 v5.0.8 // indirect
48+
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
49+
github.com/go-logr/logr v1.2.4 // indirect
50+
github.com/go-logr/stdr v1.2.2 // indirect
51+
github.com/go-ole/go-ole v1.2.6 // indirect
52+
github.com/go-openapi/jsonpointer v0.19.6 // indirect
53+
github.com/go-openapi/jsonreference v0.20.1 // indirect
54+
github.com/go-openapi/swag v0.22.3 // indirect
55+
github.com/gobwas/glob v0.2.3 // indirect
56+
github.com/godbus/dbus/v5 v5.1.0 // indirect
57+
github.com/gogo/protobuf v1.3.2 // indirect
58+
github.com/golang/glog v1.0.0 // indirect
59+
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
60+
github.com/golang/protobuf v1.5.3 // indirect
61+
github.com/google/btree v1.1.2 // indirect
62+
github.com/google/gnostic v0.5.7-v3refs // indirect
63+
github.com/google/go-cmp v0.5.9 // indirect
64+
github.com/google/gofuzz v1.1.0 // indirect
65+
github.com/google/uuid v1.3.0 // indirect
66+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.1 // indirect
67+
github.com/hashicorp/errwrap v1.1.0 // indirect
68+
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
69+
github.com/hashicorp/go-hclog v1.2.1 // indirect
70+
github.com/hashicorp/go-multierror v1.1.1 // indirect
71+
github.com/hashicorp/go-uuid v1.0.3 // indirect
72+
github.com/hashicorp/go-version v1.6.0 // indirect
73+
github.com/hashicorp/golang-lru/v2 v2.0.1 // indirect
74+
github.com/hashicorp/hcl/v2 v2.14.0 // indirect
75+
github.com/hashicorp/logutils v1.0.0 // indirect
76+
github.com/hashicorp/terraform-plugin-go v0.12.0 // indirect
77+
github.com/hashicorp/terraform-plugin-log v0.7.0 // indirect
78+
github.com/hashicorp/terraform-plugin-sdk/v2 v2.20.0 // indirect
79+
github.com/hashicorp/yamux v0.0.0-20220718163420-dd80a7ee44ce // indirect
80+
github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect
81+
github.com/illarion/gonotify v1.0.1 // indirect
82+
github.com/imdario/mergo v0.3.13 // indirect
83+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
84+
github.com/insomniacslk/dhcp v0.0.0-20221215072855-de60144f33f8 // indirect
85+
github.com/jmoiron/sqlx v1.3.5 // indirect
86+
github.com/josharian/intern v1.0.0 // indirect
87+
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
88+
github.com/jsimonetti/rtnetlink v1.1.2-0.20220408201609-d380b505068b // indirect
89+
github.com/json-iterator/go v1.1.12 // indirect
90+
github.com/klauspost/compress v1.16.3 // indirect
91+
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
92+
github.com/lib/pq v1.10.6 // indirect
93+
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
94+
github.com/mailru/easyjson v0.7.7 // indirect
95+
github.com/mattn/go-colorable v0.1.13 // indirect
96+
github.com/mattn/go-isatty v0.0.18 // indirect
97+
github.com/mattn/go-runewidth v0.0.14 // indirect
98+
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
99+
github.com/mdlayher/genetlink v1.2.0 // indirect
100+
github.com/mdlayher/netlink v1.6.2 // indirect
101+
github.com/mdlayher/sdnotify v1.0.0 // indirect
102+
github.com/mdlayher/socket v0.2.3 // indirect
103+
github.com/mitchellh/copystructure v1.2.0 // indirect
104+
github.com/mitchellh/go-ps v1.0.0 // indirect
105+
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
106+
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
107+
github.com/mitchellh/mapstructure v1.5.0 // indirect
108+
github.com/mitchellh/reflectwalk v1.0.2 // indirect
109+
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
110+
github.com/modern-go/reflect2 v1.0.2 // indirect
111+
github.com/muesli/reflow v0.3.0 // indirect
112+
github.com/muesli/termenv v0.15.1 // indirect
113+
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
114+
github.com/open-policy-agent/opa v0.51.0 // indirect
115+
github.com/pkg/errors v0.9.1 // indirect
116+
github.com/pmezard/go-difflib v1.0.0 // indirect
117+
github.com/prometheus/client_golang v1.14.0 // indirect
118+
github.com/prometheus/client_model v0.3.0 // indirect
119+
github.com/prometheus/common v0.40.0 // indirect
120+
github.com/prometheus/procfs v0.9.0 // indirect
121+
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
122+
github.com/rivo/uniseg v0.4.4 // indirect
123+
github.com/spf13/pflag v1.0.5 // indirect
124+
github.com/tabbed/pqtype v0.1.1 // indirect
125+
github.com/tailscale/certstore v0.1.1-0.20220316223106-78d6e1c49d8d // indirect
126+
github.com/tailscale/golang-x-crypto v0.0.0-20221102133106-bc99ab8c2d17 // indirect
127+
github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect
128+
github.com/tailscale/netlink v1.1.1-0.20211101221916-cabfb018fe85 // indirect
129+
github.com/tailscale/wireguard-go v0.0.0-20221219190806-4fa124729667 // indirect
130+
github.com/tchap/go-patricia/v2 v2.3.1 // indirect
131+
github.com/tcnksm/go-httpstat v0.2.0 // indirect
132+
github.com/u-root/uio v0.0.0-20221213070652-c3537552635f // indirect
133+
github.com/valyala/fasthttp v1.44.0 // indirect
134+
github.com/vishvananda/netlink v1.1.1-0.20211118161826-650dca95af54 // indirect
135+
github.com/vishvananda/netns v0.0.0-20211101163701-50045581ed74 // indirect
136+
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
137+
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
138+
github.com/vmihailenco/tagparser v0.1.1 // indirect
139+
github.com/x448/float16 v0.8.4 // indirect
140+
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
141+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
142+
github.com/yashtewari/glob-intersection v0.1.0 // indirect
143+
github.com/zclconf/go-cty v1.10.0 // indirect
144+
github.com/zeebo/errs v1.3.0 // indirect
145+
go.nhat.io/otelsql v0.9.0 // indirect
146+
go.opencensus.io v0.24.0 // indirect
147+
go.opentelemetry.io/otel v1.14.0 // indirect
148+
go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.14.0 // indirect
149+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.14.0 // indirect
150+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 // indirect
151+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 // indirect
152+
go.opentelemetry.io/otel/metric v0.37.0 // indirect
153+
go.opentelemetry.io/otel/sdk v1.14.0 // indirect
154+
go.opentelemetry.io/otel/trace v1.14.0 // indirect
155+
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
156+
go4.org/mem v0.0.0-20210711025021-927187094b94 // indirect
157+
go4.org/netipx v0.0.0-20220725152314-7e7bdc8411bf // indirect
158+
golang.org/x/crypto v0.8.0 // indirect
159+
golang.org/x/exp v0.0.0-20221205204356-47842c84f3db // indirect
160+
golang.org/x/mod v0.10.0 // indirect
161+
golang.org/x/net v0.9.0 // indirect
162+
golang.org/x/oauth2 v0.7.0 // indirect
163+
golang.org/x/sync v0.1.0 // indirect
164+
golang.org/x/sys v0.8.0 // indirect
165+
golang.org/x/term v0.7.0 // indirect
166+
golang.org/x/text v0.9.0 // indirect
167+
golang.org/x/time v0.3.0 // indirect
168+
golang.org/x/tools v0.7.0 // indirect
169+
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
170+
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
171+
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
172+
google.golang.org/appengine v1.6.7 // indirect
173+
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
174+
google.golang.org/grpc v1.54.0 // indirect
175+
google.golang.org/protobuf v1.30.0 // indirect
176+
gopkg.in/inf.v0 v0.9.1 // indirect
177+
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
178+
gopkg.in/yaml.v2 v2.4.0 // indirect
179+
gopkg.in/yaml.v3 v3.0.1 // indirect
180+
gvisor.dev/gvisor v0.0.0-20221203005347-703fd9b7fbc0 // indirect
181+
inet.af/peercred v0.0.0-20210906144145-0893ea02156a // indirect
182+
k8s.io/klog/v2 v2.100.1 // indirect
183+
k8s.io/kube-openapi v0.0.0-20230308215209-15aac26d736a // indirect
184+
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
185+
nhooyr.io/websocket v1.8.7 // indirect
186+
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
187+
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
188+
sigs.k8s.io/yaml v1.3.0 // indirect
189+
storj.io/drpc v0.0.33-0.20230420154621-9716137f6037 // indirect
190+
tailscale.com v1.32.2 // indirect
191+
)

0 commit comments

Comments
 (0)