diff --git a/hound/Dockerfile b/hound/Dockerfile new file mode 100644 index 00000000000..4e06fe1ccbb --- /dev/null +++ b/hound/Dockerfile @@ -0,0 +1,31 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.9.2 + +LABEL maintainer="Davanum Srinivas " + +COPY config.json /data/config.json + +ENV GOPATH /go + +RUN go get -d github.com/etsy/hound/cmds/... +RUN cd /go/src/github.com/etsy/hound && git checkout 1b9c3e53594f7eded11fc259537c443853db4587 +RUN go install github.com/etsy/hound/cmds/houndd + +VOLUME ["/data"] + +EXPOSE 6080 + +ENTRYPOINT ["/go/bin/houndd", "-conf", "/data/config.json"] \ No newline at end of file diff --git a/hound/Makefile b/hound/Makefile new file mode 100644 index 00000000000..c014c6a38eb --- /dev/null +++ b/hound/Makefile @@ -0,0 +1,24 @@ +# Copyright 2017 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +TAG = v0.1.0 +IMAGE_NAME = docker.io/dims/hound + +image: + docker build -t "$(IMAGE_NAME):$(TAG)" . --pull + +push: image + gcloud docker -- push "$(IMAGE_NAME):$(TAG)" + +.PHONY: image push diff --git a/hound/README.md b/hound/README.md new file mode 100644 index 00000000000..22e3118c662 --- /dev/null +++ b/hound/README.md @@ -0,0 +1,35 @@ +# Hound + +Hound is an extremely fast source code search engine. See some details here: +https://hub.docker.com/r/etsy/hound/ + +and the code here: +https://github.com/etsy/hound + +# How to + +* To build the docker image: + + ``` + make image + ``` + +* Try the image using docker: + + ``` + docker run -d -p 6080:6080 --name hound gcr.io/google_containers/hound:v0.1.0 + ``` + +* To deploy in kubernetes use the deployment.yaml and service.yaml + +NOTE: hound takes a while to fetch data from github and only after that it starts listening on +the port 6080, so look at the logs to see if the endpoint has started. When it is done you will +see the following: + +``` +2017/12/15 14:55:58 All indexes built! +2017/12/15 14:55:58 running server at http://localhost:6080... +2017/12/15 15:02:01 Rebuilding kubernetes-bootcamp for af23e77ef9e90c4563d1a3bbb2c7313eec7ffb23 +2017/12/15 15:02:01 merge 0 files + mem +2017/12/15 15:02:01 11802 data bytes, 35923 index bytes +``` \ No newline at end of file diff --git a/hound/config.json b/hound/config.json new file mode 100644 index 00000000000..747eb980cd7 --- /dev/null +++ b/hound/config.json @@ -0,0 +1,190 @@ +{ + "max-concurrent-indexers": 2, + "dbpath": "data", + "repos": { + "kubernetes": { + "url": "https://github.com/kubernetes/kubernetes.git", + "ms-between-poll": 360000 + }, + "test-infra": { + "url": "https://github.com/kubernetes/test-infra.git", + "ms-between-poll": 360000 + }, + "community": { + "url": "https://github.com/kubernetes/community.git", + "ms-between-poll": 360000 + }, + "kubernetes.github.io": { + "url": "https://github.com/kubernetes/kubernetes.github.io.git", + "ms-between-poll": 360000 + }, + "kops": { + "url": "https://github.com/kubernetes/kops.git", + "ms-between-poll": 360000 + }, + "helm": { + "url": "https://github.com/kubernetes/helm.git", + "ms-between-poll": 360000 + }, + "repo-infra": { + "url": "https://github.com/kubernetes/repo-infra.git", + "ms-between-poll": 360000 + }, + "charts": { + "url": "https://github.com/kubernetes/charts.git", + "ms-between-poll": 360000 + }, + "kubeadm": { + "url": "https://github.com/kubernetes/kubeadm.git", + "ms-between-poll": 360000 + }, + "features": { + "url": "https://github.com/kubernetes/features.git", + "ms-between-poll": 360000 + }, + "kube-state-metrics": { + "url": "https://github.com/kubernetes/kube-state-metrics.git", + "ms-between-poll": 360000 + }, + "minikube": { + "url": "https://github.com/kubernetes/minikube.git", + "ms-between-poll": 360000 + }, + "contrib": { + "url": "https://github.com/kubernetes/contrib.git", + "ms-between-poll": 360000 + }, + "dashboard": { + "url": "https://github.com/kubernetes/dashboard.git", + "ms-between-poll": 360000 + }, + "autoscaler": { + "url": "https://github.com/kubernetes/autoscaler.git", + "ms-between-poll": 360000 + }, + "heapster": { + "url": "https://github.com/kubernetes/heapster.git", + "ms-between-poll": 360000 + }, + "frakti": { + "url": "https://github.com/kubernetes/frakti.git", + "ms-between-poll": 360000 + }, + "kompose": { + "url": "https://github.com/kubernetes/kompose.git", + "ms-between-poll": 360000 + }, + "kubernetes-anywhere": { + "url": "https://github.com/kubernetes/kubernetes-anywhere.git", + "ms-between-poll": 360000 + }, + "release": { + "url": "https://github.com/kubernetes/release.git", + "ms-between-poll": 360000 + }, + "node-problem-detector": { + "url": "https://github.com/kubernetes/node-problem-detector.git", + "ms-between-poll": 360000 + }, + "kube-openapi": { + "url": "https://github.com/kubernetes/kube-openapi.git", + "ms-between-poll": 360000 + }, + "cluster-registry": { + "url": "https://github.com/kubernetes/cluster-registry.git", + "ms-between-poll": 360000 + }, + "k8s.io": { + "url": "https://github.com/kubernetes/k8s.io.git", + "ms-between-poll": 360000 + }, + "apiserver": { + "url": "https://github.com/kubernetes/apiserver.git", + "ms-between-poll": 360000 + }, + "steering": { + "url": "https://github.com/kubernetes/steering.git", + "ms-between-poll": 360000 + }, + "examples": { + "url": "https://github.com/kubernetes/examples.git", + "ms-between-poll": 360000 + }, + "kubernetes-bootcamp": { + "url": "https://github.com/kubernetes/kubernetes-bootcamp.git", + "ms-between-poll": 360000 + }, + "dns": { + "url": "https://github.com/kubernetes/dns.git", + "ms-between-poll": 360000 + }, + "apiextensions-apiserver": { + "url": "https://github.com/kubernetes/apiextensions-apiserver.git", + "ms-between-poll": 360000 + }, + "metrics": { + "url": "https://github.com/kubernetes/metrics.git", + "ms-between-poll": 360000 + }, + "apimachinery": { + "url": "https://github.com/kubernetes/apimachinery.git", + "ms-between-poll": 360000 + }, + "api": { + "url": "https://github.com/kubernetes/api.git", + "ms-between-poll": 360000 + }, + "client-go": { + "url": "https://github.com/kubernetes/client-go.git", + "ms-between-poll": 360000 + }, + "kube-aggregator": { + "url": "https://github.com/kubernetes/kube-aggregator.git", + "ms-between-poll": 360000 + }, + "sample-apiserver": { + "url": "https://github.com/kubernetes/sample-apiserver.git", + "ms-between-poll": 360000 + }, + "utils": { + "url": "https://github.com/kubernetes/utils.git", + "ms-between-poll": 360000 + }, + "kubernetes-template-project": { + "url": "https://github.com/kubernetes/kubernetes-template-project.git", + "ms-between-poll": 360000 + }, + "gengo": { + "url": "https://github.com/kubernetes/gengo.git", + "ms-between-poll": 360000 + }, + "kube-ui": { + "url": "https://github.com/kubernetes/kube-ui.git", + "ms-between-poll": 360000 + }, + "md-check": { + "url": "https://github.com/kubernetes/md-check.git", + "ms-between-poll": 360000 + }, + "sig-release": { + "url": "https://github.com/kubernetes/sig-release.git", + "ms-between-poll": 360000 + }, + "kube-deploy": { + "url": "https://github.com/kubernetes/kube-deploy.git", + "ms-between-poll": 360000 + }, + "git-sync": { + "url": "https://github.com/kubernetes/git-sync.git", + "ms-between-poll": 360000 + }, + "perf-tests": { + "url": "https://github.com/kubernetes/perf-tests.git", + "ms-between-poll": 360000 + }, + "kubectl": { + "url": "https://github.com/kubernetes/kubectl.git", + "ms-between-poll": 360000 + } + } +} \ No newline at end of file diff --git a/hound/deployment.yaml b/hound/deployment.yaml new file mode 100644 index 00000000000..3a5a170bdf8 --- /dev/null +++ b/hound/deployment.yaml @@ -0,0 +1,26 @@ +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: hound + labels: + app: hound +spec: + replicas: 2 + # selector defaults from template labels + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + type: RollingUpdate + template: + metadata: + labels: + app: hound + spec: + terminationGracePeriodSeconds: 30 + containers: + - name: hound + image: gcr.io/google_containers/hound:v0.1.0 + ports: + - containerPort: 6080 + protocol: TCP \ No newline at end of file diff --git a/hound/service.yaml b/hound/service.yaml new file mode 100644 index 00000000000..74a929c2fbc --- /dev/null +++ b/hound/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: hound + labels: + app: hound +spec: + selector: + app: hound + type: LoadBalancer + # FIXME(dims) - we need a fixed IP address for the load balancer + #loadBalancerIP: 104.197.177.166 + ports: + - name: http + port: 80 + targetPort: 6080