Uploaded image for project: 'Subscription Watch'
  1. Subscription Watch
  2. SWATCH-1848

Create moto definition for rhsm_subscriptions

XMLWordPrintable

    • False
    • Hide

      None

      Show
      None
    • False

      Moto can be applied to the rhsm clowdapp

      Definition:

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: moto
      spec:
        selector:
          matchLabels:
            app: moto
        replicas: 1
        template:
          metadata:
            labels:
              app: moto
          spec:
            containers:
              - name: container
                image: 'motoserver/moto:latest'
                ports:
                  - containerPort: 5000
                    protocol: TCP
                env:
                  - name: MOTO_PORT
                    value: '5000'
      ---
      kind: Service
      apiVersion: v1
      metadata:
        name: moto
      spec:
        selector:
          app: moto
        ports:
          - protocol: TCP
            port: 5000
            targetPort: 5000 

      This can either be accomplished by adding it as part of the clowdapp or a separate deployment and applied in pr_checks 

       

      In pr_checks scripts, after ephemeral deployment is done. We can add moto

      oc apply -f moto.yaml

      We also would need to update the relevant Env Variables in aws-producer clowdapp

      1. AWS_MARKETPLACE_ENDPOINT_URL - Point to moto internal service endpoint
      2. SWATCH_INTERNAL_SUBSCRIPTION_ENDPOINT - Point to rhsm-subscription service endpoint
      3. AWS_MANUAL_SUBMISSION_ENABLED - Setting True, We can send data directly to AWS Usage endpoint
      4. AWS_MARKETPLACE_ENDPOINT_OVERRIDE - Overrides the aws cloud to moto

      We also need to update the credentials used in aws-producer clowdapp

      • Adding Secrets for swatch-producer-aws
      • Update the aws-marketplace-credentials secret
      • Update key from credentials to config.ini
      • In value section add below
      [profile 1234567]
      aws_access_key_id = randomstuff
      aws_secret_access_key = randomstuff 

       
      Note: This is not a multi-account setup, so we can send usage to the moto only on one aws account that is mentioned in [profile \{*}sellerAccount/customerAccountId\{*}] section in config.ini

      Note: Keep the [profile 1234567] this will be used by QE automation as AwsSellerAccount to send usage from tests  

              lburnett0 Lindsey Burnett
              sjagtap@redhat.com Sanket Jagtap
              Sanket Jagtap Sanket Jagtap
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: