-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from systemaccounting/384-add-kubernetes-locally
384 add kubernetes locally
- Loading branch information
Showing
36 changed files
with
1,507 additions
and
42 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
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,9 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# recursively replace all default GRAPHQL_URI Dockerfile | ||
# assignments in the /usr/share/nginx/html directory with | ||
# the value of the GRAPHQL_URI environment variable | ||
find /usr/share/nginx/html -type f -exec sed -i "s/aHR0cDovL2xvY2FsaG9zdDoxMDAwMAo=/$GRAPHQL_URI/g" {} \; | ||
exec "$@" |
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
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
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
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
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,76 @@ | ||
#@ load("@ytt:data", "data") | ||
#@ app = "balance-by-account" | ||
#@ app_port = data.values.BALANCE_BY_ACCOUNT_PORT | ||
#@ image_version = "latest" | ||
#@ image = "{}/{}/{}/{}:{}".format(data.values.GITHUB_REGISTRY, data.values.GITHUB_ORG, data.values.GITHUB_REPO_NAME, app, image_version) | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: #@ app + "-deployment" | ||
labels: | ||
app: #@ app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: #@ app | ||
template: | ||
metadata: | ||
labels: | ||
app: #@ app | ||
spec: | ||
containers: | ||
- name: #@ app | ||
image: #@ image | ||
ports: | ||
- containerPort: #@ app_port | ||
env: | ||
- name: PGDATABASE | ||
value: #@ data.values.PGDATABASE | ||
- name: PGUSER | ||
value: #@ data.values.PGUSER | ||
- name: PGPASSWORD | ||
value: #@ data.values.PGPASSWORD | ||
- name: PGHOST | ||
value: postgres | ||
- name: PGPORT | ||
value: #@ "{}".format(data.values.PGPORT) | ||
- name: PG_MAX_CONNECTIONS | ||
value: "20" | ||
- name: PG_IDLE_TIMEOUT | ||
value: "10000" | ||
- name: PG_CONN_TIMEOUT | ||
value: "500" | ||
- name: READINESS_CHECK_PATH | ||
value: #@ data.values.READINESS_CHECK_PATH | ||
- name: #@ app.upper().replace("-", "_") + "_PORT" | ||
value: #@ "{}".format(app_port) | ||
livenessProbe: | ||
httpGet: | ||
path: #@ data.values.READINESS_CHECK_PATH | ||
port: #@ app_port | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: #@ data.values.READINESS_CHECK_PATH | ||
port: #@ app_port | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 5 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: #@ app | ||
spec: | ||
selector: | ||
app: #@ app | ||
ports: | ||
- protocol: TCP | ||
port: #@ app_port | ||
targetPort: #@ app_port | ||
type: ClusterIP |
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,52 @@ | ||
#@ load("@ytt:data", "data") | ||
#@ app = "client" | ||
#@ app_port = 80 | ||
#@ image_version = "latest" | ||
#@ image = "{}/{}/{}/{}:{}".format(data.values.GITHUB_REGISTRY, data.values.GITHUB_ORG, data.values.GITHUB_REPO_NAME, app, image_version) | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: #@ app + "-deployment" | ||
labels: | ||
app: #@ app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: #@ app | ||
template: | ||
metadata: | ||
labels: | ||
app: #@ app | ||
spec: | ||
containers: | ||
- name: #@ app | ||
image: #@ image | ||
ports: | ||
- containerPort: #@ app_port | ||
env: | ||
- name: GRAPHQL_URI | ||
valueFrom: | ||
configMapKeyRef: | ||
name: client-config | ||
key: GRAPHQL_URI | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: #@ app | ||
spec: | ||
selector: | ||
app: #@ app | ||
ports: | ||
- protocol: TCP | ||
port: #@ app_port | ||
targetPort: #@ app_port | ||
type: ClusterIP | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: client-config | ||
data: | ||
GRAPHQL_URI: aHR0cDovL2xvY2FsaG9zdDozMDAwMAo= |
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,54 @@ | ||
#@ load("@ytt:data", "data") | ||
#@ app = "event" | ||
#@ image_version = "latest" | ||
#@ image = "{}/{}/{}/{}:{}".format(data.values.GITHUB_REGISTRY, data.values.GITHUB_ORG, data.values.GITHUB_REPO_NAME, app, image_version) | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: #@ app + "-deployment" | ||
labels: | ||
app: #@ app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: #@ app | ||
template: | ||
metadata: | ||
labels: | ||
app: #@ app | ||
spec: | ||
containers: | ||
- name: #@ app | ||
image: #@ image | ||
env: | ||
- name: PGDATABASE | ||
value: #@ data.values.PGDATABASE | ||
- name: PGUSER | ||
value: #@ data.values.PGUSER | ||
- name: PGPASSWORD | ||
value: #@ data.values.PGPASSWORD | ||
- name: PGHOST | ||
value: postgres | ||
- name: PGPORT | ||
value: #@ "{}".format(data.values.PGPORT) | ||
- name: REDIS_DB | ||
value: #@ "{}".format(data.values.REDIS_DB) | ||
- name: REDIS_HOST | ||
#! todo: remove hardcode | ||
value: redis | ||
- name: REDIS_PORT | ||
value: #@ "{}".format(data.values.REDIS_PORT) | ||
- name: REDIS_USERNAME | ||
value: #@ data.values.REDIS_USERNAME | ||
- name: REDIS_PASSWORD | ||
value: #@ data.values.REDIS_PASSWORD | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- echo | ||
- -n | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 |
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,78 @@ | ||
#@ load("@ytt:data", "data") | ||
#@ app = "graphql" | ||
#@ app_port = data.values.GRAPHQL_PORT | ||
#@ image_version = "latest" | ||
#@ image = "{}/{}/{}/{}:{}".format(data.values.GITHUB_REGISTRY, data.values.GITHUB_ORG, data.values.GITHUB_REPO_NAME, app, image_version) | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: #@ app + "-deployment" | ||
labels: | ||
app: #@ app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: #@ app | ||
template: | ||
metadata: | ||
labels: | ||
app: #@ app | ||
spec: | ||
containers: | ||
- name: #@ app | ||
image: #@ image | ||
ports: | ||
- containerPort: #@ app_port | ||
env: | ||
- name: RULE_URL | ||
value: #@ "http://rule:" + "{}".format(data.values.RULE_PORT) | ||
- name: REQUEST_CREATE_URL | ||
value: #@ "http://request-create:" + "{}".format(data.values.REQUEST_CREATE_PORT) | ||
- name: REQUEST_APPROVE_URL | ||
value: #@ "http://request-approve:" + "{}".format(data.values.REQUEST_APPROVE_PORT) | ||
- name: REQUEST_BY_ID_URL | ||
value: #@ "http://request-by-id:" + "{}".format(data.values.REQUEST_BY_ID_PORT) | ||
- name: REQUESTS_BY_ACCOUNT_URL | ||
value: #@ "http://requests-by-account:" + "{}".format(data.values.REQUESTS_BY_ACCOUNT_PORT) | ||
- name: TRANSACTIONS_BY_ACCOUNT_URL | ||
value: #@ "http://transactions-by-account:" + "{}".format(data.values.TRANSACTIONS_BY_ACCOUNT_PORT) | ||
- name: TRANSACTION_BY_ID_URL | ||
value: #@ "http://transaction-by-id:" + "{}".format(data.values.TRANSACTION_BY_ID_PORT) | ||
- name: BALANCE_BY_ACCOUNT_URL | ||
value: #@ "http://balance-by-account:" + "{}".format(data.values.BALANCE_BY_ACCOUNT_PORT) | ||
- name: READINESS_CHECK_PATH | ||
value: #@ data.values.READINESS_CHECK_PATH | ||
- name: RUST_LOG | ||
value: "info" | ||
- name: GRAPHQL_PORT | ||
value: #@ "{}".format(app_port) | ||
livenessProbe: | ||
httpGet: | ||
path: #@ data.values.READINESS_CHECK_PATH | ||
port: #@ app_port | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 5 | ||
readinessProbe: | ||
httpGet: | ||
path: #@ data.values.READINESS_CHECK_PATH | ||
port: #@ app_port | ||
initialDelaySeconds: 10 | ||
periodSeconds: 10 | ||
timeoutSeconds: 5 | ||
failureThreshold: 5 | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: #@ app | ||
spec: | ||
selector: | ||
app: #@ app | ||
ports: | ||
- protocol: TCP | ||
port: #@ app_port | ||
targetPort: #@ app_port | ||
type: ClusterIP |
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,2 @@ | ||
RELATIVE_PROJECT_ROOT_PATH=$(shell REL_PATH="."; while [ $$(ls "$$REL_PATH" | grep project.yaml | wc -l | xargs) -eq 0 ]; do REL_PATH="$$REL_PATH./.."; done; printf '%s' "$$REL_PATH") | ||
include $(RELATIVE_PROJECT_ROOT_PATH)/make/shared.mk |
Oops, something went wrong.