Skip to content
Snippets Groups Projects
blog.yaml 2 KiB
Newer Older
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: blog
  labels:
    app.kubernetes.io/name: blog
spec:
  replicas: 2
  selector:
    matchLabels:
      app.kubernetes.io/name: blog
  template:
    metadata:
      labels:
        app.kubernetes.io/name: blog
    spec:
      automountServiceAccountToken: false
      containers:
          image: quay.io/shivering-isles/blog:2023.12.26.1634
          ports:
            - containerPort: 8080
              protocol: TCP
              name: http
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: 100m
              memory: 256Mi
          livenessProbe:
            httpGet:
              path: /status.txt
              port: http
            failureThreshold: 3
            periodSeconds: 5
          readinessProbe:
            httpGet:
              path: /status.txt
              port: http
            initialDelaySeconds: 5
            failureThreshold: 1
            successThreshold: 3
            periodSeconds: 5
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
      securityContext:
        runAsNonRoot: true
        seccompProfile:
          type: RuntimeDefault
      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: kubernetes.io/hostname
          whenUnsatisfiable: DoNotSchedule
          labelSelector:
            matchLabels:
              app.kubernetes.io/name: blog
          matchLabelKeys:
            - pod-template-hash
---
apiVersion: v1
kind: Service
metadata:
  name: blog
  labels:
    app.kubernetes.io/name: blog
spec:
  type: LoadBalancer
  selector:
    app.kubernetes.io/name: blog
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: http
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: blog
spec:
  minAvailable: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: blog