Skip to content

πŸ‘β€πŸ—¨ i is an Kubernetes Operator for restarting old pod by custom policies πŸ‘β€πŸ—¨

License

Notifications You must be signed in to change notification settings

KeisukeYamashita/i

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

22 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

i


eye

i


i is an Kubernetes Operator for restarting old pod policies management.

Open Source Love Go License

GoDoc GolangCI Go Report Card CodeFactor Dependabot Job Status Report

DeepSource

NOTE: This is not for production usage. It is under PoC.

Design

Every pod will be supervised by the eye...


eye


Here, I will explain the breif design.

Architecture

The controller runs syncer by the resource from input and watches the pod.

Controller --> Syncer -(watch)-> Pod

And then delete the pod and recreates.
At the time, the controller will notify via slack which will be configured by Secret resource.

Install CRD

First, you will need to install this CRD.
Run this command.

$ kustomize build "https://raw.githubusercontent.com/KeisukeYamashita/i/master/config/crd" | kubectl apply -f 

Then, check crd status.

$ kubectl get crd

Create secret for slack notification: Optional

Create a secret.

apiVersion:
Kind: Secret
metadata:
    app: YOUR_SECRET_NAME
data:
    SLACK_URL: "https://hook.xxx.xxx"

And then apply.

$ kubectl apply -f slack-channel-1.yml

Eye resource

Create a custom resource. You can create many rules. Note that spec.secrectRef is optional.

apiVersion: i.keisukeyamashita.com/alphav1
Kind: Eye
metadata:
    app: my-eye
    msg: "I see you"
spec:
    lifetime: "100m"
    secretRef:
        name: YOUR_SECRET_NAME

Then apply your resource.

$ kubectl aaply -f my-eye.yml

Check you status.

$ kubectl get eye

If you set it all correctly, you will see a post in slack at the event.

slack

Note that this is optional.

Multi eyes support

slack

You can create multiple eyes(policies) for multi lifetime and different slack post.

apiVersion: i.keisukeyamashita.com/alphav1
Kind: Eye
metadata:
    app: my-left-eye
spec:
    lifetime: "100m"
    secretRef:
        name: YOUR_SECRET_NAME_LEFT
---
apiVersion: i.keisukeyamashita.com/alphav1
Kind: Eye
metadata:
    app: my-right-eye
spec:
    lifetime: "3h"
    secretRef:
        name: YOUR_SECRET_NAME_RIGHT

Happy eyes:)

License

Copyright 2019 The i Authors.
i is released under the Apache License 2.0.

Author

About

πŸ‘β€πŸ—¨ i is an Kubernetes Operator for restarting old pod by custom policies πŸ‘β€πŸ—¨

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •