add kubectl deployment file

This commit is contained in:
Fred Boniface 2022-12-15 10:32:54 +00:00
parent a1dfeb98ee
commit 2e10bb93c2
3 changed files with 39 additions and 1 deletions

5
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"yaml.schemas": {
"https://json.schemastore.org/yamllint.json": "file:///home/fred.boniface/git/node.test/deploy.yaml"
}
}

View File

@ -8,4 +8,4 @@ Where you run multiple instances it allows you to visually see how any load bala
A Dockerfile is provided, or a package is available: git.fjla.uk/fred.boniface/node-test:latest. A Dockerfile is provided, or a package is available: git.fjla.uk/fred.boniface/node-test:latest.
An example deployment file for kubectl is also included - it will likely need changing for your environment. The example uses hostPort to expose the service, you may prefer to adapt it to use ingress or loadBalancer. An example deployment file for kubectl is also included - it will likely need changing for your environment. The example uses hostPort to expose the service, you may prefer to adapt it to use ingress or loadBalancer. To use it as is, just run `kubectl apply -f https://git.fjla.uk/fred.boniface/node-test/raw/branch/main/deploy.yaml`

33
deploy.yaml Normal file
View File

@ -0,0 +1,33 @@
apiVersion: v1
kind: Service
metadata:
name: node-test
spec:
selector:
app: node-test
ports:
- port: 80
targetPort: 8900
nodePort: 30900
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-test
spec:
replicas: 5
selector:
matchLabels:
app: node-test
template:
metadata:
labels:
app: node-test
spec:
containers:
- name: node-test
image: git.fjla.uk/fred.boniface/node-test:latest
ports:
- containerPort: 8900
imagePullPolicy: Always