diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..cd19235 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +from tomcat:9 +copy target/*.war /usr/local/tomcat/webapps/train.war +cmd ["catalina.sh", "run"] \ No newline at end of file diff --git a/WebContent/sandy.jpg b/WebContent/sandy.jpg index d313c11..497dd60 100644 Binary files a/WebContent/sandy.jpg and b/WebContent/sandy.jpg differ diff --git a/deployment.yml b/deployment.yml new file mode 100644 index 0000000..490bd91 --- /dev/null +++ b/deployment.yml @@ -0,0 +1,57 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: my-app-deployment + labels: + app: my-app +spec: + replicas: 4 + selector: + matchLabels: + app: my-app + template: + metadata: + labels: + app: my-app + spec: + containers: + - name: my-container + image: deepakvsnv/train-ticket1 + ports: + - containerPort: 8080 +--- +apiVersion: v1 +kind: Service +metadata: + name: my-app-service + labels: + app: my-app +spec: + selector: + app: my-app + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: my-app-ingress + annotations: + nginx.ingress.kubernetes.io/rewrite-target: / +spec: + ingressClassName: nginx + rules: + - host: nginx.crydevops.shop + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: my-app-service + port: + number: 80 + diff --git a/service.yml b/service.yml new file mode 100644 index 0000000..741dfcf --- /dev/null +++ b/service.yml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: my-app-service + labels: + app: my-app +spec: + type: NodePort + selector: + app: my-app + ports: + - protocol: TCP + port: 80 + targetPort: 80