Skip to content

Commit

Permalink
Merge pull request #2 from kriipke/feature/k8s-manifests
Browse files Browse the repository at this point in the history
Feature/k8s manifests
  • Loading branch information
kriipke authored Mar 18, 2024
2 parents 65091f2 + a365f7e commit 37746fc
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 5 deletions.
7 changes: 3 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= GitOps Console image::docs/logo.png[20px,20px]
= GitOps Console: Web App
:doctype: article
:description: A README template written in AsciiDoc markup
:license-type: MIT
Expand Down Expand Up @@ -36,11 +36,10 @@ ifdef::env-github[]
<a href="https://github.com/kriipke/console-api">
<!-- REPLACE THE PLACEHOLDER LOGO WITH YOUR OWN LOGO AND ADJUST THE SIZE ACCORDINGLY -->
<img src="docs/logo.png" alt="Logo" width="30%" height="30%"></a>
<img src="docs/logo.png" alt="Logo" width="20%" height="20%"></a>
<!-- REPLACE THE FOLLOWING WITH YOUR REPOSITORY/PROJECT TITLE -->
<h3 align="center">GitOps Console</h3>
<h3 align="center">GitOps Console</h3><h4 align="center">Frontend Web App</h4>
<p align="center">
<!-- REPLACE THE FOLLOWING WITH YOUR REPOSITORY/PROJECT'S SHORT DESCRIPTION -->
Expand Down
12 changes: 12 additions & 0 deletions deploy/ambassador/host.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: getambassador.io/v3alpha1
kind: Host
metadata:
name: console-host
namespace: ambassador
spec:
hostname: console.kriipke.io
tlsSecret:
name: tls-cert
tlsContext:
name: tls-termination-context
17 changes: 17 additions & 0 deletions deploy/ambassador/listener-http.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
apiVersion: getambassador.io/v3alpha1
kind: Listener
metadata:
name: http-listener
spec:
port: 8080
protocol: HTTPS
# protocolStack:
# - PROXY
# - HTTP
# - TCP
securityModel: XFP
statsPrefix: http-listener
hostBinding:
namespace:
from: ALL
18 changes: 18 additions & 0 deletions deploy/ambassador/listener-https.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
apiVersion: getambassador.io/v3alpha1
kind: Listener
metadata:
name: https-listener
spec:
port: 8443
protocol: HTTPS
# protocolStack:
# - PROXY
# - TLS
# - HTTP
# - TCP
securityModel: XFP
statsPrefix: https-listener
hostBinding:
namespace:
from: ALL
10 changes: 10 additions & 0 deletions deploy/ambassador/mapping.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: console-frontend
namespace: console
spec:
host: console.kriipke.io
prefix: /
service: console-web.console:3000
11 changes: 11 additions & 0 deletions deploy/ambassador/secret-tls.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: v1
kind: Secret
metadata:
creationTimestamp: null
name: tls-cert
namespace: ambassador
type: kubernetes.io/tls
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUVjVENDQXRtZ0F3SUJBZ0lSQUpoZnFvcWQ4VmxDWldtYklsVXZSK0F3RFFZSktvWklodmNOQVFFTEJRQXcKZ1pzeEhqQWNCZ05WQkFvVEZXMXJZMlZ5ZENCa1pYWmxiRzl3YldWdWRDQkRRVEU0TURZR0ExVUVDd3d2YzNCbApibU5sY25OdGIyeGxia0J0WVdNdWFXUnRMbnBwYVc1akxuVnpJQ2hUY0dWdVkyVnlJRk50YjJ4bGJpa3hQekE5CkJnTlZCQU1NTm0xclkyVnlkQ0J6Y0dWdVkyVnljMjF2YkdWdVFHMWhZeTVwWkcwdWVtbHBibU11ZFhNZ0tGTncKWlc1alpYSWdVMjF2YkdWdUtUQWVGdzB5TkRBek1UY3hORFU1TURkYUZ3MHlOakEyTVRjeE5EVTVNRGRhTUdNeApKekFsQmdOVkJBb1RIbTFyWTJWeWRDQmtaWFpsYkc5d2JXVnVkQ0JqWlhKMGFXWnBZMkYwWlRFNE1EWUdBMVVFCkN3d3ZjM0JsYm1ObGNuTnR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RCQkdQbG13V2RNMG4xNDRsMkluUi9DbUtScjNGZGU2dHM1b0F4L1I2ci9wMjNwMFo4NUZvZ1ZGYUdVSzUKTHpjK2lSWlJLVWNMSDFZQUxCOTlFbURJU1UrZ1VCK3U0cVFESXhGWUlIUUkxenh0b0lvWTNmdlFxUUtCZ0ZtZApyMzZCay84WFRBeEQxM3JaeVh4NllOVUxqdlNoTE10VElpNVhjTXYwbzNvOHhRNzI4Q2lNUjdHNE5vT2VPRERKCmgydDQxWjEvcFp4cENXY25uTCtDcjloNTBQbUtjcS9VdEszNGFiRDk4aDFTMzRXZmlPZmFSUWkrUGdnaENwMFEKRnp6QWVxOGJZYjJXRm5EU1hSblRKV1ozVnU4NWJEWVlLWDd6WFV1eEFvR0FBNklNNVE2RHJkci9SZ1NvQmRJdgpiYnpveXdTSnBtamRORVlsaGQ2OE84cm5kRHkvZlpXb2VNeXNoVVN4ZnZDZDh2ZXpGMjJHZUtSZmtLa2RmdjRTCllOVktvT3FxRFY1V1l2dFZKdDRMWFVxRUlBSHJQZEVwTnMrV3hjKytrVU40SHNLWktxS284aWtWRUMvN2t2VTEKYTdRc0tsMndCSmpSMVN6cG4wNUVXanM9Ci0tLS0tRU5EIFBSSVZBVEUgS0VZLS0tLS0K
10 changes: 10 additions & 0 deletions deploy/ambassador/tlscontext.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: getambassador.io/v3alpha1
kind: TLSContext
metadata:
name: tls-termination-context
namespace: ambassador
spec:
hosts:
- console.kriipke.io
secret: tls-cert
9 changes: 9 additions & 0 deletions deploy/web/configmap-app.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: "v1"
kind: "ConfigMap"
metadata:
name: "console-web-env"
namespace: "console"
data:
CONSOLE_API_HOST: "console.kriipke.io"
CONSOLE_API_PORT: "443"
CLIENT_ORIGIN: "http://0.0.0.0:3000"
45 changes: 45 additions & 0 deletions deploy/web/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: console-web
namespace: console
spec:
replicas: 3
selector:
matchLabels:
app: console-web
template:
metadata:
labels:
app: console-web
spec:
containers:
- name: console-web
envFrom:
- configMapRef:
name: console-web-env
image: ghcr.io/kriipke/console-web:develop
imagePullPolicy: Always
ports:
- containerPort: 3000
name: http
resources:
limits:
cpu: 400m
memory: 256Mi
requests:
cpu: 200m
memory: 128Mi
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 10
periodSeconds: 5
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
19 changes: 19 additions & 0 deletions deploy/web/pod-autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: console-web
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: console-web
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50
14 changes: 14 additions & 0 deletions deploy/web/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: Service
metadata:
name: console-web
namespace: console
labels:
app: console-web
spec:
ports:
- port: 3000
targetPort: 3000
selector:
app: console-web
Binary file added docs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>GitOps Console</title>
</head>
<body>
<div id="root"></div>
<script src="/public/env.js"></script>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions public/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
window.env = {
API_BACKEND_HOST: '__API_BACKEND_HOST__',
API_BACKEND_PORT: '__API_BACKEND_PORT__',
}
Binary file modified public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 37746fc

Please sign in to comment.