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

snowplow-iglu-server: toleration and topologySpreadConstraints (closes #194) #203

Merged

Conversation

ianarsenault
Copy link
Contributor

Add support for tolerations and topologySpreadConstraints

Below is output from helm template snowplow-iglu-server with and without tolerations and topology spread constraints being set

➜ helm template snowplow-iglu-server
<truncated>
---
# Source: snowplow-iglu-server/templates/iglu-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: release-name-app
  labels:
    helm.sh/chart: snowplow-iglu-server-0.9.0
    app.kubernetes.io/version: "0.9.0"
    app.kubernetes.io/managed-by: Helm
spec:
  selector:
    matchLabels:
      app: release-name-app
  template:
    metadata:
      labels:
        app: release-name-app
        helm.sh/chart: snowplow-iglu-server-0.9.0
        app.kubernetes.io/version: "0.9.0"
        app.kubernetes.io/managed-by: Helm
      annotations:
        checksum/config: "f786bb986a29772d4b6bd8d30637545bb4a96d1445322376cdf913913563bf8a"
    spec:
      automountServiceAccountToken: true
      terminationGracePeriodSeconds: 630

      volumes:

      containers:
      - name: release-name-app
        image: snowplow/iglu-server:0.12.0-distroless
        imagePullPolicy: IfNotPresent

        args:
        - "--config"
        -  "/dev/null" 

        ports:
        - containerPort: 8080
          protocol: TCP

        env:
        - name: "ACCEPT_LIMITED_USE_LICENSE"
          value: "no"
        - name : "CONFIG_FORCE_iglu_repoServer_port"
          value: "8080"
        - name : "CONFIG_FORCE_iglu_repoServer_maxConnections"
          value: "16384"
        - name : "CONFIG_FORCE_iglu_repoServer_idleTimeout"
          value: "65 seconds"
        - name : "CONFIG_FORCE_iglu_repoServer_hsts_enable"
          value: "true"
        - name : "CONFIG_FORCE_iglu_database_type"
          value: "dummy"
        - name : "CONFIG_FORCE_iglu_database_host"
          value: ""
        - name : "CONFIG_FORCE_iglu_database_port"
          value: "5432"
        - name : "CONFIG_FORCE_iglu_database_dbname"
          value: ""
        - name : "CONFIG_FORCE_iglu_patchesAllowed"
          value: "false"
        - name : "JDK_JAVA_OPTIONS"
          value: "-Dconfig.override_with_env_vars=true "

        envFrom:
        - secretRef:
            name: release-name-secret

        livenessProbe:
          httpGet:
            path: /api/meta/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 5
          timeoutSeconds: 5
          failureThreshold: 3

        readinessProbe:
          httpGet:
            path: /api/meta/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 5
          timeoutSeconds: 5
          failureThreshold: 3
          successThreshold: 2 

        resources:
          limits:
            cpu: 746m
            memory: 900Mi
          requests:
            cpu: 400m
            memory: 512Mi

        volumeMounts:
---

With tolerations and topologySpreadConstraint being set

➜ helm template snowplow-iglu-server \                                                        
  --set "service.tolerations[0].key=key1" \
  --set "service.tolerations[0].operator=Exists" \
  --set "service.tolerations[0].effect=NoSchedule" \
  --set "service.topologySpreadConstraints[0].maxSkew=1" \
  --set "service.topologySpreadConstraints[0].topologyKey=topology.kubernetes.io/zone" \
  --set "service.topologySpreadConstraints[0].whenUnsatisfiable=DoNotSchedule"
  
  
  
  # Source: snowplow-iglu-server/templates/iglu-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: release-name-app
  labels:
    helm.sh/chart: snowplow-iglu-server-0.9.0
    app.kubernetes.io/version: "0.9.0"
    app.kubernetes.io/managed-by: Helm
spec:
  selector:
    matchLabels:
      app: release-name-app
  template:
    metadata:
      labels:
        app: release-name-app
        helm.sh/chart: snowplow-iglu-server-0.9.0
        app.kubernetes.io/version: "0.9.0"
        app.kubernetes.io/managed-by: Helm
      annotations:
        checksum/config: "6d66497e23af0d7ae4cc674ffea3cf2bb9c5335d37f058ba60a8e3f9d53847d4"
    spec:
      automountServiceAccountToken: true
      terminationGracePeriodSeconds: 630
      tolerations:
        - effect: NoSchedule
          key: key1
          operator: Exists
      topologySpreadConstraints:
        - maxSkew: 1
          topologyKey: topology.kubernetes.io/zone
          whenUnsatisfiable: DoNotSchedule

      volumes:

      containers:
      - name: release-name-app
        image: snowplow/iglu-server:0.12.0-distroless
        imagePullPolicy: IfNotPresent

        args:
        - "--config"
        -  "/dev/null" 

        ports:
        - containerPort: 8080
          protocol: TCP

        env:
        - name: "ACCEPT_LIMITED_USE_LICENSE"
          value: "no"
        - name : "CONFIG_FORCE_iglu_repoServer_port"
          value: "8080"
        - name : "CONFIG_FORCE_iglu_repoServer_maxConnections"
          value: "16384"
        - name : "CONFIG_FORCE_iglu_repoServer_idleTimeout"
          value: "65 seconds"
        - name : "CONFIG_FORCE_iglu_repoServer_hsts_enable"
          value: "true"
        - name : "CONFIG_FORCE_iglu_database_type"
          value: "dummy"
        - name : "CONFIG_FORCE_iglu_database_host"
          value: ""
        - name : "CONFIG_FORCE_iglu_database_port"
          value: "5432"
        - name : "CONFIG_FORCE_iglu_database_dbname"
          value: ""
        - name : "CONFIG_FORCE_iglu_patchesAllowed"
          value: "false"
        - name : "JDK_JAVA_OPTIONS"
          value: "-Dconfig.override_with_env_vars=true "

        envFrom:
        - secretRef:
            name: release-name-secret

        livenessProbe:
          httpGet:
            path: /api/meta/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 5
          timeoutSeconds: 5
          failureThreshold: 3

        readinessProbe:
          httpGet:
            path: /api/meta/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 5
          timeoutSeconds: 5
          failureThreshold: 3
          successThreshold: 2 

        resources:
          limits:
            cpu: 746m
            memory: 900Mi
          requests:
            cpu: 400m
            memory: 512Mi

        volumeMounts:
  <truncated>

@ianarsenault ianarsenault self-assigned this Oct 23, 2024
Copy link
Contributor

@Andy-Hay Andy-Hay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ianarsenault ianarsenault merged commit eaa457d into main Oct 24, 2024
1 check passed
@ianarsenault ianarsenault deleted the snowplow-iglu-server/topologyspreadconstraints-additions branch October 24, 2024 15:19
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.

2 participants