---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd-small
spec:
  replicas: 2
  selector:
    matchLabels:
      app: httpd-small
  template:
    metadata:
      labels:
        app: httpd-small
    spec:
      containers:
        - name: server
          image: nginx:1.14.2
          imagePullPolicy: Always
          securityContext:
            runAsNonRoot: true
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop:
                - ALL
          resources:
            limits:
              cpu: 75m
              memory: 64Mi
            requests:
              cpu: 15m
              memory: 32Mi
          livenessProbe:
            exec:
              command:
              - "true"
            initialDelaySeconds: 1
---
apiVersion: v1
kind: Service
metadata:
  name: httpd-small
spec:
  selector:
    app: httpd-small
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: httpd-big
spec:
  replicas: 1
  selector:
    matchLabels:
      app: httpd-big
  template:
    metadata:
      labels:
        app: httpd-big
    spec:
      containers:
        - name: server
          image: nginx:1.14.2
          imagePullPolicy: Always
          securityContext:
            runAsNonRoot: true
            allowPrivilegeEscalation: false
            readOnlyRootFilesystem: true
            capabilities:
              drop:
                - ALL
          resources:
            limits:
              cpu: 800m
              memory: 1Gi
            requests:
              cpu: 200m
              memory: 256Mi
          livenessProbe:
            exec:
              command:
              - "true"
            initialDelaySeconds: 1
          volumeMounts:
            - mountPath: "/usr/local/apache2/htdocs/"
              name: httpd-big-storage
      volumes:
        - name: httpd-big-storage
          persistentVolumeClaim:
            claimName: httpd-big-pvc
---
apiVersion: v1
kind: Service
metadata:
  name: httpd-big
spec:
  selector:
    app: httpd-big
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
---
apiVersion: batch/v1
kind: CronJob
metadata:
  name: cron-5m
spec:
  schedule: "*/5 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: cron-job
              image: busybox
              imagePullPolicy: Always
              securityContext:
                runAsNonRoot: true
                allowPrivilegeEscalation: false
                readOnlyRootFilesystem: true
                capabilities:
                  drop:
                    - ALL
              resources:
                limits:
                  cpu: 50m
                  memory: 128Mi
                requests:
                  cpu: 20m
                  memory: 64Mi
              livenessProbe:
                exec:
                  command:
                  - "true"
              args:
                - /bin/sh
                - -c
                - date; echo Hello from the Kubernetes cluster
          restartPolicy: Never
---
apiVersion: v1
kind: Secret
metadata:
  name: secret1
type: Opaque
data: {}
---
apiVersion: v1
kind: Secret
metadata:
  name: secret2
type: Opaque
data: {}
---
apiVersion: v1
kind: Secret
metadata:
  name: secret3
type: Opaque
data: {}
---
apiVersion: v1
kind: Secret
metadata:
  name: secret4
type: Opaque
data: {}
---
apiVersion: v1
kind: Secret
metadata:
  name: secret5
type: Opaque
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap1
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap2
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap3
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap4
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap5
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap6
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap7
data: {}
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: configmap8
data: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: httpd-big-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  # storageClassName: "thin-csi"
