├── README.md ├── deployment.yaml └── service.yaml /README.md: -------------------------------------------------------------------------------- 1 | # Sample Application Deployment 2 | 3 | The repository contains Kubernetes manifests that defines the deployment of the 4 | [sample application](https://github.com/gitopsbook/sample-app). 5 | 6 | To deploy the application manually run the following command: 7 | 8 | ``` 9 | kubectl create ns sample-app 10 | kubectl apply -f . -n sample-app 11 | ``` 12 | 13 | To test the application run the command below and access http://localhost:8080/ 14 | 15 | ``` 16 | kubectl port-forward svc/sample-app 8080:80 -n sample-app 17 | ``` 18 | -------------------------------------------------------------------------------- /deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: sample-app 5 | spec: 6 | replicas: 1 7 | revisionHistoryLimit: 3 8 | selector: 9 | matchLabels: 10 | app: sample-app 11 | template: 12 | metadata: 13 | labels: 14 | app: sample-app 15 | spec: 16 | containers: 17 | - command: 18 | - /app/sample-app 19 | image: gitopsbook/sample-app:v0.1 20 | name: sample-app 21 | ports: 22 | - containerPort: 8080 23 | -------------------------------------------------------------------------------- /service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: sample-app 5 | spec: 6 | ports: 7 | - port: 80 8 | targetPort: 8080 9 | selector: 10 | app: sample-app 11 | --------------------------------------------------------------------------------