Skip to content

Commit

Permalink
Rename project to kube-sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
kishen-v committed Oct 10, 2023
1 parent 74379ef commit bccfe45
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 96 deletions.
8 changes: 4 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ RUN apk add sqlite-dev \
sqlite-static \
gcc \
libc-dev
WORKDIR /kubertas
WORKDIR /kube-sentry
COPY . .
RUN CGO_ENABLED=1 go build -ldflags "-s -w -linkmode 'external' -extldflags '-static'" -v -o /kubertas/kubertas /kubertas/cmd
RUN CGO_ENABLED=1 go build -ldflags "-s -w -linkmode 'external' -extldflags '-static'" -v -o /kube-sentry/kube-sentry /kube-sentry/cmd

FROM scratch
COPY --from=builder /kubertas/kubertas /usr/bin/kubertas
COPY --from=builder /kube-sentry/kube-sentry /usr/bin/kube-sentry
WORKDIR /
CMD ["/usr/bin/kubertas"]
CMD ["/usr/bin/kube-sentry"]
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# KubeRTAS - RTAS event notifier for Kubernetes on ppc64le.
# Kube-sentry: Kubernetes - Servicelog Event Notifier Towards improved Reliability.

kube-sentry reads the servicelog.db to parse the RTAS (Run Time Abstraction Services) events which have been reported by the RTAS daemon. The events are related to the platform, such as Predictive CPU Failure, IO Bus Failure, Fan Failures, etc. and are reported to the Kubernetes API server.

KubeRTAS reads the servicelog.db to read the RTAS (Run Time Abstraction Services) events which have been reported by the RTAS daemon. The events are related to the platform, such as Power Suppy or Fan Failures, etc. and are reported to the Kubernetes API server.
This gives the cluster administrators visiblity about the errors that may be prevalent in underlying host. The servicelogs are specific to the PowerPC family of servers by IBM Corporation.

The KubeRTAS application can be configured to work in a standalone mode, or be deployed as a DaemonSet in Kubernetes cluster. This gives additional visibility to the cluster administrators regarding the issues that may be prevelent in the underlying infrastructure.
The kube-sentry application can be configured to work in a standalone mode, or be deployed as a DaemonSet in Kubernetes cluster.

---
#### Architecture Diagram:

![RTAS](https://github.com/kishen-v/kube-rtas/assets/110517346/bbbd9436-c87f-4757-a4f3-5c9c9c8a8835)
![kube-sentry](https://github.com/kishen-v/kube-rtas/assets/110517346/5c7b6dce-c0e1-4468-b1be-35516e3c6e72)

---
### Configuration:
Expand Down Expand Up @@ -38,11 +39,11 @@ This mode requires the KUBECONFIG environment variable to be set.
yum install sqlite-devel
cd cmd
go build -o kubertas .
./kubertas -c <path to config file (optional) -v <log verbosity>
go build -o kube-sentry .
./kube-sentry -c <path to config file (optional) -v <log verbosity>
```

This creates a kubeRTAS process and uses the available Kubeconfig to notify the RTAS events to Kubernetes API server.
This creates a kube-sentry process and uses the available Kubeconfig to notify the RTAS events to Kubernetes API server.

#### Daemonset deployment
` kubectl apply -f deployment `
Expand Down
12 changes: 6 additions & 6 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"github.com/spf13/pflag"
"k8s.io/klog/v2"

"github.com/ppc64le-cloud/kube-rtas/pkg/dbreader"
"github.com/ppc64le-cloud/kube-rtas/pkg/knode"
"github.com/ppc64le-cloud/kube-rtas/pkg/utils"
"github.com/ppc64le-cloud/kube-sentry/pkg/dbreader"
"github.com/ppc64le-cloud/kube-sentry/pkg/knode"
"github.com/ppc64le-cloud/kube-sentry/pkg/utils"
)

var (
Expand All @@ -27,10 +27,10 @@ func main() {
klogFlags.Set("logtostderr", "true")

pflag.CommandLine.AddGoFlagSet(klogFlags)
pflag.StringVarP(&cfgFilePath, "config", "c", "config.json", "Path to KubeRTAS config file")
pflag.StringVarP(&cfgFilePath, "config", "c", "config.json", "Path to kube-sentry config file")
pflag.Parse()

klog.Infof("setting up KubeRTAS, reading config from %s", cfgFilePath)
klog.Infof("setting up kube-sentry, reading config from %s", cfgFilePath)
serviceConfig, err := utils.ReadConfig(cfgFilePath)
if err != nil {
klog.Fatalf("error while reading config. Error: %v", err)
Expand Down Expand Up @@ -80,7 +80,7 @@ func main() {
go func() {
sig := <-sigchan
done <- struct{}{}
klog.Infof("Captured %s, Shutting down KubeRTAS", sig.String())
klog.Infof("Captured %s, Shutting down kube-sentry", sig.String())
wg.Done()
os.Exit(0)
}()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: kubertas-configmap
name: kubesentry-configmap
data:
config.json: |
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: kubertas
name: kube-sentry
labels:
app: kubertas
app: kube-sentry
spec:
selector:
matchLabels:
app: kubertas
app: kube-sentry
template:
metadata:
labels:
app: kubertas
app: kube-sentry
spec:
containers:
- name: kubertas
image: quay.io/kviswana/kube-rtas:0.1
- name: kube-sentry
image: quay.io/kviswana/kube-sentry:0.1
env:
- name: VERBOSITY
value: "0"
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command: ["/usr/bin/kubertas"]
command: ["/usr/bin/kube-sentry"]
args: [--config, /etc/config/config.json, --v, $(VERBOSITY)]
volumeMounts:
- name: servicelog-db
mountPath: /servicelog.db
readOnly: true
- name: kubertas-config
- name: kube-sentry-config
mountPath: /etc/config
tolerations:
- operator: "Exists"
Expand All @@ -38,9 +38,9 @@ spec:
hostPath:
path: /var/lib/servicelog/servicelog.db
type: File
- name: kubertas-config
- name: kube-sentry-config
configMap:
name: kubertas-configmap
name: kubesentry-configmap
items:
- key: config.json
path: config.json
Expand Down
File renamed without changes.
34 changes: 17 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/ppc64le-cloud/kube-rtas
module github.com/ppc64le-cloud/kube-sentry

go 1.20

Expand All @@ -8,46 +8,46 @@ require (
k8s.io/apimachinery v0.28.2
k8s.io/client-go v0.28.2
k8s.io/klog/v2 v2.100.1
k8s.io/kubernetes v1.15.0-alpha.0
k8s.io/kubernetes v1.28.2
rsc.io/sqlite v1.0.0
sigs.k8s.io/controller-runtime v0.16.2
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/emicklei/go-restful/v3 v3.11.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-openapi/jsonpointer v0.20.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/imdario/mergo v0.3.6 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/term v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/net v0.13.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.30.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/kube-openapi v0.0.0-20230918164632-68afd615200d // indirect
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.3.0 // indirect
)
Loading

0 comments on commit bccfe45

Please sign in to comment.