Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FDN-2872 registry service migration to Karpenter #585

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

kyrylyuk-andriy
Copy link
Contributor

two changes :

  • adding node selector and tolerations to migrate service to Karpenter
  • bump memory request because we are running on a edge

Screenshot 2024-10-04 at 10 20 20 AM

@flow-tech
Copy link
Contributor

helm diff output for registry:
production, registry-live, Deployment (apps) has changed:
  # Source: flow-generic/templates/deployment.yaml
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: registry-live
    labels:
      helm.sh/chart: flow-generic-1.5.52
      app.kubernetes.io/instance: registry
      app.kubernetes.io/managed-by: Tiller
      app.kubernetes.io/name: registry
      app.kubernetes.io/stage: live
      app: registry
      tags.datadoghq.com/service: registry
      tags.datadoghq.com/env: live
      tags.datadoghq.com/version: 0.7.33
      flow.io/version: 0.7.33
      flow.io/team: foundation
  spec:
    replicas: 0
    selector:
      matchLabels:
        app.kubernetes.io/name: registry
        app.kubernetes.io/instance: registry
        app.kubernetes.io/stage: live
    template:
      metadata:
        labels:
          app.kubernetes.io/name: registry
          app.kubernetes.io/instance: registry
          app.kubernetes.io/stage: live
          app: registry
          tags.datadoghq.com/service: registry
          tags.datadoghq.com/env: live
          tags.datadoghq.com/version: 0.7.33
          flow.io/version: 0.7.33
          flow.io/team: foundation
        annotations:
          iam.amazonaws.com/role: arn:aws:iam::479720515435:role/ecsInstanceRole
          sumologic.com/sourceCategory: registry
          sidecar.istio.io/logLevel: info
          proxy.istio.io/config: '{"terminationDrainDuration": 60s}'
      spec:
        terminationGracePeriodSeconds: 60
        containers:
          - name: registry
            image: "flowcommerce/registry:0.7.33"
            imagePullPolicy: IfNotPresent
            env:
              - name: JAVA_OPTS
                value: "-Xms500m -Xmx500m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/dumps/oom.bin -XX:+UseG1GC -XX:+UseStringDeduplication -XX:FlightRecorderOptions=stackdepth=256"
              - name: FLOW_KUBERNETES_NODE_NAME
                valueFrom:
                  fieldRef:
                    fieldPath: spec.nodeName
              - name: FLOW_KUBERNETES_NODE_IP
                valueFrom:
                  fieldRef:
                    fieldPath: status.hostIP
              - name: FLOW_KUBERNETES_POD_NAME
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.name
              - name: FLOW_KUBERNETES_POD_NAMESPACE
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.namespace
              - name: FLOW_KUBERNETES_POD_IP
                valueFrom:
                  fieldRef:
                    fieldPath: status.podIP
              - name: FLOW_KUBERNETES_POD_UID
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.uid
              - name: DD_SERVICE
                value: registry
              - name: DD_ENV
                value: live
              - name: DD_VERSION
                value: 0.7.33
              - name: DD_JMXFETCH_STATSD_HOST
                value: 'unix:///var/run/datadog/dsd.socket'
              - name: DD_DOGSTATSD_URL
                value: 'unix:///var/run/datadog/dsd.socket'
              - name: DD_TRACE_AGENT_URL
                value: 'unix:///var/run/datadog/apm.socket'
              - name: DD_SERVICE_MAPPING
                value: "postgresql:registry-postgresql,java-aws-sdk:registry-aws-sdk"
              - name: DD_TAGS
                value: "team:foundation"
              - name: DD_KUBERNETES_POD_LABELS_AS_TAGS
                value: '{"*": "label_%%label%%"}'
              - name: DD_CONTAINER_ENV_AS_TAGS
                value: '{"FLOW_KUBERNETES_POD_NAME":"env_flow_kubernetes_pod_name","FLOW_KUBERNETES_POD_NAMESPACE":"env_flow_kubernetes_pod_namespace"}'
            args: ["production"]
            ports:
              - name: http
                containerPort: 9000
                protocol: TCP
            volumeMounts:
              - name: dsdsocket
                mountPath: /var/run/datadog
              - name: heap-dumps
                mountPath: /dumps
            startupProbe:
              httpGet:
                path: /_internal_/startup
                port: http
              failureThreshold: 30
              periodSeconds: 10
            livenessProbe:
              httpGet:
                path: /_internal_/live
                port: http
              failureThreshold: 6
              periodSeconds: 10
              timeoutSeconds: 5
            readinessProbe:
              httpGet:
                path: /_internal_/ready
                port: http
              failureThreshold: 1
              periodSeconds: 10
              timeoutSeconds: 1
            resources:
              limits:
-               memory: 900Mi
+               memory: 1000Mi
              requests:
                cpu: 0.05
-               memory: 900Mi
+               memory: 1000Mi
              
        nodeSelector:
-         role: workers-arm64
+         karpenter/role: workers
          
        imagePullSecrets:
          - name: flow-docker-hub
          
        topologySpreadConstraints:
          - maxSkew: 1
            topologyKey: topology.kubernetes.io/zone
            whenUnsatisfiable: ScheduleAnyway
            labelSelector:
              matchLabels:
                app: registry
        tolerations:
          - effect: NoSchedule
            key: role
            operator: Equal
-           value: workers-arm64
+           value: workers
          
        dnsConfig:
          options:
            - name: ndots
              value: "1"
        volumes:
          - name: dsdsocket
            hostPath:
              path: /var/run/datadog/
              type: DirectoryOrCreate
          - name: heap-dumps
            emptyDir: {}
    strategy:
      type: RollingUpdate

@flow-tech
Copy link
Contributor

@kyrylyuk-andriy kyrylyuk-andriy merged commit 5da5bd5 into main Oct 4, 2024
5 checks passed
@kyrylyuk-andriy kyrylyuk-andriy deleted the migrate-service-to-Karpenter branch October 4, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants