Chapter 7. Use cases 171
To generate a hash for your environment, use the base64 command, as shown in 
Example 7-14.
Example 7-14   Creating base64 hash for password stored in secrets
[root@dcocp01 ~]# echo -n start1234|base64
c3RhcnQxMjM0
[root@dcocp01 ~]#
This scenario uses MongoDB 3.6.3 image available at the redhat registry 
(registry.access.redhat.com/rhscl/mongodb-36-rhel7). As shown in Example 7-15, our 
scenario creates a yaml file that picks any architecture between POWER and x86, but a 
different weight can be set to give preference to one architecture. This pod definition makes it 
transparent to the cluster operator if the MongoDB is being deployed on-premise, in the cloud, 
on POWER, or on x86. The image has a unique name, although a container for each 
architecture exists and is pulled accordingly without any user input.
Example 7-15   Yaml file for the MongoDB Pod
apiVersion: v1
kind: Pod
metadata:
  annotations:
    productName: MongoDB
    productVersion: 3.6.3
  labels:
    app: appmongo-ibm-mongodb-dev
  name: appmongo-ibm-mongodb-dev
  namespace: default
spec:
  affinity:
    nodeAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - preference:
          matchExpressions:
          - key: beta.kubernetes.io/arch
            operator: In
            values:
            - amd64
        weight: 2
      - preference:
          matchExpressions:
          - key: beta.kubernetes.io/arch
            operator: In
            values:
            - ppc64le
        weight: 2
      requiredDuringSchedulingIgnoredDuringExecution:
        nodeSelectorTerms:
        - matchExpressions:
          - key: beta.kubernetes.io/arch
            operator: In
            values:
            - amd64
            - ppc64le
  containers: