apiVersion: apps/v1
kind: Deployment
metadata:
  name: xss
spec:
  replicas: 1
  selector:
    matchLabels:
      app: xss
  template:
    metadata:
      labels:
        app: xss
        pod.flugsicherung/expose: "yes"
        networkpolicy.flugsicherung/allowUsersToChallenge: "yes"
        networkpolicy.flugsicherung/allowChallengeToUsers: "yes"
      annotations:
        pod.flugsicherung/expose: |-
          [
            { "port": 80, "title": "PwnPandas", "protocol": "http" }
          ]
    spec:
      containers:
        - name: xss
          image: registry.example.local/oss/ctf-challenges/main/web-xss
          imagePullPolicy: Always
          ports:
            - containerPort: 80
              protocol: TCP
          readinessProbe:
            exec:
              command:
                - curl
                - http://localhost:80/
            initialDelaySeconds: 3
            periodSeconds: 3
          livenessProbe:
            exec:
              command:
                - curl
                - http://localhost:80/
            initialDelaySeconds: 3
            periodSeconds: 10
          env:
            - name: FLAG
              valueFrom:
                secretKeyRef:
                  name: flugsicherung-flags
                  key: flag1
          resources:
            requests:
              memory: "256Mi"
              cpu: "64m"
            limits:
              memory: "512Mi"
              cpu: "1"
              ephemeral-storage: "128Mi"
      imagePullSecrets:
        - name: registry-credentials
