apiVersion: apps/v1
kind: Deployment
metadata:
  name: appd-java-deployment-auto
  labels:
    appName: Java-deployment-label
    lang: java
spec:
  selector:
    matchLabels:
      app: appd-java-deployment-auto
  replicas: 1
  template:
    metadata:
      labels:
        appName: Java-template-label
        app: appd-java-deployment-auto
        tier: backend
    spec:
      serviceAccountName: appd-account
      containers:
      - image: sashaz/java-services:v6 # application image
        imagePullPolicy: "IfNotPresent"
        name: java-app-deployment-auto
        command: 
           - /bin/sh
           - -c
           - java -jar /java-services.jar
        ports:
        - name: http
          containerPort: 8080
        resources: 
          limits:
            cpu: 500m
            memory: 500M
          requests:
            cpu: 500m
            memory: 500M
        # env:
        #   - name: APPDYNAMICS_AGENT_NODE_NAME
        #     value: JavaNode
        #   - name: APPDYNAMICS_AGENT_REUSE_NODE_NAME
        #     value: "true"
          # - name: JAVA_TOOL_OPTIONS
          #   value: " -javaagent:/opt/appdynamics-java/javaagent.jar -Dappdynamics.jvm.shutdown.mark.node.as.historical=true -Dappdynamics.agent.accountAccessKey=$(APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY) -Dappdynamics.agent.reuse.nodeName=true -Dappdynamics.socket.collection.bci.enable=true "
          # envFrom:
        # - configMapRef:
        #     name: appd-java-config
        # env:
        # - name: APPDYNAMICS_AGENT_TIER_NAME
        #   value: differentTier
        # - name: APPDYNAMICS_AGENT_ACCOUNT_ACCESS_KEY
        #   valueFrom:
        #     secretKeyRef:
        #       name: appd-secrets
        #       key: account-access-key

