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

feat: Do not use default values in the Kubernetes yamls #941

Merged
merged 4 commits into from
Dec 15, 2022

Conversation

Akash-Nayak
Copy link
Contributor

@Akash-Nayak Akash-Nayak commented Dec 15, 2022

Addresses #940

Old deployment yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/default-myproject/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
              protocol: TCP
          resources: {}
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: quay-io-imagepullsecret
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
status: {}

New deployment yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    move2kube.konveyor.io/service: nodejs
  name: nodejs
spec:
  replicas: 2
  selector:
    matchLabels:
      move2kube.konveyor.io/service: nodejs
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        move2kube.konveyor.io/service: nodejs
      name: nodejs
    spec:
      containers:
        - image: quay.io/no-def-new/nodejs:latest
          imagePullPolicy: Always
          name: nodejs
          ports:
            - containerPort: 8080
          resources: {}
      imagePullSecrets:
        - name: quay-io-imagepullsecret
      restartPolicy: Always
      securityContext: {}
status: {}

I have tested enterprise-app deployment on the OCP cluster with the new deploy/yamls files and it's working fine.

Signed-off-by: Akash Nayak akash19nayak@gmail.com

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
@github-actions
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the feat label Dec 15, 2022
Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
Copy link
Member

@ashokponkumar ashokponkumar left a comment

Choose a reason for hiding this comment

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

Really nice work Akash! I like it! A few suggestions..

@@ -17,3 +17,6 @@ spec:
produces:
KubernetesYamls:
disabled: false
config:
outputPath: "deploy/cicd/argocd"
useDefaultValuesInYamls: false
Copy link
Member

Choose a reason for hiding this comment

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

would setDefaultValuesInYamls be a better name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

OutputPath string `yaml:"outputPath"`
IngressName string `yaml:"ingressName"`
OutputPath string `yaml:"outputPath"`
UseDefaultValuesInK8sYamls bool `yaml:"useDefaultValuesInK8sYamls"`
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to use the same name in all configs? like say setDefaultValuesInYamls?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@codecov
Copy link

codecov bot commented Dec 15, 2022

Codecov Report

Base: 15.28% // Head: 15.28% // No change to project coverage 👍

Coverage data is based on head (cb60c01) compared to base (5c02947).
Patch coverage: 0.00% of modified lines in pull request are covered.

❗ Current head cb60c01 differs from pull request most recent head 238daa7. Consider uploading reports for the commit 238daa7 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #941   +/-   ##
=======================================
  Coverage   15.28%   15.28%           
=======================================
  Files          50       50           
  Lines        4600     4600           
=======================================
  Hits          703      703           
  Misses       3721     3721           
  Partials      176      176           
Impacted Files Coverage Δ
transformer/kubernetes/apiresource/utils.go 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
@Akash-Nayak
Copy link
Contributor Author

Really nice work Akash! I like it! A few suggestions..

Thank you very much, Ashok ji! :-)

Copy link
Member

@ashokponkumar ashokponkumar left a comment

Choose a reason for hiding this comment

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

Might be good to rename the internal variables to be set too.

Signed-off-by: Akash Nayak <akash19nayak@gmail.com>
@Akash-Nayak
Copy link
Contributor Author

Might be good to rename the internal variables to be set too.

Yes sure, done. I missed renaming the internal variables while I was doing case-sensitive find and replace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants