apiVersion: apps/v1
kind: Deployment
metadata:
  name: schema-registry-deployment
spec:
  selector:
    matchLabels:
      app: confluent-schema-registry
  replicas: 3
  template:
    metadata:
      labels:
        app: confluent-schema-registry
    spec:
      containers:
        - name: confluent-schema-registry
          image: confluentinc/cp-schema-registry:6.1.1
          command: ["bash", "-c", "unset SCHEMA_REGISTRY_PORT; /etc/confluent/docker/run"]
          ports:
          - containerPort: 8081
          env:
          - name: SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS
            value: PLAINTEXT://kfknode01:9092,PLAINTEXT://kfknode02:9092,PLAINTEXT://kfknode03:9092
          - name: SCHEMA_REGISTRY_LISTENERS
            value: http://0.0.0.0:8081
          - name: SCHEMA_REGISTRY_HOST_NAME
            valueFrom:
              fieldRef:
                fieldPath: status.podIP
          - name: SCHEMA_REGISTRY_HEAP_OPTS
            value: -Xms512M -Xmx1g
          - name: SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHOD
            value: GET,POST,PUT,OPTIONS
          - name: SCHEMA_REGISTRY_ACCESS_CONTROL_ORIGIN_ALLOW
            value:  "*"
          - name: SCHEMA_REGISTRY_KAFKASTORE_TOPIC
            value:  "data-avro-schemas"
          - name: SCHEMA_REGISTRY_SCHEMA_COMPATIBILITY_LEVEL
            value:  "full_transitive"
