Skip to content

Commit

Permalink
tweak pkg repo app deploy configuration to speed things up (#382)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitriy Kalinin <[email protected]>
  • Loading branch information
cppforlife and Dmitriy Kalinin authored Oct 4, 2021
1 parent 8564fa8 commit 1c27dd5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
6 changes: 3 additions & 3 deletions hack/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@ install() {

ytt_version=v0.35.1
kbld_version=v0.31.0
kapp_version=v0.39.0
kapp_version=v0.41.0
imgpkg_version=v0.18.0
vendir_version=v0.23.0

if [[ `uname` == Darwin ]]; then
binary_type=darwin-amd64
ytt_checksum=1f2b61d02f6d8184889719d5e0277a1ea82219f96873345157e81075ca59808e
kbld_checksum=d3b0a30bf3a79bedeb25d8548a91254954b99cd4a0c03f3a810b331fc4d1f071
kapp_checksum=43d79433d3d4dad4ffde7c775ea99f5c6b10c8949d54fd2a048ba66aaea89a6b
kapp_checksum=928f1269b52bbb2c725a3ccccc0a63925a03d169d8d3341183e23d429530ef2c
imgpkg_checksum=6ef71c549deefb1b9b798f31525610c4a7a562401f22b3bdf18e0cb769921d32
vendir_checksum=aef3233128727c01ffac6561533c9f60a49307f41decc1baa18688a4a250b15f
else
binary_type=linux-amd64
ytt_checksum=0aa78f7b5f5a0a4c39bddfed915172880344270809c26b9844e9d0cbf6437030
kbld_checksum=ba0be56d9e74b067f3e659de0b79100b0b9df86a2e3e0e6ff533b1e019c22c23
kapp_checksum=2120a627a867e04840d6e0e473097894a3b74b54b62f231b8df3f8670c4e80a3
kapp_checksum=ce4c38a6c6c7785d32afbc31ba316a6b89c068903d356a2ef8f54101b4073953
imgpkg_checksum=7e401eab1fbbaad8044cf3d82ff09cb8ec7666444ef91da9591f202e8b2a8a67
vendir_checksum=c6a65e7e8e589e25bf5554e9575ab247e55ae71920d3d366ffd84b1571fe34ac
fi
Expand Down
1 change: 1 addition & 0 deletions pkg/deploy/kapp_restrict.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ var (
"--tty",

"--dangerous-ignore-failing-api-services",
"--dangerous-scope-to-fallback-allowed-namespaces",

// Filtering
"--filter",
Expand Down
19 changes: 17 additions & 2 deletions pkg/pkgrepository/package_repo_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ func NewPackageRepoApp(pkgRepository *pkgingv1alpha1.PackageRepository) (*kcv1al
desiredApp.DeletionTimestamp = pkgRepository.DeletionTimestamp
desiredApp.Generation = pkgRepository.Generation

kappRawOpts := []string{
"--wait-timeout=30s",
"--kube-api-qps=30",
"--kube-api-burst=40",
// Default kapp-controller service account allows listing all namespaces
// but does not allow listing of most resources in such namespaces --
// instead of spinning wheels trying to list, scope to "current" namespace
"--dangerous-scope-to-fallback-allowed-namespaces=true",
}
kappDeployRawOpts := append([]string{
"--logs=false",
"--app-changes-max-to-keep=5",
}, kappRawOpts...)
kappDeleteRawOpts := append([]string{}, kappRawOpts...)

desiredApp.Spec = kcv1alpha1.AppSpec{
Fetch: []kcv1alpha1.AppFetch{{
Image: pkgRepository.Spec.Fetch.Image,
Expand Down Expand Up @@ -71,9 +86,9 @@ metadata:
}},
Deploy: []kcv1alpha1.AppDeploy{{
Kapp: &kcv1alpha1.AppDeployKapp{
RawOptions: []string{"--wait-timeout=30s", "--kube-api-qps=20", "--kube-api-burst=30"},
RawOptions: kappDeployRawOpts,
Delete: &kcv1alpha1.AppDeployKappDelete{
RawOptions: []string{"--wait-timeout=30s", "--kube-api-qps=20", "--kube-api-burst=30"},
RawOptions: kappDeleteRawOpts,
},
},
}},
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/kappcontroller/app_status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
}},
ObservedGeneration: 1,
FriendlyDescription: "Reconcile failed: Deploying: Error (see .status.usefulErrorMessage for details)",
UsefulErrorMessage: "kapp: Error: Checking existance of resource configmap/configmap (v1) namespace: does-not-exist: configmaps \"configmap\" is forbidden:\n User \"system:serviceaccount:" + env.Namespace + ":kappctrl-e2e-ns-sa\" cannot get resource \"configmaps\" in API group \"\" in the namespace \"does-not-exist\" (reason: Forbidden)",
UsefulErrorMessage: "kapp: Error: Checking existence of resource configmap/configmap (v1) namespace: does-not-exist: configmaps \"configmap\" is forbidden:\n User \"system:serviceaccount:" + env.Namespace + ":kappctrl-e2e-ns-sa\" cannot get resource \"configmaps\" in API group \"\" in the namespace \"does-not-exist\" (reason: Forbidden)",
},
Deploy: &v1alpha1.AppStatusDeploy{
ExitCode: 1,
Expand Down

0 comments on commit 1c27dd5

Please sign in to comment.