Hello , I am trying to connect my wiremock Deploym...
# help
a
Hello , I am trying to connect my wiremock Deployment to an Azure Files Storage so that I can persist all the mappings which I configure using "/__admin/mappings". Here's my Yaml File .
Copy code
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mec-cc-wiremock-cdt
  namespace: mec-carrier-connector-cdt
  labels:
    app: wiremock-custom
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mec-cc-wiremock-cdt
  template:
    metadata:
      labels:
        app: mec-cc-wiremock-cdt
    spec:
      volumes:
        - name: mec-cc-wiremock-cdt-storage
          persistentVolumeClaim:
            claimName: mec-cc-wiremock-storage
      containers:
        - name: mec-cc-wiremock-custom-cdt
          image: wiremock/wiremock:3.12.1-1
          args:
            - "--persist-mappings"
          volumeMounts:
          - name: mec-cc-wiremock-cdt-storage
            mountPath: /mnt/azure
          ports:
            - containerPort: 8080
          securityContext:
            allowPrivilegeEscalation: false
          resources:
            limits:
              cpu: 1500m
              memory: 2Gi
            requests:
              cpu: 750m
              memory: 1Gi
          livenessProbe:
            tcpSocket:
              port: 8080
            initialDelaySeconds: 10
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 5
          readinessProbe:
            tcpSocket:
              port: 8080
            initialDelaySeconds: 10
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 5
I am unable to persist the mappings this way. Am I doing something wrong ? I would really appreciate any help !!! 🙌
m
I'm not sure I know how to solve your specific problem, but I wonder if it would work to instead call the Wiremock REST API and get the mappings, and persist them from some other external script?
I bet calling
getAllStubMappings
and saving to a file would be a super quick script, perhaps you could run it in another container
a
Hay @Mitch Smith,thank you for your reply. That is a fair point but we are trying to setup the wiremock instance to perform load tests at random timing. this means , we will not know when the HPA will choose to scale up the pods (this would cause the new pods to not have the mappings predefined) . Please let me know if you have any other suggestions based on this 😁
👍🏻 1
m
do you have some kind of an error or something?
are you calling the endpoint to persist the mappings? (I am no expert btw but I imagine more context will help people engage with your issue)