forked from sorintlab/stolon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use kind to reproduce issue sorintlab#678
- Loading branch information
1 parent
cd21db4
commit fbfaf92
Showing
6 changed files
with
108 additions
and
0 deletions.
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,10 @@ | ||
FROM golang:1.13 as builder | ||
|
||
WORKDIR /workdir | ||
ADD . /workdir | ||
RUN /workdir/build | ||
|
||
|
||
FROM alpine | ||
|
||
COPY --from=builder /workdir/bin /bin |
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,14 @@ | ||
#!/usr/bin/env make | ||
KUBECONFIG := $(shell kind get kubeconfig-path --name="kind") | ||
|
||
prepare: | ||
kind create cluster --config kind-config.yml | ||
|
||
test: | ||
#docker build -t sorintlab/stolon:master-pg10 .. | ||
#kind load docker-image sorintlab/stolon:master-pg10 | ||
KUBECONFIG=$(KUBECONFIG) kubectl apply -f k8s/ | ||
#stolonctl init --cluster-name kube-stolon --store-backend kubernetes --kube-resource-kind configmap | ||
|
||
teardown: | ||
kind delete cluster |
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,13 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: RoleBinding | ||
metadata: | ||
name: stolon | ||
namespace: default | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: stolon | ||
subjects: | ||
- kind: ServiceAccount | ||
name: default | ||
namespace: default |
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,22 @@ | ||
# This is an example and generic rbac role definition for stolon. It could be | ||
# fine tuned and split per component. | ||
# The required permission per component should be: | ||
# keeper/proxy/sentinel: update their own pod annotations | ||
# sentinel/stolonctl: get, create, update configmaps | ||
# sentinel/stolonctl: list components pods | ||
# sentinel/stolonctl: get components pods annotations | ||
|
||
apiVersion: rbac.authorization.k8s.io/v1beta1 | ||
kind: Role | ||
metadata: | ||
name: stolon | ||
namespace: default | ||
rules: | ||
- apiGroups: | ||
- "" | ||
resources: | ||
- pods | ||
- configmaps | ||
- events | ||
verbs: | ||
- "*" |
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,44 @@ | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: stolon-sentinel | ||
spec: | ||
replicas: 2 | ||
template: | ||
metadata: | ||
labels: | ||
component: stolon-sentinel | ||
stolon-cluster: kube-stolon | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
prometheus.io/port: "8080" | ||
spec: | ||
containers: | ||
- name: stolon-sentinel | ||
image: sorintlab/stolon:master-pg10 | ||
command: | ||
- "/bin/bash" | ||
- "-ec" | ||
- | | ||
exec gosu stolon stolon-sentinel | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
- name: STSENTINEL_CLUSTER_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.labels['stolon-cluster'] | ||
- name: STSENTINEL_STORE_BACKEND | ||
value: "kubernetes" | ||
- name: STSENTINEL_KUBE_RESOURCE_KIND | ||
value: "configmap" | ||
- name: STSENTINEL_METRICS_LISTEN_ADDRESS | ||
value: "0.0.0.0:8080" | ||
## Uncomment this to enable debug logs | ||
#- name: STSENTINEL_DEBUG | ||
# value: "true" | ||
ports: | ||
- containerPort: 8080 | ||
enableServiceLinks: false |
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,5 @@ | ||
kind: Cluster | ||
apiVersion: kind.sigs.k8s.io/v1alpha3 | ||
nodes: | ||
- role: control-plane | ||
image: kindest/node:v1.13.10 |