Commit Graph

46 Commits

Author SHA1 Message Date
Justin SB 6184f12861 Introduce applylib
A number of projects need a library for applying objects.  While we
are figuring out exactly what functionality is needed, we are using a
copy-and-paste approach.

Introduce applylib here also, and add the create-or-update
functionality that we want here.
2022-08-17 08:10:20 -04:00
Ciprian Hacman cb99db0757 Run make goimports 2022-08-17 07:03:33 +03:00
justinsb 9bb1d3e114 Configuration file for kube-scheduler
We generate a kube-scheduler configuration file in the kops CLI, and
nodeup will use it if provided (instead of generating one).

We put the configuration file into the fileAssets.

Users can provide a kube-scheduler configuration in additional
objects, and this will be used as the base configuration (we add the
kubeconfig path).

Issue #13352

Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>
2022-08-03 09:51:05 -04:00
Ciprian Hacman dfe9c8b937 Fix unexpected type for object metadata when using gossip DNS 2022-05-03 09:40:00 +03:00
Ole Markus With ce2e877aeb Remove bazel files from vendor 2022-04-12 13:29:03 +02:00
Ole Markus With bcbeb30d85 Remove explicit dependency on yamlv2
Update tests/e2e/kubetest2-kops/deployer/template.go

Co-authored-by: Ciprian Hacman <ciprian@hakman.dev>
2022-04-10 13:29:21 +02:00
Kubernetes Prow Robot 3e5e929423
Merge pull request #12727 from justinsb/kopeio_networking_operator
addons: support for kopeio-networking addon
2021-12-31 13:12:53 -08:00
justinsb 45ad8b50ae Enhance AddHostPathMapping to support a fluent style
This allows for the helper to be used in more places.
2021-12-31 13:26:12 -05:00
justinsb 8e34e4d101 addons: support for kopeio-networking addon
Adding support for the kopeio-networking addon.

We load the operator manifest (which changes rarely) from the channels
directory for now.  We follow the same structure as operators
themselves use so that we can support other backends in future.

The channels file includes the current versions of the operators.

During cluster creation, we create these additional objects.
2021-12-29 09:16:15 -05:00
Ole Markus With 00f8808ab1 Log the specific yaml segment that fails. Also remove redundant full manifest logging 2021-12-20 15:04:52 +01:00
Ciprian Hacman ea7df00719 Run hack/update-gofmt.sh 2021-12-01 22:39:50 +02:00
justinsb 0c696d41d3 Create supporting services in kops-controller for gossip-mode
The intent is that we can then expose these via CoreDNS, so that
internal name resolution will work.
2021-11-19 11:02:10 -05:00
justinsb 454c47f92b Support pruning in channels command
We let the addon specify exactly what should be pruned; this approach
is a little more verbose but we're likely generating this
automatically in the common case anyway.

In return for the verbosity, we can likely handle more future cases
and edge cases (for example removing objects that aren't labelled or
are in the wrong namespace).
2021-10-15 17:47:13 -04:00
Peter Rifel ca044455a3
Remove critical-pod scheduler annotation.
This is no longer recognized in all supported k8s versions (1.16+)

ea07644522/CHANGELOG/CHANGELOG-1.16.md (deprecations-and-removals)
2021-09-22 21:14:50 -05:00
justinsb e1685925ce Add helper to convert kubemanifest.Object to unstructured
This allows the object to be treated as a runtime.Object
2021-09-06 14:45:26 -04:00
Justin Santa Barbara 1588a506a6 First operator integration: CoreDNS
Hidden behind a feature-flag, but when the UseAddonOperators feature
flag is set, we now use the cluster-addons CoreDNS operator instead of
our built-in manifests.
2021-05-25 06:29:07 -04:00
Ole Markus With 51adb833da Remarshal new values so we can use the remapper later on
If not, reparse will fail because a path may be e.g a *corev1.Pod
2021-04-04 20:44:27 +02:00
Ole Markus With d4f28f2986 Allow nil values in manifests 2021-02-28 07:26:48 +01:00
Ole Markus With 4fa6f56ecd Use the kubernetes-sigs version of yaml 2020-12-15 10:38:01 +01:00
Justin SB 8498ac9dbb Create PublicJWKS feature flag
This should be much easier to start and to get under testing; it only
works with a load balancer, it sets the apiserver into anonymous-auth
allowed, it grants the anonymous auth user permission to read our jwks
tokens.  But it shouldn't need a second bucket or anything of that
nature.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-09-09 09:57:06 -04:00
Justin Santa Barbara f32fcc35fa Addons: Support arbitrary additional objects
We will be managing cluster addons using CRDs, and so we want to be
able to apply arbitrary objects as part of cluster bringup.

Start by allowing (behind a feature-flag) for arbitrary objects to be
specified.

Co-authored-by: John Gardiner Myers <jgmyers@proofpoint.com>
2020-08-28 09:03:41 -04:00
Peter Rifel 4d9f0128a3
Upgrade to klog2
This splits up the kubernetes 1.19 PR to make it easier to keep up to date until we get it sorted out.
2020-08-16 20:56:48 -05:00
Justin SB 854a4548e3 Refactor kubemanifest to be clearer
Primarily renaming manifests to objects, which is a more accurate
term.
2020-06-11 21:40:51 -04:00
Justin SB f348b47332
Don't output empty sections in the manifests
In our kube-dns manifest for 1.6 we often had an empty section,
normalization converted this to `{}` which causes `kubectl apply` to
fail.

We can simply skip empty objects when outputing.
2020-01-11 20:58:24 -05:00
tanjunchen 28fdb358f8 fix-up staticcheck error 2019-10-08 13:53:04 +08:00
chentanjun 3d1966df84 fix-up some spelling mistakes in /pkg 2019-09-26 10:15:44 +08:00
mikesplain 9e55b8230a Update copyright notices
Also cleans some white spaces
2019-09-09 14:47:51 -04:00
Arto Jantunen 555d879cb2 Add helpers to set the built-in pod priorities 2019-05-09 16:03:08 +03:00
Justin SB 76d03b3f71
Generated files: glog -> klog 2019-05-06 12:56:03 -04:00
Justin SB 3e33ac7682
Change code from glog to klog
We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog.  That
will happen when we update to k8s 1.13.
2019-05-06 12:54:51 -04:00
Gennady Trafimenkov acf9c9f016 Update bazel configuration 2019-03-03 16:11:33 +03:00
Gennady Trafimenkov 15bd566746 Correcly handle CRLF in the manifest
kops replace/create/delete now correctly handle crlf in the manifest.

This fixes issue #6532
2019-03-03 14:33:49 +03:00
Derek Lemon -T (delemon - AEROTEK INC at Cisco) 4f0169bb79 codegen 2019-01-16 09:30:40 -07:00
Justin SB 26bd75aecb
Bulk spelling fixes
Experimenting with my own spelling checker, these are the typos it caught.
2018-12-20 17:43:56 -05:00
mikeweiwei 027d324aaf If don't use formatted output,fix logging calls 2018-10-10 19:19:09 +08:00
Thanabodee Charoenpiriyakij 49b203e126 Fixes go vet complains
When try `make govet` on `go1.11beta1`. It complains many things
related to invalid string formatting:

```
pkg/kubemanifest/visitor.go:35: Verbose.Infof format %s has arg v of wrong type bool
pkg/kubemanifest/visitor.go:40: Verbose.Infof format %s has arg v of wrong type float64
upup/pkg/fi/cloudup/alitasks/disk.go:76: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/cloudup/alitasks/disk.go:91: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/cloudup/alitasks/launchconfiguration.go:89: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/cloudup/alitasks/loadbalancer.go:71: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/cloudup/alitasks/loadbalancer.go:125: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/cloudup/alitasks/scalinggroup.go:71: Verbose.Info call has possible formatting directive %q
dns-controller/pkg/dns/dnscontroller.go:603: Verbose.Infof format %s has arg records of wrong type []dns.Record
dns-controller/cmd/dns-controller/main.go:184: Verbose.Info call has possible formatting directive %q
pkg/acls/s3/storage.go:62: Verbose.Infof format %q arg u.String is a func value, not called
pkg/apis/kops/validation/validation_test.go:199: T.Fatalf format %q has arg config of wrong type *k8s.io/kops/pkg/apis/kops.DockerConfig
pkg/resources/aws/aws.go:1306: Warning call has possible formatting directive %q
pkg/resources/aws/aws.go:1313: Warning call has possible formatting directive %v
upup/pkg/fi/cloudup/aliup/ali_cloud.go:218: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/cloudup/aliup/ali_cloud.go:290: Verbose.Info call has possible formatting directive %q
upup/pkg/fi/fitasks/keypair.go:266: Errorf format %q has arg e.Name of wrong type *string
upup/pkg/fi/files_owner.go:56: Infof format %s has arg group of wrong type *fi.Group
upup/pkg/fi/users.go:57: Warning call has possible formatting directive %q
upup/pkg/fi/users.go:63: Warning call has possible formatting directive %q
upup/pkg/fi/users.go:68: Warning call has possible formatting directive %q
upup/pkg/fi/users.go:129: Warning call has possible formatting directive %q
upup/pkg/fi/users.go:135: Warning call has possible formatting directive %q
upup/pkg/fi/nodeup/nodetasks/file.go:313: Errorf format %q has arg e.Mode of wrong type *string
upup/pkg/fi/cloudup/awsup/aws_cloud.go:1021: Warningf format %q reads arg #2, but call has 1 arg
upup/pkg/fi/cloudup/awsup/aws_cloud.go:1025: Warningf format %q reads arg #2, but call has 1 arg
```
2018-08-22 22:48:22 +07:00
Corey O'Brien 12fccd29f9 Remap initContainers as well as containers in PodSpec 2018-07-10 22:03:49 -04:00
Justin Santa Barbara ba87c36f73 Support (optional) etcd-manager 2018-05-25 16:01:22 -04:00
chrislovecnm 609e268a1d gazelle updates with new bazel version 2017-11-05 17:41:53 -07:00
chrislovecnm 1e418c3e13 more goimport updates 2017-11-04 10:03:02 -06:00
Justin Santa Barbara 0143be7c4f autogen: BUILD and BUILD.bazel 2017-10-02 14:27:21 -04:00
Justin Santa Barbara 3478031533 API types changed package 2017-10-01 14:03:56 -04:00
Justin Santa Barbara 383194780a Create helper function for critical pod annotations
In particularly I think we want a toleration also; easiest to put the
code in one function.
2017-09-30 17:38:20 -04:00
chrislovecnm bfc78e18b7 fixing remapping, as it was not returning the remapped data. Code and logging cleanup 2017-07-12 11:36:06 -06:00
Justin Santa Barbara 1965a4be49 Updates to fix unit tests 2017-07-08 18:46:01 -04:00
Justin Santa Barbara 9a8fcd64e4 Simplify how we build addon manifests, support image redirection 2017-07-08 18:33:00 -04:00