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

add imagePullSecrets #1959

Merged

Conversation

ohauer
Copy link
Contributor

@ohauer ohauer commented Feb 7, 2023

What does this PR change?

add ability to use own image repo that requires imagePullSecrets

Does this PR rely on any other PRs?

  • no

How does this PR impact users? (This is the kind of thing that goes in release notes!)

  • no impact

Links to Issues or ZD tickets this PR addresses or fixes

How was this PR tested?

  • diff helm template output with and without patch
  • tested on own image repo which requires imagePullSecrets.

Have you made an update to documentation?

  • no

┆Issue is synchronized with this Jira Task by Unito

@teevans
Copy link
Contributor

teevans commented Feb 7, 2023

@ohauer - Can you post the results of a helm template here?

@ohauer
Copy link
Contributor Author

ohauer commented Feb 7, 2023

@teevans Sure, is it sufficent to add only the output from cost-analyzer/templates/cost-analyzer-deployment-template.yaml (~300 lines) or do you require the full chart output with the following value file (~22000 lines)

imagePullSecrets:
- name: test-pull-secret

kubecostMetrics:
  exporter:
    enabled: true

@ohauer
Copy link
Contributor Author

ohauer commented Feb 7, 2023

trimmed output that shows relevant change without / with the patch:

value.yaml

kubecostMetrics:
  exporter:
    enabled: true

helm template output

---
# Source: cost-analyzer/templates/cost-analyzer-deployment-template.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubecost-cost-analyzer
  namespace: kubecost
spec:
    # ...
    spec:
      # ...
      containers:
        - image: gcr.io/kubecost1/cost-model:prod-1.100.0
          # ...
        - image: gcr.io/kubecost1/frontend:prod-1.100.0
          # ...
---
# Source: cost-analyzer/templates/kubecost-metrics-deployment-template.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubecost-metrics
  namespace: kubecost
spec:
  # ...
    spec:
      # ...
      containers:
        - image: gcr.io/kubecost1/cost-model:prod-1.100.0
          # ...

value.yaml with imagePullSecret

imagePullSecrets:
- name: test-pull-secret

kubecostMetrics:
  exporter:
    enabled: true

helm template output
Note: cost-analyzer-deployment-template.yaml has already the possiblity to use the secret

---
# Source: cost-analyzer/templates/cost-analyzer-deployment-template.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubecost-cost-analyzer
  namespace: kubecost
spec:
    # ...
    spec:
      # ...
      containers:
        - image: gcr.io/kubecost1/cost-model:prod-1.100.0
          # ...
        - image: gcr.io/kubecost1/frontend:prod-1.100.0
          # ...
      imagePullSecrets:
        - name: test-pull-secret
---
# Source: cost-analyzer/templates/kubecost-metrics-deployment-template.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kubecost-metrics
  namespace: kubecost
spec:
  # ...
    spec:
      # ...
      containers:
        - image: gcr.io/kubecost1/cost-model:prod-1.100.0
          # ...
      imagePullSecrets:
        - name: test-pull-secret

@thomasvn
Copy link
Member

thomasvn commented Feb 8, 2023

@ohauer This looks good to me! This assumes the kubecost-metrics pod will be using the same imagePullSecret as the cost-analyzer pod? And therefore stored in the same registry?

Woops! Took a second look and realized that kubecost-metrics and kubecost-cost-analyzer deployments reference the same cost-model image. This looks good to me!

@AjayTripathy AjayTripathy merged commit 9f3d797 into kubecost:develop Feb 13, 2023
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.

4 participants