apiVersion: apps/v1
kind: Deployment
metadata:
  name: java-hello-world
spec:
  replicas: 1
  selector:
    matchLabels:
      app: java-hello-world
  template:
    metadata:
      labels:
        app: java-hello-world
    spec:
      containers:
      - name: server
        image: java-hello-world
        ports:
        - containerPort: 8080
        env:
        - name: PORT
          value: "8080"
        # This environment variable enables debugging support for the container.
        # Remove this to disable the debug build.
        - name: JAVA_TOOL_OPTIONS
          value: -agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n,quiet=y
        readinessProbe:
          tcpSocket:
            port: 8080
          initialDelaySeconds: 5
