github.com/replicatedhq/ship@v0.55.0/integration/init/forgeops/expected/.ship/upstream/templates/ds.yaml (about)

     1  # Copyright (c) 2016-2018 ForgeRock AS. All Rights Reserved.
     2  apiVersion: apps/v1beta1
     3  kind: StatefulSet
     4  metadata:
     5    name: {{ .Values.instance }}
     6    labels:
     7      instance: {{ .Values.instance }}
     8      app: {{ template "fullname" . }}
     9      vendor: forgerock
    10      component: {{ .Values.component }}
    11      release: {{ .Release.Name }}
    12      heritage: {{ .Release.Service }}
    13  spec:
    14    serviceName: {{ .Values.instance }}
    15    replicas: {{default 1 .Values.replicas }}
    16    updateStrategy:
    17      type: RollingUpdate
    18    {{- if .Values.persistence }}
    19    volumeClaimTemplates:
    20    - metadata:
    21        name: db
    22        annotations:
    23          pv.beta.kubernetes.io/gid: "11111"
    24      spec:
    25        accessModes: [ "ReadWriteOnce" ]
    26        resources:
    27          requests:
    28            storage: {{ default "5Gi"  .Values.storageSize }}
    29        {{- if .Values.storageClass }}
    30        storageClassName:  {{ .Values.storageClass }}
    31        {{- end }}
    32    {{- end }}
    33    template:
    34      metadata:
    35        labels:
    36          instance: {{ .Values.instance }}
    37          app: {{ template "fullname" . }}
    38          vendor: forgerock
    39          release: {{ .Release.Name }}
    40          component: {{ .Values.component }}
    41      spec:
    42        affinity:
    43          podAntiAffinity:
    44          {{- if eq .Values.podAntiAffinity "hard" }}
    45            requiredDuringSchedulingIgnoredDuringExecution:
    46            - topologyKey: {{ .Values.topologyKey }}
    47              labelSelector:
    48                  matchExpressions:
    49                  - key: instance
    50                    operator: In
    51                    values:
    52                    - {{ .Values.instance }}
    53           {{- else if eq .Values.podAntiAffinity "soft" }}
    54            preferredDuringSchedulingIgnoredDuringExecution:
    55            - weight: 100
    56              podAffinityTerm:
    57                labelSelector:
    58                  matchExpressions:
    59                  - key: instance
    60                    operator: In
    61                    values:
    62                    - {{ .Values.instance }}
    63                topologyKey: {{ .Values.topologyKey }}
    64           {{- end }}
    65        terminationGracePeriodSeconds: 30
    66        # This will make sure the mounted PVCs are writable by the forgerock user with gid 111111.
    67        securityContext:
    68  {{ toYaml .Values.securityContext | indent 8 }}
    69        initContainers:
    70        {{ if .Values.restore.enabled }}
    71        - name: restore
    72          image:  {{ .Values.image.repository }}:{{ .Values.image.tag }}
    73          imagePullPolicy: {{ .Values.image.pullPolicy }}
    74          volumeMounts:
    75          - name: db
    76            mountPath: /opt/opendj/data
    77          - name: backup
    78            mountPath: /opt/opendj/bak
    79          - name: dj-secrets
    80            mountPath: /var/run/secrets/opendj
    81          envFrom:
    82          - configMapRef:
    83              name: {{ .Values.instance }}
    84          env:
    85          - name: NAMESPACE
    86            valueFrom:
    87              fieldRef:
    88                fieldPath: metadata.namespace
    89          args: [ "restore" ]
    90        {{- end }}
    91        containers:
    92        - name: ds
    93          image:  {{ .Values.image.repository }}:{{ .Values.image.tag }}
    94          imagePullPolicy: {{ .Values.image.pullPolicy }}
    95          #terminationGracePeriodSeconds: 10
    96          {{- if eq .Values.instance "ctsstore" }}
    97          lifecycle:
    98            postStart:
    99              exec:
   100                command: ["/bin/sh", "-c", "/opt/opendj/scripts/cts-poststart.sh"]
   101          {{ end }}
   102          resources:
   103  {{ toYaml .Values.resources | indent 12 }}
   104          envFrom:
   105          - configMapRef:
   106              name: {{ .Values.instance }}
   107          env:
   108          - name: NAMESPACE
   109            valueFrom:
   110              fieldRef:
   111                fieldPath: metadata.namespace
   112          ports:
   113          - containerPort: 1389
   114            name: ldap
   115          - containerPort: 4444
   116            name: admin
   117          - containerPort: 8989
   118            name: replication
   119          - containerPort: 8080
   120            name: metrics
   121          volumeMounts:
   122          - name: dj-secrets
   123            mountPath: /var/run/secrets/opendj
   124          - name: backup
   125            mountPath: /opt/opendj/bak
   126          - name: logs
   127            mountPath: /opt/opendj/logs
   128          - name: db
   129            mountPath: /opt/opendj/data
   130          args: [ "start" ]
   131          # Due to cost, we don't want to do a full scrape of the metrics http endpoint - so we create a tcp connection
   132          # todo: revisit when https://bugster.forgerock.org/jira/browse/OPENDJ-4728 is resolved.
   133          # TODO: Uncomment when we get ds to start faster. Seletively disable replication
   134          # readinessProbe:
   135          #   tcpSocket:
   136          #     port: metrics
   137          #   periodSeconds: 10
   138          livenessProbe:
   139            tcpSocket:
   140              port: metrics
   141            initialDelaySeconds: 60
   142            periodSeconds: 120
   143        volumes:
   144        - name: dj-secrets
   145          secret:
   146            secretName: {{ .Values.instance }}
   147        - name: logs
   148          emptyDir: {}
   149        {{- if .Values.backup.pvcClaimName }}
   150        - name: backup
   151          persistentVolumeClaim:
   152            claimName: {{ .Values.backup.pvcClaimName }}
   153        {{ else }}
   154        - name: backup
   155          emptyDir: {}
   156        {{ end }}
   157        {{- if not .Values.persistence }}
   158        - name: db
   159          emptyDir: {}
   160        {{ end }}