Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jw-s committed Sep 11, 2017
0 parents commit b3a01ca
Show file tree
Hide file tree
Showing 5,214 changed files with 2,353,754 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vendor
pkg
cmd
.gitignore
.idea/
*.iml
4 changes: 4 additions & 0 deletions .draftignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
*.swp
*.tmp
*.temp
.git*
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
*.iml
bin/
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM golang:onbuild
ENV PORT 8080
EXPOSE 8080
4 changes: 4 additions & 0 deletions Dockerfile_prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
ADD bin/redis-operator /redis-operator
ENTRYPOINT ["/redis-operator"]
VOLUME ["/tmp"]
224 changes: 224 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[[constraint]]
name = "k8s.io/client-go"
version = "4.0.0"

[[constraint]]
name = "k8s.io/apimachinery"
branch = "release-1.7"

[[constraint]]
name = "k8s.io/apiextensions-apiserver"

# Commit that is compatible with client-go v4.0.0.
# Thanks to https://github.com/kubernetes/apiextensions-apiserver/issues/3#issuecomment-318871483
revision = "be41f5093e2b05c7a0befe35b04b715eb325ab43"

[[constraint]]
name = "github.com/boltdb/bolt"
version = "1.3.1"

[[constraint]]
name = "github.com/julienschmidt/httprouter"
version = "1.1"

[[constraint]]
name = "github.com/sirupsen/logrus"
version = "1.0.3"
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
REDIS_OPERATOR_IMAGE_NAME := redis-operator

.PHONY: all clean build

all: build

build: bin/redis
docker build -t $(REDIS_OPERATOR_IMAGE_NAME) -f ./Dockerfile_prod .

bin/redis:
GOOS=linux GOARCH=amd64 go build -o bin/redis-operator ./cmd/operator

clean:
rm -rf bin/*
21 changes: 21 additions & 0 deletions chart/go/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
4 changes: 4 additions & 0 deletions chart/go/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
description: A Helm chart for Kubernetes
name: go
version: v0.1.0
15 changes: 15 additions & 0 deletions chart/go/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

{{- if contains "NodePort" .Values.service.type }}
Get the application URL by running these commands:
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT/login
{{- else if contains "LoadBalancer" .Values.service.type }}
Get the application URL by running these commands:
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.externalPort }}
{{- else }}
http://{{ .Release.Name }}.{{ .Values.basedomain }} to access your application
{{- end }}
16 changes: 16 additions & 0 deletions chart/go/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
29 changes: 29 additions & 0 deletions chart/go/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ template "fullname" . }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "fullname" . }}
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.registry }}/{{ .Values.image.org }}/{{ .Values.image.name }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: {{ .Values.service.internalPort }}
livenessProbe:
httpGet:
path: /
port: {{ .Values.service.internalPort }}
readinessProbe:
httpGet:
path: /
port: {{ .Values.service.internalPort }}
resources:
{{ toYaml .Values.resources | indent 12 }}
Loading

0 comments on commit b3a01ca

Please sign in to comment.