-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from solarwinds/rename-rkubelog
Rename to rkubelog
- Loading branch information
Showing
20 changed files
with
99 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
db/ | ||
|
||
.vscode | ||
|
||
bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
run.sh | ||
|
||
.vscode | ||
|
||
bin/ | ||
|
||
db/ | ||
|
||
*.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
# Copyright 2019 SolarWinds Worldwide, LLC. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM golang:1.15.0-alpine as main | ||
RUN apk update && apk add --no-cache git ca-certificates wget && update-ca-certificates | ||
RUN wget -O /etc/ssl/certs/papertrail-bundle.pem https://papertrailapp.com/tools/papertrail-bundle.pem | ||
WORKDIR /github.com/solarwinds/cabbage | ||
WORKDIR /github.com/solarwinds/rkubelog | ||
ADD . . | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-w -s -extldflags "-static"' -a -o /cabbage . | ||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-w -s -extldflags "-static"' -a -o /rkubelog . | ||
|
||
FROM alpine | ||
COPY --from=main /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=main /etc/ssl/certs/papertrail-bundle.pem /etc/ssl/certs/ | ||
COPY --from=main /cabbage /app/cabbage | ||
COPY --from=main /rkubelog /app/rkubelog | ||
RUN chmod -R 777 /app | ||
USER 1001 | ||
WORKDIR /app | ||
ENTRYPOINT ./cabbage | ||
ENTRYPOINT ./rkubelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
# Cabbage | ||
# rkubelog | ||
|
||
Cabbage is the easiest way to get logs out of your k8s cluster and into [Papertrail](https://www.papertrail.com/) and [Loggly](https://www.loggly.com/). Because it doesn't require DaemonSets, sidecars, fluentd or persistent claims, it's one of the only solutions for logging in nodeless clusters, such as EKS on Fargate. But it's also perfect for smaller, local dev clusters to setup logging within seconds. | ||
rkubelog is the easiest way to get logs out of your k8s cluster and into [Papertrail](https://www.papertrail.com/) and [Loggly](https://www.loggly.com/). Because it doesn't require DaemonSets, sidecars, fluentd or persistent claims, it's one of the only solutions for logging in nodeless clusters, such as EKS on Fargate. But it's also perfect for smaller, local dev clusters to setup logging within seconds. | ||
|
||
## Usage | ||
|
||
> __Warning:__ You need a pull secret for quay.io/solarwinds in your cluster! If you don't have access to quay, build the image yourself and push it to your registry. | ||
By default, cabbage runs in the `kube-system` namespace and will observe all logs from all pods in all namespaces except from itself or any other service in `kube-system`. | ||
By default, rkubelog runs in the `kube-system` namespace and will observe all logs from all pods in all namespaces except from itself or any other service in `kube-system`. | ||
|
||
In `logging-config-patch.yaml` follow the comments to setup the connection to the syslog sink (Papertrail in this example) and set a system tag for the syslog messages. | ||
|
||
That's it. Preview with `kubectl apply -k . --dry-run -o yaml` and remove `--dry-run` to apply. | ||
|
||
## How it works | ||
|
||
Cabbage deploys a customized `kail` in an alpine container, using it to query the k8s API for pods (and keeping the pod list in sync) and their logs. Kail is a command line k8s logging client that lives at the opposite end of the specificity spectrum from `kubectl logs ...`. You can run kail yourself by cloning this repo and running `go run main.go`. This will give you all logs from all pods in all namespaces. | ||
rkubelog deploys a customized `kail` in an alpine container, using it to query the k8s API for pods (and keeping the pod list in sync) and their logs. Kail is a command line k8s logging client that lives at the opposite end of the specificity spectrum from `kubectl logs ...`. You can run kail yourself by cloning this repo and running `go run main.go`. This will give you all logs from all pods in all namespaces. | ||
To learn more about filters, read the [kail usage guide](https://github.com/boz/kail/tree/eb6734178238dc794641e82779855fabc2071e23#usage). | ||
|
||
### Papertrail | ||
|
@@ -58,7 +58,7 @@ make build | |
|
||
To run the code: | ||
``` | ||
bin/cabbage | ||
bin/rkubelog | ||
``` | ||
|
||
You are free to set the described environment variables or pass run time arguments described above and/or follow [kail usage guide](https://github.com/boz/kail/tree/eb6734178238dc794641e82779855fabc2071e23#usage). | ||
|
@@ -78,5 +78,10 @@ To create a Docker image: | |
make docker | ||
``` | ||
|
||
# Questions/Comments? | ||
Please [open an issue](https://github.com/solarwinds/cabbage/issues/new), we'd love to hear from you. As a SolarWinds Project, it is supported in a best-effort fashion. | ||
# Feedback | ||
|
||
Please [open an issue](https://github.com/solarwinds/rkubelog/issues/new), we'd love to hear from you. As a SolarWinds Project, it is supported in a best-effort fashion. | ||
|
||
# Security | ||
|
||
If you have identified a security vulnerability, please send an email to [email protected] (monitored 24/7). Please do not open a public issue. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
module github.com/solarwinds/cabbage | ||
module github.com/solarwinds/rkubelog | ||
|
||
go 1.15 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Copyright 2019 SolarWinds Worldwide, LLC. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package logshipper | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
// Copyright 2019 SolarWinds Worldwide, LLC. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package logshipper | ||
|
||
import ( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
cabbage/clusterrolebinding.yaml → rkubelog/clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,20 @@ | ||
# Copyright 2019 SolarWinds Worldwide, LLC. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: cabbage-sa | ||
name: rkubelog-sa | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: cabbage-reader-binding | ||
name: rkubelog-reader-binding | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: cabbage-reader | ||
name: rkubelog-reader | ||
subjects: | ||
- kind: ServiceAccount | ||
name: cabbage-sa | ||
name: rkubelog-sa | ||
namespace: kube-system |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2019 SolarWinds Worldwide, LLC. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: "rkubelog" | ||
namespace: "default" | ||
labels: | ||
app: rkubelog | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: rkubelog | ||
template: | ||
metadata: | ||
labels: | ||
kail.ignore: "true" | ||
app: rkubelog | ||
spec: | ||
serviceAccountName: rkubelog-sa | ||
containers: | ||
- image: quay.io/solarwinds/rkubelog | ||
imagePullPolicy: Always | ||
name: "rkubelog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters