apiVersion: apps/v1
kind: Deployment
metadata:
  name: keycloak
spec:
  replicas: 1
  selector:
    matchLabels:
      app: keycloak
  template: # create pods using pod definition in this template
    metadata:
      labels:
        app: keycloak
        context: keycloak
    spec:
      containers:
      - name: keycloak
        image: jboss/keycloak
        env:
        - name: KEYCLOAK_USER
          value: admin
        - name: KEYCLOAK_PASSWORD
          value: admin
        - name: DB_VENDOR
          value: postgres
        - name: DB_ADDR
          value: postgres
        - name: DB_PORT
          value: "5432"
        - name: DB_USER
          value: keycloak
        - name: DB_PASSWORD
          value: keycloak
        - name: DB_DATABASE
          value: keycloak
        ports:
        - name: service
          containerPort: 8080
          protocol: TCP
