-
Notifications
You must be signed in to change notification settings - Fork 7
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 #57 from AnglesHQ/kubernetes-manifests
Kubernetes manifests to deploy Angles Dashboard
- Loading branch information
Showing
7 changed files
with
305 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: Namespace | ||
metadata: | ||
name: angles | ||
labels: | ||
name: angles | ||
--- |
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,66 @@ | ||
# before creating a persistent volume have to create the disk. | ||
# e.g. gcloud beta compute disks create --size=100GB angles-data-disk --region <region> --replica-zones <zones> | ||
|
||
#apiVersion: v1 | ||
#kind: PersistentVolume | ||
#metadata: | ||
# name: angles-persistent-volume | ||
# namespace: angles | ||
#spec: | ||
# accessModes: | ||
# - ReadWriteOnce | ||
# persistentVolumeReclaimPolicy: Retain | ||
# capacity: | ||
# storage: 100Gi | ||
# gcePersistentDisk: | ||
# fsType: ext4 | ||
# pdName: angles-data-disk | ||
# storageClassName: gcp-disk | ||
# | ||
#--- | ||
# | ||
#apiVersion: v1 | ||
#kind: PersistentVolumeClaim | ||
#metadata: | ||
# name: angles-persistent-volume-claim | ||
# namespace: angles | ||
#spec: | ||
# accessModes: | ||
# - ReadWriteOnce | ||
# resources: | ||
# requests: | ||
# storage: 100Gi | ||
# storageClassName: gcp-disk | ||
|
||
--- | ||
# storage for local cluster e.g. k3d | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: angles-persistent-volume | ||
namespace: angles | ||
labels: | ||
type: local | ||
spec: | ||
storageClassName: manual | ||
capacity: | ||
storage: 5Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
persistentVolumeReclaimPolicy: Retain | ||
hostPath: | ||
path: "/tmp/k3dvol" | ||
--- | ||
|
||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: angles-persistent-volume-claim | ||
namespace: angles | ||
spec: | ||
storageClassName: manual | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 5Gi |
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,61 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: angles-backend-config | ||
namespace: angles | ||
data: | ||
REACT_APP_SWAGGER_ANGLES_API_URL: "127.0.0.1:3002" | ||
REACT_APP_SWAGGER_SCHEMES: "http" | ||
PORT: "3002" | ||
BUILD_CLEAN_UP_AGE_IN_DAYS: "90" | ||
# change these credentials | ||
MONGO_ANGLES_USERNAME: "angleshq" | ||
MONGO_ANGLES_PASSWORD: "Password123" | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: angles-mongo-config | ||
namespace: angles | ||
data: | ||
MONGO_INITDB_ROOT_USERNAME: "admin" | ||
# change the admin password | ||
MONGO_INITDB_ROOT_PASSWORD: "@nglesPassword" | ||
MONGO_INITDB_DATABASE: "angles" | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: mongo-init | ||
namespace: angles | ||
data: | ||
mongo-init.sh: | | ||
mongo -- "$MONGO_INITDB_DATABASE" <<EOF | ||
db.createUser({ user: '$MONGO_ANGLES_USERNAME', pwd: '$MONGO_ANGLES_PASSWORD', roles: ['readWrite'] }); | ||
db.auth('$MONGO_ANGLES_USERNAME', '$MONGO_ANGLES_PASSWORD'); | ||
db.createCollection('builds'); | ||
db.createCollection('testexecutions'); | ||
db.createCollection('teams'); | ||
db.createCollection('phase'); | ||
db.createCollection('environments'); | ||
db.createCollection('baselines'); | ||
db.createCollection('screenshots'); | ||
db.testexecutions.createIndex({ build: 1 }); | ||
db.testexecutions.createIndex({ suite: 1, title: 1 }); | ||
db.build.createIndex({ team: 1 }); | ||
db.team.createIndex({ name: 1 }); | ||
db.phase.createIndex({ name: 1 }); | ||
db.environment.createIndex({ name: 1 }); | ||
db.screenshots.createIndex({ build: 1 }); | ||
db.screenshots.createIndex({ view: 1 }); | ||
EOF | ||
--- |
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 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: angles-mongo-database | ||
namespace: angles | ||
labels: | ||
app.kubernetes.io/name: angles-mongo-database | ||
spec: | ||
containers: | ||
- name: angles-mongo | ||
image: mongo:4.4.13 | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: '1500m' | ||
memory: '1000Mi' | ||
requests: | ||
cpu: '1000m' | ||
memory: '800Mi' | ||
ports: | ||
- containerPort: 27017 | ||
hostPort: 27017 | ||
envFrom: | ||
- configMapRef: | ||
name: angles-mongo-config | ||
env: | ||
- name: MONGO_ANGLES_PASSWORD | ||
valueFrom: | ||
configMapKeyRef: | ||
name: angles-backend-config | ||
key: MONGO_ANGLES_PASSWORD | ||
- name: MONGO_ANGLES_USERNAME | ||
valueFrom: | ||
configMapKeyRef: | ||
name: angles-backend-config | ||
key: MONGO_ANGLES_USERNAME | ||
volumeMounts: | ||
- name: mongo-init | ||
mountPath: /docker-entrypoint-initdb.d/mongo-init.sh | ||
subPath: mongo-init.sh | ||
- mountPath: "/data/db" | ||
subPath: "./db" | ||
name: angles-persistent-volume | ||
- mountPath: "/data/config" | ||
subPath: "./config" | ||
name: angles-persistent-volume | ||
volumes: | ||
- name: mongo-init | ||
configMap: | ||
name: mongo-init | ||
- name: angles-persistent-volume | ||
persistentVolumeClaim: | ||
claimName: angles-persistent-volume-claim | ||
|
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 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: angles-database-service | ||
namespace: angles | ||
spec: | ||
selector: | ||
app.kubernetes.io/name: angles-mongo-database | ||
type: ClusterIP | ||
ports: | ||
- name: mongo | ||
protocol: TCP | ||
port: 27017 | ||
targetPort: 27017 |
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,72 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: angles-dashboard-backend | ||
namespace: angles | ||
labels: | ||
app.kubernetes.io/name: angles-dashboard-backend | ||
spec: | ||
containers: | ||
- name: angles | ||
image: angleshq/angles:latest | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: '1500m' | ||
memory: '1500Mi' | ||
requests: | ||
cpu: '1000m' | ||
memory: '1000Mi' | ||
ports: | ||
- containerPort: 3002 | ||
hostPort: 3002 | ||
envFrom: | ||
- configMapRef: | ||
name: angles-backend-config | ||
env: | ||
- name: MONGO_URL | ||
value: "mongodb://$(MONGO_ANGLES_USERNAME):$(MONGO_ANGLES_PASSWORD)@$(ANGLES_DATABASE_SERVICE_SERVICE_HOST):$(ANGLES_DATABASE_SERVICE_SERVICE_PORT)/angles" | ||
|
||
volumeMounts: | ||
- mountPath: "/app/screenshots" | ||
subPath: "./screenshots" | ||
name: angles-persistent-volume | ||
- mountPath: "/app/compares" | ||
subPath: "./compares" | ||
name: angles-persistent-volume | ||
volumes: | ||
- name: angles-persistent-volume | ||
persistentVolumeClaim: | ||
claimName: angles-persistent-volume-claim | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: angles-dashboard-frontend | ||
namespace: angles | ||
labels: | ||
app.kubernetes.io/name: angles-dashboard-frontend | ||
spec: | ||
containers: | ||
- name: angles-ui | ||
image: angleshq/angles-ui:latest | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: '2000m' | ||
memory: '1500Mi' | ||
requests: | ||
cpu: '1500m' | ||
memory: '1000Mi' | ||
ports: | ||
- containerPort: 3003 | ||
hostPort: 3003 | ||
env: | ||
- name: REACT_APP_ANGLES_API_URL | ||
# this url is what the front-end app should call. | ||
# value: "http://$(ANGLES_BACKEND_SERVICE_SERVICE_HOST):$(ANGLES_BACKEND_SERVICE_SERVICE_PORT)" | ||
value: "http://127.0.0.1:$(ANGLES_BACKEND_SERVICE_SERVICE_PORT)" | ||
- name: PORT | ||
value: "3003" |
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,31 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: angles-backend-service | ||
namespace: angles | ||
spec: | ||
selector: | ||
app.kubernetes.io/name: angles-dashboard-backend | ||
type: ClusterIP | ||
ports: | ||
- name: webservice | ||
protocol: TCP | ||
port: 3002 | ||
targetPort: 3002 | ||
|
||
--- | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: angles-frontend-service | ||
namespace: angles | ||
spec: | ||
selector: | ||
app.kubernetes.io/name: angles-dashboard-frontend | ||
type: ClusterIP | ||
ports: | ||
- name: web | ||
protocol: TCP | ||
port: 3003 | ||
targetPort: 3003 |