This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
diagnose pod handling ATM we can't create a cluster b/c the couchdb pods aren't ready
- Loading branch information
0 parents
commit f4fd080
Showing
4,290 changed files
with
1,950,518 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM golang:1.9-alpine3.6 | ||
|
||
RUN apk add --no-cache --update git && \ | ||
go get -u github.com/golang/dep/cmd/dep | ||
RUN git clone https://github.com/nicolai86/couchdb-operator /go/src/github.com/nicolai86/couchdb-operator && \ | ||
cd /go/src/github.com/nicolai86/couchdb-operator && \ | ||
dep ensure && \ | ||
go install github.com/nicolai86/couchdb-operator | ||
|
||
FROM alpine:3.6 | ||
|
||
RUN apk --no-cache --update add ca-certificates && update-ca-certificates | ||
|
||
COPY --from=0 /go/bin/couchdb-operator / | ||
|
||
ENTRYPOINT ["/couchdb-operator"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
|
||
# Gopkg.toml example | ||
# | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project" | ||
# version = "1.0.0" | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project2" | ||
# branch = "dev" | ||
# source = "github.com/myfork/project2" | ||
# | ||
# [[override]] | ||
# name = "github.com/x/y" | ||
# version = "2.4.0" | ||
|
||
|
||
[[constraint]] | ||
branch = "master" | ||
name = "github.com/nicolai86/couchdb-go" | ||
|
||
[[override]] | ||
name = "k8s.io/apimachinery" | ||
branch = "release-1.7" | ||
|
||
[[constraint]] | ||
name = "k8s.io/client-go" | ||
version = "4.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# couchdb operator | ||
|
||
this k8s operator allows you to run a 2.1 couchdb cluster on top of k8s. | ||
|
||
## status | ||
|
||
- [ ] operator | ||
- [ ] CRD (CouchDB) | ||
- [x] definition | ||
- [ ] management custom object add (spawn cluster) | ||
- [ ] management custom object update (update cluster) | ||
- [ ] management custom object delete (delete cluster) | ||
- [ ] deployment template (port, readyness, livelyness) | ||
- [ ] cluster management | ||
- [ ] new pod -> join cluster | ||
- [ ] old pod gone -> leave cluster | ||
- [x] operator definition | ||
- [x] README | ||
|
||
## guiding notes | ||
|
||
see 7 principles taken from coreOS post: https://coreos.com/blog/introducing-operators.html and https://github.com/kubernetes/community/blob/master/contributors/devel/controllers.md | ||
## prerequisites | ||
|
||
- k8s >= 1.7.0 | ||
|
||
## usage | ||
|
||
``` | ||
$ kubectl apply -f k8s/resource-type.yml | ||
$ kubectl apply -f k8s/deployment.yml | ||
``` | ||
|
||
now, you can deploy a couchdb cluster like this: | ||
|
||
``` | ||
apiVersion: "stable.couchdb.org/v1" | ||
kind: CouchDB | ||
metadata: | ||
name: my-couchdb-cluster | ||
spec: | ||
version: "2.1.0" | ||
image: "nicolai86/couchdb" | ||
replicas: 3 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: "stable.couchdb.org/v1" | ||
kind: CouchDB | ||
metadata: | ||
name: my-couchdb-cluster | ||
namespace: default | ||
spec: | ||
version: "2.1.0" | ||
baseImage: "nicolai86/couchdb" | ||
size: 3 | ||
pod: | ||
labels: | ||
app: couchdb | ||
nodeSelector: | ||
app: couchdb | ||
antiAffinity: false | ||
couchdbEnv: | ||
- { name: COUCHDB_USER, value: admin } | ||
- { name: COUCHDB_PASSWORD, value: admin } | ||
--- | ||
kind: Service | ||
apiVersion: v1 | ||
metadata: | ||
name: couchdb | ||
spec: | ||
selector: | ||
cluster: my-couchdb-cluster | ||
app: couchdb | ||
ports: | ||
- protocol: TCP | ||
port: 5986 | ||
name: "node-local" | ||
targetPort: 5986 | ||
nodePort: 31986 | ||
- protocol: TCP | ||
port: 5984 | ||
name: "standalone" | ||
targetPort: 5984 | ||
nodePort: 31984 | ||
type: NodePort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: apps/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: couchdb-operator | ||
spec: | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
name: couchdb-operator | ||
spec: | ||
containers: | ||
- name: couchdb-operator | ||
image: nicolai86/couchdb-operator:v0.0.1 | ||
imagePullPolicy: Always | ||
env: | ||
- name: OPERATOR_NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.namespace | ||
- name: OPERATOR_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name |
Oops, something went wrong.