apiVersion: apps/v1
kind: Deployment
metadata:
  name: init-container-deploy
  labels:
    app: proxyserver
spec:
  selector:
    matchLabels:
      app: proxyserver
  template:
    metadata:
      labels:
        app: proxyserver
    spec:
      containers:
        - name: nginx
          image: nginx:1.21-alpine
          ports:
            - containerPort: 80
          resources:
            limits:
              memory: "128Mi"
              cpu: "500m"
          volumeMounts:
            - name: workdir
              mountPath: /usr/share/nginx/html
      initContainers:
        - name: install
          image: busybox
          command:
            - wget
            - "-O"
            - "/work-dir/index.html"
            - http://info.cern.ch
          volumeMounts:
            - name: workdir
              mountPath: "/work-dir"
      dnsPolicy: Default
      volumes:
        - name: workdir
          emptyDir: {}
