generated from ministryofjustice/template-repository
-
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.
Browse files
Browse the repository at this point in the history
* PI-1969 Deploy dummy service for testing ingress issues * Pin Flask version
- Loading branch information
1 parent
a051a83
commit 6f10c5d
Showing
5 changed files
with
64 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 |
---|---|---|
|
@@ -17,6 +17,7 @@ jobs: | |
matrix: | ||
project: | ||
- feature-flags | ||
- ingress-test | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
|
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 @@ | ||
FROM python:3-slim | ||
WORKDIR /app | ||
|
||
RUN useradd --uid 100 --create-home --system app | ||
USER 100 | ||
|
||
RUN pip install --no-cache-dir Flask==3.0.2 | ||
COPY server.py server.py | ||
CMD ["python", "server.py"] |
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 @@ | ||
apiVersion: v2 | ||
appVersion: '1.0' | ||
description: A Helm chart for Kubernetes | ||
name: ingress-test | ||
version: 1.0.0 | ||
|
||
dependencies: | ||
- name: generic-service | ||
version: "2.8" | ||
repository: https://ministryofjustice.github.io/hmpps-helm-charts |
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,32 @@ | ||
--- | ||
generic-service: | ||
nameOverride: ingress-test | ||
|
||
replicaCount: 2 | ||
|
||
image: | ||
repository: ghcr.io/ministryofjustice/hmpps-probation-integration-services/ingress-test | ||
tag: "1.0" | ||
port: 5000 | ||
|
||
securityContext: | ||
runAsUser: 100 # app | ||
|
||
ingress: | ||
enabled: true | ||
host: ingress-test.probation-integration.service.justice.gov.uk | ||
tlsSecretName: ingress-test-cert | ||
|
||
allowlist: | ||
groups: | ||
- internal | ||
- unilink_staff | ||
|
||
readinessProbe: | ||
httpGet: | ||
path: /test/0 | ||
initialDelaySeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /test/0 | ||
initialDelaySeconds: 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,12 @@ | ||
from flask import Flask, make_response | ||
import time | ||
|
||
app = Flask(__name__) | ||
|
||
@app.route('/test/<int:n>', methods=['GET']) | ||
def test(n): | ||
time.sleep(n) | ||
return make_response('OK', 200) | ||
|
||
if __name__ == "__main__": | ||
app.run(host='0.0.0.0', port=5000, threaded=True) |