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

Cleanup Helm Templates #215

Merged
merged 5 commits into from
Sep 2, 2024
Merged

Cleanup Helm Templates #215

merged 5 commits into from
Sep 2, 2024

Conversation

davidcollom
Copy link
Collaborator

This cleans up some of the output from helm template and also duirng installation to be cleaner and reduce whitespace as raised in #187.

On its own:

---
# Source: version-checker/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: version-checker
  labels:
    
    app.kubernetes.io/name: version-checker
    helm.sh/chart: version-checker-v0.6.0
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "v0.6.0"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: version-checker
      app.kubernetes.io/instance: release-name
  template:
    metadata:
      labels:
        app.kubernetes.io/name: version-checker
        helm.sh/chart: version-checker-v0.6.0
        app.kubernetes.io/instance: release-name
        app.kubernetes.io/version: "v0.6.0"
        app.kubernetes.io/managed-by: Helm
      annotations:
        prometheus.io/path: "/metrics"
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
        enable.version-checker.io/version-checker: "true"
    spec:
      serviceAccountName: version-checker
      containers:
      - name: version-checker
        image: "quay.io/jetstack/version-checker:v0.6.0"
        imagePullPolicy: IfNotPresent
        ports:
        - name: metrics
          containerPort: 8080
        command: ["version-checker"]
        args:
          - "--image-cache-timeout=30m"
          - "--log-level=info"
          - "--metrics-serving-address=0.0.0.0:8080"
          - "--test-all-containers=true"
        resources:
            {}
        livenessProbe:
          httpGet:
            path: /readyz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 3
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 3
        env:
      volumes:

With Values:

---
# Source: version-checker/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: version-checker
  labels:
    app.kubernetes.io/name: version-checker
    helm.sh/chart: version-checker-v0.6.0
    app.kubernetes.io/instance: release-name
    app.kubernetes.io/version: "v0.6.0"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: version-checker
      app.kubernetes.io/instance: release-name
  template:
    metadata:
      labels:
        app.kubernetes.io/name: version-checker
        helm.sh/chart: version-checker-v0.6.0
        app.kubernetes.io/instance: release-name
        app.kubernetes.io/version: "v0.6.0"
        app.kubernetes.io/managed-by: Helm
      annotations:
        prometheus.io/path: "/metrics"
        prometheus.io/scrape: "true"
        prometheus.io/port: "8080"
        enable.version-checker.io/version-checker: "true"
    spec:
      serviceAccountName: version-checker
      containers:
      - name: version-checker
        image: "quay.io/jetstack/version-checker:v0.6.0"
        imagePullPolicy: IfNotPresent
        ports:
        - name: metrics
          containerPort: 8080
        command: ["version-checker"]
        args:
          - "--image-cache-timeout=30m"
          - "--log-level=info"
          - "--metrics-serving-address=0.0.0.0:8080"
          - "--test-all-containers=true"
        resources:
            {}
        livenessProbe:
          httpGet:
            path: /readyz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 3
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 3
        env:
        # ACR
        - name: VERSION_CHECKER_ACR_REFRESH_TOKEN
          valueFrom:
            secretKeyRef:
              name: version-checker
              key: acr.refreshToken
        # GHCR
        - name: VERSION_CHECKER_GHCR_TOKEN
          valueFrom:
            secretKeyRef:
              name: version-checker
              key: ghcr.token
      volumes:
        - name: version-checker
          secret:
            secretName: version-checker

Comments are still there, but truncated and only show, IF the respective repository configuration has been sent.

@@ -106,7 +106,8 @@ spec:
secretKeyRef:
name: {{ $chartname }}
key: ecr.accessKeyID
{{- end }}
{{- end -}}

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove blank line?

@davidcollom
Copy link
Collaborator Author

metadata:
  name: version-checker
  labels:
    
    app.kubernetes.io/name: version-checker
    helm.sh/chart: version-checker-v0.6.0

@davidcollom davidcollom marked this pull request as draft July 9, 2024 10:15
@davidcollom davidcollom added the enhancement New feature or request label Aug 15, 2024
@davidcollom davidcollom marked this pull request as ready for review August 28, 2024 10:28
@davidcollom davidcollom enabled auto-merge (squash) August 28, 2024 10:28
Copy link
Contributor

@hawksight hawksight left a comment

Choose a reason for hiding this comment

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

Results look better 👍

@davidcollom davidcollom merged commit dece3df into main Sep 2, 2024
3 checks passed
@davidcollom davidcollom deleted the issue-187 branch September 2, 2024 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants