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

source latest coredns add-on manifest #692

Closed
errordeveloper opened this issue Apr 2, 2019 · 1 comment · Fixed by #878

Comments

@errordeveloper
Copy link
Member

commented Apr 2, 2019

We currently have this:

//go:generate curl --silent --location https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-02-11/dns.yaml --output assets/coredns.yaml

But it's not the latest version, version update is implemented by patching image tag:

func UpdateCoreDNSImageTag(clientSet k8s.Interface, dryRun bool) error {
printer := printers.NewJSONPrinter()
d, err := clientSet.AppsV1().Deployments(metav1.NamespaceSystem).Get(CoreDNS, metav1.GetOptions{})
if err != nil {
if apierrs.IsNotFound(err) {
logger.Warning("%q was not found", CoreDNS)
return nil
}
return errors.Wrapf(err, "getting %q", CoreDNS)
}
if numContainers := len(d.Spec.Template.Spec.Containers); !(numContainers >= 1) {
return fmt.Errorf("%s has %d containers, expected at least 1", CoreDNS, numContainers)
}
if err := printer.LogObj(logger.Debug, CoreDNS+" [current] = \\\n%s\n", d); err != nil {
return err
}
image := &d.Spec.Template.Spec.Containers[0].Image
imageParts := strings.Split(*image, ":")
if len(imageParts) != 2 {
return fmt.Errorf("unexpected image format %q for %q", *image, CoreDNS)
}
if imageParts[1] == CoreDNSVersion {
logger.Debug("imageParts = %v, desiredTag = %s", imageParts, CoreDNSVersion)
logger.Info("%q is already up-to-date", CoreDNS)
return nil
}
if dryRun {
logger.Critical("%q is not up-to-date", CoreDNS)
return nil
}
imageParts[1] = CoreDNSVersion
*image = strings.Join(imageParts, ":")
if err := printer.LogObj(logger.Debug, CoreDNS+" [updated] = \\\n%s\n", d); err != nil {
return err
}
if _, err := clientSet.AppsV1().Deployments(metav1.NamespaceSystem).Update(d); err != nil {
return err
}
logger.Info("%q is now up-to-date", CoreDNS)
return nil
}

We should update the URL in pkg/addons/default/generate.go and re-generate bindata assets, then replace UpdateCoreDNSImageTag with a simpler version that applies the manifest directly.

@errordeveloper

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

There isn't an official EKS-blessed manifest at present. The S3 bucket still only contains the original 1.11 version, perhaps one could extract it from a freshly-made 1.12 cluster?

@errordeveloper errordeveloper referenced this issue Jun 12, 2019
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.