apiVersion: apps/v1
kind: Deployment
metadata:
  name: java-guestbook-frontend
  labels:
    app: java-guestbook
    tier: frontend
spec:
  replicas: 1
  selector:
    matchLabels:
      app: java-guestbook
      tier: frontend
  template:
    metadata:
      labels:
        app: java-guestbook
        tier: frontend
    spec:
      containers:
      - name: frontend
        image: java-guestbook-frontend
        ports:
        - name: http-server
          containerPort: 8080
        env:
        - name: PORT
          value: "8080"
        - name: GUESTBOOK_API_ADDR
          value: java-guestbook-backend: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
