Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions metrics/access-logs/create-schema.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

set -e
set -x

PROJECT=`gcloud config get-value project`

# Must generally create in same location as GCS buckets, doesn't apply to US but still a good idea!
# https://cloud.google.com/bigquery/docs/batch-loading-data#data-locations
bq mk --location=US --dataset ${PROJECT}:kubernetes_public_logs
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinsb can we use this project and this dataset : #2031 ?


bq mk --table --description "Raw logs from GCS" \
--label pii:yes \
--norequire_partition_filter \
--time_partitioning_field request_time \
--time_partitioning_type DAY \
${PROJECT}:kubernetes_public_logs.raw_gcs_logs schemas/raw_gcs_logs


4 changes: 4 additions & 0 deletions metrics/access-logs/loader/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.PHONY: protoc
protoc:
protoc --go_out=module=k8s.io/k8s.io/metrics/access-logs/loader:. pkg/datapb/*.proto pkg/ipinfo/ipinfopb/*.proto

14 changes: 14 additions & 0 deletions metrics/access-logs/loader/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module k8s.io/k8s.io/metrics/access-logs/loader

go 1.15

require (
cloud.google.com/go/bigquery v1.17.0
cloud.google.com/go/storage v1.14.0
github.com/golang/protobuf v1.5.2
google.golang.org/api v0.44.0
google.golang.org/genproto v0.0.0-20210406143921-e86de6bf7a46
google.golang.org/protobuf v1.26.0
k8s.io/klog v1.0.0
k8s.io/klog/v2 v2.8.0
)
491 changes: 491 additions & 0 deletions metrics/access-logs/loader/go.sum

Large diffs are not rendered by default.

Loading