forked from Alethio/ethereum-lite-explorer
-
Notifications
You must be signed in to change notification settings - Fork 3
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 Alethio#69 from marlowl/master
Kubernetes manifest files for ethereum-lite-explorer
- Loading branch information
Showing
6 changed files
with
82 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,7 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: lite-explorer | ||
data: | ||
config.json: |- | ||
CONFIG_JSON |
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 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# Get config.json contents based on first program arg or default then escape special chars for sed replacements string then indent all lines with 4 spaces to align with output yaml | ||
config_json=$(cat ${1:-"../config.default.json"} | sed 's:[\/&]:\\&:g;$!s/$/\\/' | sed 's/^/ /') | ||
|
||
# Replace the placeholder from input yaml file and write a new one | ||
cat configmap.yaml | sed "s/ CONFIG_JSON/$config_json/" > configmap.generated.yaml | ||
|
||
kubectl apply -f configmap.generated.yaml | ||
kubectl apply -f explorer-deployment.yaml | ||
kubectl apply -f explorer-service.yaml | ||
|
||
# Clean up | ||
rm configmap.generated.* |
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,35 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: lite-explorer | ||
labels: | ||
app: lite-explorer | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: lite-explorer | ||
template: | ||
metadata: | ||
# Optional, if this'd be wrapped in a helm chart it can be generated as the SHA256 of the configmap | ||
# to pod rolling updates reloads on configmap change | ||
annotations: | ||
checksum/config: 6733181240aa3db87503350771fb19fcaef0707e209928165a9cc7e3e3050781 | ||
labels: | ||
app: lite-explorer | ||
spec: | ||
containers: | ||
- image: alethio/ethereum-lite-explorer | ||
imagePullPolicy: Always | ||
name: app | ||
ports: | ||
- containerPort: 80 | ||
name: http | ||
volumeMounts: | ||
- mountPath: /usr/share/nginx/html/config.json | ||
name: config | ||
subPath: config.json | ||
volumes: | ||
- configMap: | ||
name: lite-explorer | ||
name: config |
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: v1 | ||
kind: Service | ||
metadata: | ||
name: lite-explorer | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: lite-explorer |
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,3 @@ | ||
kubectl delete configmap lite-explorer | ||
kubectl delete -f explorer-deployment.yaml | ||
kubectl delete -f explorer-service.yaml |
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