Skip to content

Instantly share code, notes, and snippets.

View utkarshmani1997's full-sized avatar
🎯
Focusing

Utkarsh Mani Tripathi utkarshmani1997

🎯
Focusing
View GitHub Profile
@utkarshmani1997
utkarshmani1997 / sum.go
Last active August 9, 2017 04:40
Demo of unit testing using Ginkgo
package main
import "fmt"
func Sum(x, y int) int {
fmt.Println("Received Digits :", x, y)
return x + y
}
func main() {
@utkarshmani1997
utkarshmani1997 / testing_demo_suite_test.go
Last active August 9, 2017 04:39
Demo of unit testing
package main_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"testing"
)
func TestTestingDemo(t *testing.T) {
RegisterFailHandler(Fail)
@utkarshmani1997
utkarshmani1997 / sum_test.go
Last active August 10, 2017 08:38
Demo of unit testing
package main_test
import (
. "github.com/testing-demo"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Sum", func() {
package main
import (
"fmt"
"net/http"
)
func handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hi there, the end point is : %s !", r.URL.Path[1:])
}
FROM golang:1.7-alpine
MAINTAINER Utkarsh Mani Tripathi <utkarshmani1997@gmail.com>
ADD . /home
WORKDIR /home
CMD ["go","run","Server.go"]
EXPOSE 8080
@utkarshmani1997
utkarshmani1997 / openebs-operator.yaml
Created September 11, 2017 13:50
Openebs operator
# Define the Service Account
# Define the RBAC rules for the Service Account
# Launch the maya-apiserver ( deployment )
# Launch the maya-storagemanager ( deameon set )
# Create Maya Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: openebs-maya-operator
kind: ConfigMap
metadata:
name: prometheus-config
apiVersion: v1
data:
prometheus.yml: |-
global:
scrape_interval: 5s
evaluation_interval: 5s
scrape_configs:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: prometheus-deployment
spec:
replicas: 1
template:
metadata:
labels:
app: prometheus-server
MAYA_API_SERVER_NETWORK=eth0
+ NOMAD_ADDR=http://172.28.128.3:4646
+ NOMAD_CN_TYPE=host
+ NOMAD_CN_NETWORK_CIDR=172.28.128.1/24
+ NOMAD_CN_INTERFACE=enp0s8
+ NOMAD_CS_PERSISTENCE_LOCATION=/tmp/
+ NOMAD_CS_REPLICA_COUNT=2
+ ip -4 addr show scope global dev eth0
+ grep inet
+ awk {print $2}
Name: openebs-provisioner-3312871894-bdlbb
Namespace: default
Node: kubeminion-01/172.28.128.4
Start Time: Fri, 06 Oct 2017 07:46:27 +0000
Labels: name=openebs-provisioner
pod-template-hash=3312871894
Annotations: kubernetes.io/created-by={"kind":"SerializedReference","apiVersion":"v1","reference":{"kind":"ReplicaSet","namespace":"default","name":"openebs-provisioner-3312871894","uid":"75f45af7-aa6a-11e7-b2db-0...
Status: Running
IP: 10.44.0.1
Created By: ReplicaSet/openebs-provisioner-3312871894