Skip to content

Commit

Permalink
Update install and upgrade code to use the new helm charts (#3229)
Browse files Browse the repository at this point in the history
* Delete symlink to old Helm chart
* Update 'install' code to use common Helm template structs
* Remove obsolete TLS assets functions.

These are now handle by Helm functions inside the templates

* Read defaults from values.yaml and values-ha.yaml
* Ensure that webhooks TLS assets are retained during upgrade
* Fix a few bugs in the Helm templates (see bullet points):
* Merge the way the 'install' ha and non-ha options are handled into one function
* Honor the 'NoInitContainer' option in the components templates
* Control plane mTLS will not be disabled if identity context in the
config map is empty. The data plane mTLS will still be automatically disabled
if the context is nil.
* Resolve test failures from rebase with master
* Fix linter issues
* Set service account mount path read-only field
* Add TLS variables of the webhooks and tap to values.yaml

During upgrade, these secrets are preserved to ensure they remain synced
wih the CA bundle in the webhook configurations. These Helm variables are used
to override the defaults in the templates.

* Remove obsolete 'chart' folder
* Fix bugs in templates
* Handle missing webhooks and tap TLS assets during upgrade

When upgrading from an older version that don't have these secrets, fallback to let Helm
create them by creating an empty charts.TLS struct.

* Revert the selector labels of webhooks to be compatible with that in 2.4

In 2.4, the proxy injector and profile validator webhooks already have their selector labels defined.
Since these attributes are immutable, the recent change to these selectors introduced by the Helm chart work will cause upgrade to fail.

* Alejandro's feedback
* Siggy's feedback
* Removed redundant unexported custom types

Signed-off-by: Ivan Sim <ivan@buoyant.io>
  • Loading branch information
ihcsim authored Aug 13, 2019
1 parent f0bd82f commit 4d01e37
Show file tree
Hide file tree
Showing 78 changed files with 2,429 additions and 3,238 deletions.
6 changes: 3 additions & 3 deletions bin/helm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ helm lint $rootdir/charts/partials

helm dep up $rootdir/charts/linkerd2
helm dep up $rootdir/charts/patch
helm lint --set Identity.TrustAnchorsPEM="fake-trust" --set Identity.Issuer.CrtPEM="fake-cert" --set Identity.Issuer.KeyPEM="fake-key" --set Identity.Issuer.CrtExpiry="fake-expiry-date" $rootdir/charts/linkerd2
helm lint --set Identity.TrustAnchorsPEM="fake-trust" --set Identity.Issuer.TLS.CrtPEM="fake-cert" --set Identity.Issuer.TLS.KeyPEM="fake-key" --set Identity.Issuer.CrtExpiry="fake-expiry-date" $rootdir/charts/linkerd2

# if tiller is deployed, perform a dry run installation to check for errors
if [ ! -z "$(kubectl get po -l app=helm,name=tiller --all-namespaces)" ]; then
echo "Performing dry run installation"
helm install --name=linkerd --dry-run --set Identity.TrustAnchorsPEM="fake-trust" --set Identity.Issuer.CrtPEM="fake-cert" --set Identity.Issuer.KeyPEM="fake-key" --set Identity.Issuer.CrtExpiry="fake-expiry-date" $rootdir/charts/linkerd2 2> /dev/null
helm install --name=linkerd --dry-run --set Identity.TrustAnchorsPEM="fake-trust" --set Identity.Issuer.TLS.CrtPEM="fake-cert" --set Identity.Issuer.TLS.KeyPEM="fake-key" --set Identity.Issuer.CrtExpiry="fake-expiry-date" $rootdir/charts/linkerd2 2> /dev/null

echo "Performing dry run installation (HA mode)"
helm install --name=linkerd --dry-run --set Identity.TrustAnchorsPEM="fake-trust" --set Identity.Issuer.CrtPEM="fake-cert" --set Identity.Issuer.KeyPEM="fake-key" --set Identity.Issuer.CrtExpiry="fake-expiry-date" -f $rootdir/charts/linkerd2/values.yaml -f $rootdir/charts/linkerd2/values-ha.yaml charts/linkerd2 2> /dev/null
helm install --name=linkerd --dry-run --set Identity.TrustAnchorsPEM="fake-trust" --set Identity.Issuer.TLS.CrtPEM="fake-cert" --set Identity.Issuer.TLS.KeyPEM="fake-key" --set Identity.Issuer.CrtExpiry="fake-expiry-date" -f $rootdir/charts/linkerd2/values.yaml -f $rootdir/charts/linkerd2/values-ha.yaml charts/linkerd2 2> /dev/null
fi
9 changes: 0 additions & 9 deletions chart/Chart.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions chart/templates/_affinity.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions chart/templates/_resources.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions chart/templates/config.yaml

This file was deleted.

55 changes: 0 additions & 55 deletions chart/templates/controller-rbac.yaml

This file was deleted.

134 changes: 0 additions & 134 deletions chart/templates/controller.yaml

This file was deleted.

15 changes: 0 additions & 15 deletions chart/templates/grafana-rbac.yaml

This file was deleted.

Loading

0 comments on commit 4d01e37

Please sign in to comment.