rm old unused files
diff --git a/controller/cmd/main.go b/controller/cmd/main.go
deleted file mode 100644
index af2e019..0000000
--- a/controller/cmd/main.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package main
-
-import (
- "bytes"
- "encoding/json"
- "flag"
- "fmt"
- "io/ioutil"
- "log"
- "net/http"
-
- "github.com/golang/glog"
- "github.com/itaysk/regogo"
-)
-
-var port = flag.Int("port", 123, "Port to listen on.")
-var apiAddr = flag.String("api_addr", "", "PCloud GraphQL API server address.")
-
-var jsonContentType = "application/json"
-
-var addImgTmpl = `
-mutation {
- addImage(input: [%s]) {
- image {
- id
- }
- }
-}`
-
-type image struct {
- ObjectPath string
-}
-
-type query struct {
- Query string
-}
-
-func minioHandler(w http.ResponseWriter, r *http.Request) {
- body, err := ioutil.ReadAll(r.Body)
- if err != nil {
- glog.Error(err)
- http.Error(w, "Could not read HTTP request body", http.StatusInternalServerError)
- return
- }
- if len(body) == 0 {
- // Just a health check from Minio
- return
- }
- bodyStr := string(body)
- glog.Infof("Received event from Minio: %s", bodyStr)
- key, err := regogo.Get(bodyStr, "input.Key")
- if err != nil {
- glog.Error(err)
- http.Error(w, "Could not find object key", http.StatusBadRequest)
- return
- }
- img := image{key.String()}
- imgJson, err := json.Marshal(img)
- if err != nil {
- panic(err)
- }
- q := query{fmt.Sprintf(addImgTmpl, imgJson)}
- glog.Info(q)
- queryJson, err := json.Marshal(q)
- if err != nil {
- panic(err)
- }
- resp, err := http.Post(
- *apiAddr,
- jsonContentType,
- bytes.NewReader(queryJson))
- if err != nil {
- glog.Error(err)
- http.Error(w, "Query failed", http.StatusInternalServerError)
- return
- }
- respBody, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- panic(err)
- }
- glog.Info(string(respBody))
-}
-
-func main() {
- flag.Parse()
-
- http.HandleFunc("/minio_webhook", minioHandler)
- log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", *port), nil))
-}
diff --git a/controller/controller.yaml b/controller/controller.yaml
deleted file mode 100644
index 6b3e143..0000000
--- a/controller/controller.yaml
+++ /dev/null
@@ -1,70 +0,0 @@
----
-apiVersion: v1
-kind: ServiceAccount
-metadata:
- name: pcloud-controller
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: Role
-metadata:
- name: modify-pods
-rules:
- - apiGroups: [""]
- resources: ["pods"]
- verbs: ["create"]
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: RoleBinding
-metadata:
- name: create-pods-to-sa
-subjects:
- - kind: ServiceAccount
- name: pcloud-controller
-roleRef:
- kind: Role
- name: modify-pods
- apiGroup: rbac.authorization.k8s.io
----
-kind: Service
-apiVersion: v1
-metadata:
- name: pcloud-controller-service
-spec:
- type: ClusterIP
- selector:
- app: pcloud-controller
- ports:
- - nodePort:
- port: 1111
- targetPort: 1234
----
-kind: Deployment
-apiVersion: apps/v1
-metadata:
- name: pcloud-controller
-spec:
- selector:
- matchLabels:
- app: pcloud-controller
- replicas: 1
- template:
- metadata:
- labels:
- app: pcloud-controller
- spec:
- serviceAccountName: pcloud-controller
- containers:
- - name: pcloud-controller
- image: pcloud-controller:latest
- imagePullPolicy: Never
- ports:
- - containerPort: 1234
- volumeMounts:
- - name: code
- mountPath: /src/go/src/github.com/giolekva/pcloud/controller
- command: ["/bin/sh", "-c"]
- args: ["go run main.go --port=1234 --graphql_address=http://dgraph-public.dgraph.svc:8080/graphql --dgraph_admin_address=http://dgraph-public.dgraph.svc:8080/admin --logtostderr"]
- volumes:
- - name: code
- hostPath:
- path: "/Users/lekva/dev/go/src/github.com/giolekva/pcloud/controller"
diff --git a/controller/echo.yaml b/controller/echo.yaml
deleted file mode 100644
index 2ae250c..0000000
--- a/controller/echo.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-apiVersion: app
-kind: Workflow # new type of k8s spec
-metadata:
- generateName: hello-world- # name of the workflow spec
-spec:
- entrypoint: whalesay # invoke the whalesay template
- templates:
- - name: whalesay # name of the template
- container:
- image: docker/whalesay
- command: [cowsay]
- args: ["hello world"]
- resources: # limit the resources
- limits:
- memory: 32Mi
- cpu: 100m
\ No newline at end of file
diff --git a/controller/gql/gql.go b/controller/gql/gql.go
deleted file mode 100644
index 88962c9..0000000
--- a/controller/gql/gql.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package gql
-
-import (
- "github.com/vektah/gqlparser"
- "github.com/vektah/gqlparser/ast"
-)
-
-type Proxy struct {
- dest string
-}
diff --git a/controller/samples.gql b/controller/samples.gql
deleted file mode 100644
index 3aa0b65..0000000
--- a/controller/samples.gql
+++ /dev/null
@@ -1,113 +0,0 @@
-{
- __drop
-}
-
-# query {
-# queryImage() {
-# id
-# objectPath
-# }
-# }
-
-# query {
-# queryFoo(filter: {
-# name: {
-# anyofterms: "foo"
-# }
-# }) {
-# id
-# name
-# bar {
-# id
-# }
-# }
-# }
-
-
-# mutation {
-# addA(input: [{
-# name: "dev"
-# }]) {
-# numUids
-# a {
-# id
-# name
-# }
-# }
-# }
-
-# mutation {
-# updateB(input: {
-# filter: {
-# id: ["0x4"]
-# },
-# set: {
-# a: [{id: "0x5"}]
-# }
-# }) {
-# numUids
-# b {
-# id
-# name
-# a {
-# id
-# name
-# b {
-# id
-# name
-# }
-# }
-# }
-# }
-# }
-
-
-# mutation {
-# addB(input:[{
-# name: "bar"
-# a: [{
-# id: "0x3"
-# }]
-# }]) {
-# numUids
-# b {
-# id
-# name
-# a {
-# id
-# name
-# b {
-# id
-# name
-# }
-# }
-# }
-# }
-# }
-
-# mutation {
-# deleteImage(
-# filter: {
-# id: {
-# gt: 0
-# }
-# }
-# ) {
-# msg
-# numUids
-# }
-# }
-
-
-
-# mutation {
-# addImage(input: [{
-# id: 2,
-# objectPath: "foo/bar.jpg"
-# }, {
-# id:3
-# objectPath: "qwe/qwe"
-# }]) {
-# numUids
-# }
-# }
\ No newline at end of file
diff --git a/reset.sh b/reset.sh
deleted file mode 100644
index 4a0af1f..0000000
--- a/reset.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-kubectl delete namespace app-object-store
-kubectl delete namespace app-rpuppy
-kubectl delete namespace app-photos-ui
-kubectl delete namespace app-minio-importer
-kubectl delete namespace app-face-detection
-kubectl delete namespace pcloud-app-manager
-kubectl apply -f appmanager/install.yaml
-
-sh controller/bootstrap-schema.sh
-kubectl -n pcloud rollout restart deployment/api
-
-