diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..b9f735b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "yaml.schemas": { + "https://json.schemastore.org/yamllint.json": "file:///home/fred.boniface/git/node.test/deploy.yaml" + } +} \ No newline at end of file diff --git a/README.md b/README.md index f966bf5..d01b0a8 100644 --- a/README.md +++ b/README.md @@ -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. -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` diff --git a/deploy.yaml b/deploy.yaml new file mode 100644 index 0000000..f60636a --- /dev/null +++ b/deploy.yaml @@ -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 \ No newline at end of file