42Atomys/webhooked

View on GitHub
examples/kubernetes/deployment.yaml

Summary

Maintainability
Test Coverage
---
# Configuration Map for deployment.yaml
# Edit it to change the configuration of your proxy
# Don't forget to restart your proxy after changing it
#
# Path: examples/kubernetes/deployment.yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: webhooked
data:
  webhooked.yaml: |
    apiVersion: v1alpha1
    specs:
    - name: exampleHook
      entrypointUrl: /webhooks/example
      security:
      - header:
          inputs:
          - name: headerName
            value: X-Hook-Secret
      - compare:
          inputs:
          - name: first
            value: '{{ .Outputs.header.value }}'
          - name: second
            valueFrom:
              envRef: SECRET_TOKEN
      storage:
      - type: redis
        specs:
          host: redis
          port: '6379'
          database: 0
          key: foo
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: webhooked
  labels:
    app.kubernetes.io/name: webhooked
    app.kubernetes.io/version: '0.6'
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: webhooked
  template:
    metadata:
      labels:
        app.kubernetes.io/name: webhooked
    spec:
      containers:
      - name: webhooked
        image: atomys/webhooked:0.6
        imagePullPolicy: IfNotPresent
        env:
          - name: SECRET_TOKEN
            value: verySecretToken
        resources:
          requests:
            memory: "10Mi"
            cpu: "10m"
          limits:
            memory: "15Mi"
            cpu: "20m"
        ports:
        - containerPort: 8080
          name: http
        volumeMounts:
        - mountPath: /config/webhooked.yaml
          name: configuration
          subPath: webhooked.yaml
      volumes:
      - name: configuration
        configMap:
          name: webhooked
---
apiVersion: v1
kind: Service
metadata:
  name: webhooked
spec:
  selector:
    app.kubernetes.io/name: webhooked
  ports:
  - port: 8080
    targetPort: 8080