#
# Starts a simple authorization server that use the 'responses.json' file in
# the secret telemeter-authorization to respond to authorization requests for
# the telemeter server. This is a stub service for testing.
#
kind: List
apiVersion: v1
items:
- kind: Service
  apiVersion: v1
  metadata:
    name: telemeter-authorization
  spec:
    selector:
      app: telemeter-authorization
    ports:
    - name: http
      port: 80
      targetPort: external
- kind: Deployment
  apiVersion: apps/v1
  metadata:
    name: telemeter-authorization
  spec:
    selector:
      matchLabels:
        app: telemeter-authorization
    template:
      metadata:
        labels:
          app: telemeter-authorization
      spec:
        volumes:
        - name: tokens
          secret:
            secretName: telemeter-authorization
        containers:
        - name: server
          image: openshift/origin-telemeter:v3.11
          volumeMounts:
          - name: tokens
            mountPath: /etc/authorization-server
          ports:
          - containerPort: 8080
            name: external
          command:
          - /usr/bin/authorization-server
          - 0.0.0.0:8080
          - /etc/authorization-server/responses.json
