apiVersion: apps/v1
kind: Deployment
metadata:
  name: xdbsearchworker
  labels:
    app: xdbsearchworker
spec:
  replicas: 1
  selector:
    matchLabels:
      app: xdbsearchworker
  template:
    metadata:
      labels:
        app: xdbsearchworker
    spec:
      nodeSelector:
        beta.kubernetes.io/os: windows
      containers:
      - name: sitecore-xp1-xdbsearchworker
        image: "{{ .Values.image }}"
        imagePullPolicy: Always
        env:
        - name: Database_Server
          valueFrom:
            secretKeyRef:
              name: sitecore-database
              key: sitecore-databaseservername.txt
        - name: Collection_ShardMapManager_Database_Username
          valueFrom:
            secretKeyRef:
              name: sitecore-database
              key: sitecore-collection-shardmapmanager-database-username.txt
        - name: Collection_ShardMapManager_Database_Password
          valueFrom:
            secretKeyRef:
              name: sitecore-database
              key: sitecore-collection-shardmapmanager-database-password.txt
        - name: Sitecore_License
          valueFrom:
            secretKeyRef:
              name: sitecore-license
              key: sitecore-license.txt
        - name: Sitecore_ConnectionStrings_Collection
          value: Data Source=$(Database_Server);Initial Catalog=Sitecore.Xdb.Collection.ShardMapManager;User ID=$(Collection_ShardMapManager_Database_Username);Password=$(Collection_ShardMapManager_Database_Password);
        - name: Sitecore_ConnectionStrings_SolrCore
          valueFrom:
            secretKeyRef:
              name: sitecore-solr-xdb
              key: sitecore-solr-connection-string-xdb.txt
        - name: Sitecore_Sitecore__XConnect__SearchIndexer__Services__Solr.SolrReaderSettings__Options__RequireHttps
          value: 'false'
        - name: Sitecore_Sitecore__XConnect__SearchIndexer__Services__Solr.SolrWriterSettings__Options__RequireHttps
          value: 'false'
        - name: Sitecore_Sitecore__XConnect__CollectionSearch__Services__XConnectSolrHealthCheckServicesConfiguration__Options__RequireHttps
          value: 'false'
        livenessProbe:
          exec:
            command:
            - curl
            - http://localhost:8080/healthz/live
          timeoutSeconds: 300
          periodSeconds: 30
          failureThreshold: 3
        startupProbe:
          exec:
            command:
            - curl
            - http://localhost:8080/healthz/ready
          timeoutSeconds: 300
          periodSeconds: 30
          failureThreshold: 10
      imagePullSecrets:
      - name: sitecore-docker-registry
