apiVersion: apps/v1
kind: StatefulSet
metadata:
  annotations:
    k8tz.io/injected: "true"
    k8tz.io/timezone: UTC
  name: web
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  serviceName: nginx
  template:
    metadata:
      annotations:
        k8tz.io/injected: "true"
        k8tz.io/timezone: UTC
      labels:
        app: nginx
    spec:
      containers:
      - env:
        - name: TZ
          value: UTC
        image: k8s.gcr.io/nginx-slim:0.8
        name: nginx
        ports:
        - containerPort: 80
          name: web
        volumeMounts:
        - mountPath: /usr/share/nginx/html
          name: www
        - mountPath: /etc/localtime
          name: k8tz
          readOnly: true
          subPath: UTC
        - mountPath: /usr/share/zoneinfo
          name: k8tz
          readOnly: true
      initContainers:
      - args:
        - bootstrap
        image: testimage:0.0.0
        name: k8tz
        resources: {}
        volumeMounts:
        - mountPath: /mnt/zoneinfo
          name: k8tz
      terminationGracePeriodSeconds: 10
      volumes:
      - emptyDir: {}
        name: k8tz
  volumeClaimTemplates:
  - metadata:
      name: www
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
      storageClassName: my-storage-class
