artifactory-binarystore.yaml 10.7 KB
Newer Older
Joe Mayer's avatar
Joe Mayer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235
kind: ConfigMap
apiVersion: v1
metadata:
  name: {{ template "artifactory-ha.fullname" . }}-bs
  labels:
    app: {{ template "artifactory-ha.name" . }}
    chart: {{ template "artifactory-ha.chart" . }}
    heritage: {{ .Release.Service }}
    release: {{ .Release.Name }}
data:
  binarystore.xml: |-
{{- if eq .Values.artifactory.persistence.type "file-system" }}
    <!-- File system replication -->
    {{- if .Values.artifactory.persistence.fileSystem.existingSharedClaim.enabled }}
    <!-- File Storage- Dynamic for Artifactory files, pre-created for DATA and BACKUP -->
    <config version="4">
        <chain>
            <provider id="cache-fs" type="cache-fs">                   <!-- This is a cached filestore -->
                <provider id="sharding" type="sharding">                   <!-- This is a sharding provider -->
                    {{- range $sharedClaimNumber, $e := until (.Values.artifactory.persistence.fileSystem.existingSharedClaim.numberOfExistingClaims|int) -}}
                    <sub-provider id="shard{{ $sharedClaimNumber }}" type="state-aware"/>
                    {{- end }}
                </provider>
            </provider>
        </chain>
        
        // Specify the read and write strategy and redundancy for the sharding binary provider
        <provider id="sharding" type="sharding">
            <readBehavior>roundRobin</readBehavior>                     
            <writeBehavior>percentageFreeSpace</writeBehavior>
            <redundancy>2</redundancy>
        </provider>
        
        {{- range $sharedClaimNumber, $e := until (.Values.artifactory.persistence.fileSystem.existingSharedClaim.numberOfExistingClaims|int) -}}
        //For each sub-provider (mount), specify the filestore location
        <provider id="shard{{ $sharedClaimNumber }}" type="state-aware">
            <fileStoreDir>filestore{{ $sharedClaimNumber }}</fileStoreDir>
        </provider>
        {{- end }}
    </config>
    {{- else }}
    <config version="2">
        <chain>
            <provider id="cache-fs" type="cache-fs">
                <provider id="sharding-cluster" type="sharding-cluster">
                    <readBehavior>crossNetworkStrategy</readBehavior>
                    <writeBehavior>crossNetworkStrategy</writeBehavior>
                    <redundancy>{{ .Values.artifactory.persistence.redundancy }}</redundancy>
                    <lenientLimit>2</lenientLimit>
                    <minSpareUploaderExecutor>2</minSpareUploaderExecutor>
                    <sub-provider id="state-aware" type="state-aware"/>
                    <dynamic-provider id="remote" type="remote"/>
                    <property name="zones" value="local,remote"/>
                </provider>
            </provider>
        </chain>

        <!-- Shards add local file-system provider configuration -->
        <provider id="state-aware" type="state-aware">
            <fileStoreDir>shard-fs-1</fileStoreDir>
            <zone>local</zone>
        </provider>

        <!-- Shards dynamic remote provider configuration -->
        <provider id="remote" type="remote">
            <checkPeriod>30</checkPeriod>
            <serviceId>tester-remote1</serviceId>
            <timeout>10000</timeout>
            <zone>remote</zone>
            <property name="header.remote.block" value="true"/>
        </provider>
    </config>
    {{- end }}
{{- end }}

{{- if eq .Values.artifactory.persistence.type "google-storage" }}
    <!-- Google storage -->
    <config version="2">
        <chain>
            <provider id="sharding-cluster" type="sharding-cluster">
                <readBehavior>crossNetworkStrategy</readBehavior>
                <writeBehavior>crossNetworkStrategy</writeBehavior>
                <redundancy>{{ .Values.artifactory.persistence.redundancy }}</redundancy>
                <minSpareUploaderExecutor>2</minSpareUploaderExecutor>
                <sub-provider id="eventual-cluster" type="eventual-cluster">
                    <provider id="retry" type="retry">
                        <provider id="google-storage" type="google-storage"/>
                    </provider>
                </sub-provider>
                <dynamic-provider id="remote" type="remote"/>
                <property name="zones" value="local,remote"/>
            </provider>
        </chain>

        <!-- Set max cache-fs size -->
        <provider id="cache-fs" type="cache-fs">
            <maxCacheSize>{{ .Values.artifactory.persistence.maxCacheSize }}</maxCacheSize>
        </provider>

        <provider id="eventual-cluster" type="eventual-cluster">
            <zone>local</zone>
        </provider>

        <provider id="remote" type="remote">
            <checkPeriod>30</checkPeriod>
            <timeout>10000</timeout>
            <zone>remote</zone>
        </provider>

        <provider id="file-system" type="file-system">
            <fileStoreDir>{{ .Values.artifactory.persistence.mountPath }}/data/filestore</fileStoreDir>
            <tempDir>/tmp</tempDir>
        </provider>

        <provider id="google-storage" type="google-storage">
            <providerId>google-cloud-storage</providerId>
            <endpoint>commondatastorage.googleapis.com</endpoint>
            <httpsOnly>false</httpsOnly>
            <bucketName>{{ .Values.artifactory.persistence.googleStorage.bucketName }}</bucketName>
            <identity>{{ .Values.artifactory.persistence.googleStorage.identity }}</identity>
            <credential>{{ .Values.artifactory.persistence.googleStorage.credential }}</credential>
            <path>{{ .Values.artifactory.persistence.googleStorage.path }}</path>
            <bucketExists>{{ .Values.artifactory.persistence.googleStorage.bucketExists }}</bucketExists>
        </provider>
    </config>
{{- end }}

{{- if eq .Values.artifactory.persistence.type "aws-s3" }}
    <!-- AWS S3 -->
    <config version="2">
        <chain> <!--template="cluster-s3"-->
            <provider id="cache-fs" type="cache-fs">
                <provider id="sharding-cluster" type="sharding-cluster">
                    <sub-provider id="eventual-cluster" type="eventual-cluster">
                        <provider id="retry-s3" type="retry">
                            <provider id="s3" type="s3"/>
                        </provider>
                    </sub-provider>
                    <dynamic-provider id="remote" type="remote"/>
                </provider>
            </provider>
        </chain>

        <!-- Set max cache-fs size -->
        <provider id="cache-fs" type="cache-fs">
            <maxCacheSize>{{ .Values.artifactory.persistence.maxCacheSize }}</maxCacheSize>
        </provider>

        <provider id="eventual-cluster" type="eventual-cluster">
            <zone>local</zone>
        </provider>

        <provider id="remote" type="remote">
            <checkPeriod>30</checkPeriod>
            <timeout>10000</timeout>
            <zone>remote</zone>
        </provider>

        <provider id="sharding-cluster" type="sharding-cluster">
            <readBehavior>crossNetworkStrategy</readBehavior>
            <writeBehavior>crossNetworkStrategy</writeBehavior>
            <redundancy>{{ .Values.artifactory.persistence.redundancy }}</redundancy>
            <property name="zones" value="local,remote"/>
        </provider>

        <provider id="s3" type="s3">
            <endpoint>{{ .Values.artifactory.persistence.awsS3.endpoint }}</endpoint>
        {{- if .Values.artifactory.persistence.awsS3.roleName }}
            <roleName>{{ .Values.artifactory.persistence.awsS3.roleName }}</roleName>
            <refreshCredentials>true</refreshCredentials>
        {{- else }}
            <refreshCredentials>{{ .Values.artifactory.persistence.awsS3.refreshCredentials }}</refreshCredentials>
        {{- end }}
            <s3AwsVersion>{{ .Values.artifactory.persistence.awsS3.s3AwsVersion }}</s3AwsVersion>
            <testConnection>{{ .Values.artifactory.persistence.awsS3.testConnection }}</testConnection>
            <httpsOnly>true</httpsOnly>
            <region>{{ .Values.artifactory.persistence.awsS3.region }}</region>
            <bucketName>{{ .Values.artifactory.persistence.awsS3.bucketName }}</bucketName>
        {{- if .Values.artifactory.persistence.awsS3.identity }}
            <identity>{{ .Values.artifactory.persistence.awsS3.identity }}</identity>
        {{- end }}
        {{- if .Values.artifactory.persistence.awsS3.credential }}
            <credential>{{ .Values.artifactory.persistence.awsS3.credential }}</credential>
        {{- end }}
            <path>{{ .Values.artifactory.persistence.awsS3.path }}</path>
        {{- range $key, $value := .Values.artifactory.persistence.awsS3.properties }}
            <property name="{{ $key }}" value="{{ $value }}"/>
        {{- end }}
        </provider>
    </config>
{{- end }}

{{- if eq .Values.artifactory.persistence.type "azure-blob" }}
    <!-- Azure Blob Storage -->
    <config version="2">
        <chain> <!--template="cluster-azure-blob-storage"-->
            <provider id="cache-fs" type="cache-fs">
                <provider id="sharding-cluster" type="sharding-cluster">
                    <sub-provider id="eventual-cluster" type="eventual-cluster">
                        <provider id="retry-azure-blob-storage" type="retry">
                            <provider id="azure-blob-storage" type="azure-blob-storage"/>
                        </provider>
                    </sub-provider>
                    <dynamic-provider id="remote" type="remote"/>
                </provider>
            </provider>
        </chain>
    
        <!-- cluster eventual Azure Blob Storage Service default chain -->
        <provider id="sharding-cluster" type="sharding-cluster">
            <readBehavior>crossNetworkStrategy</readBehavior>
            <writeBehavior>crossNetworkStrategy</writeBehavior>
            <redundancy>2</redundancy>
            <lenientLimit>1</lenientLimit>
            <property name="zones" value="local,remote"/>
        </provider>
    
        <provider id="remote" type="remote">
            <zone>remote</zone>
        </provider>
    
        <provider id="eventual-cluster" type="eventual-cluster">
            <zone>local</zone>
        </provider>
    
        <!--cluster eventual template-->
        <provider id="azure-blob-storage" type="azure-blob-storage">
            <accountName>{{ .Values.artifactory.persistence.azureBlob.accountName }}</accountName>
            <accountKey>{{ .Values.artifactory.persistence.azureBlob.accountKey }}</accountKey>
            <endpoint>{{ .Values.artifactory.persistence.azureBlob.endpoint }}</endpoint>
            <containerName>{{ .Values.artifactory.persistence.azureBlob.containerName }}</containerName>
            <testConnection>{{ .Values.artifactory.persistence.azureBlob.testConnection }}</testConnection>
        </provider>
    </config>
{{- end }}