Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Helmv3 migration of the chart #1260

Merged
merged 67 commits into from
Aug 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
f936e4c
Helmv3 migration of the chart
eumel8 Jul 29, 2020
4c5dabb
Helm3 adjustments for Travis
eumel8 Jul 29, 2020
795da6d
Fix download url Helmv3
eumel8 Jul 29, 2020
d27dae7
Remove empty annotations
eumel8 Jul 30, 2020
9229f45
Still fix Travis
eumel8 Jul 30, 2020
7706913
Create namespace before helm deploy
eumel8 Jul 30, 2020
bc092a5
Remove helm purge
eumel8 Jul 30, 2020
dcc72a6
No extra resource handling is required in Helmv3
eumel8 Jul 30, 2020
65100cc
Set explicit exit code for Travis
eumel8 Jul 30, 2020
42c3e5b
Add a comment for finishing helm uninstalling
eumel8 Jul 31, 2020
bfa683f
Debug namespace delete
eumel8 Jul 31, 2020
15f16c9
Nowait for namespace deletion
eumel8 Jul 31, 2020
32a4380
No wait
eumel8 Jul 31, 2020
85ac2b6
Create namespace in Helm/review docs
eumel8 Aug 5, 2020
6625ae5
rebase
eumel8 Aug 5, 2020
35d4cac
rebase
eumel8 Aug 5, 2020
80cd321
Fix name tag
eumel8 Aug 5, 2020
9e22725
Helmv3 migration of the chart
eumel8 Jul 29, 2020
ca09c79
Helm3 adjustments for Travis
eumel8 Jul 29, 2020
28f74ad
Fix download url Helmv3
eumel8 Jul 29, 2020
22bfa96
Remove empty annotations
eumel8 Jul 30, 2020
f3e8d6e
Still fix Travis
eumel8 Jul 30, 2020
4707f02
Create namespace before helm deploy
eumel8 Jul 30, 2020
40318e9
Remove helm purge
eumel8 Jul 30, 2020
c2758bc
No extra resource handling is required in Helmv3
eumel8 Jul 30, 2020
9306b26
Set explicit exit code for Travis
eumel8 Jul 30, 2020
4f82998
Add a comment for finishing helm uninstalling
eumel8 Jul 31, 2020
db330a3
Debug namespace delete
eumel8 Jul 31, 2020
20dd172
Nowait for namespace deletion
eumel8 Jul 31, 2020
8fd5d5c
No wait
eumel8 Jul 31, 2020
209cd83
Create namespace in Helm/review docs
eumel8 Aug 5, 2020
89c6ec5
Update doc
eumel8 Aug 5, 2020
d4a7552
Fix merge conflict
eumel8 Aug 5, 2020
a289cad
Bump helm 3.2.4
eumel8 Aug 5, 2020
b423915
Helmv3 travis (#1)
eumel8 Aug 6, 2020
b86f65e
Helmv3 migration of the chart
eumel8 Jul 29, 2020
366351c
Helm3 adjustments for Travis
eumel8 Jul 29, 2020
16cf1c4
Fix download url Helmv3
eumel8 Jul 29, 2020
f124fc5
Remove empty annotations
eumel8 Jul 30, 2020
8ee98a4
Still fix Travis
eumel8 Jul 30, 2020
df71ebc
Create namespace before helm deploy
eumel8 Jul 30, 2020
478b703
Remove helm purge
eumel8 Jul 30, 2020
8a87464
No extra resource handling is required in Helmv3
eumel8 Jul 30, 2020
946e7e5
Set explicit exit code for Travis
eumel8 Jul 30, 2020
00ec58c
Add a comment for finishing helm uninstalling
eumel8 Jul 31, 2020
3ada8a5
Debug namespace delete
eumel8 Jul 31, 2020
ba642ef
Nowait for namespace deletion
eumel8 Jul 31, 2020
6b47b7d
No wait
eumel8 Jul 31, 2020
61f4889
Create namespace in Helm/review docs
eumel8 Aug 5, 2020
bcb6b36
Create namespace before helm deploy
eumel8 Jul 30, 2020
cce741d
Set explicit exit code for Travis
eumel8 Jul 30, 2020
74ae447
Add a comment for finishing helm uninstalling
eumel8 Jul 31, 2020
1c9fd75
Create namespace in Helm/review docs
eumel8 Aug 5, 2020
cf341a0
Update doc
eumel8 Aug 5, 2020
608057d
Bump helm 3.2.4
eumel8 Aug 5, 2020
f6da623
Fix name in helm deploy
eumel8 Aug 6, 2020
bc90002
Fix merge conflicts
eumel8 Aug 6, 2020
dd82b52
Add Helm v3 migration notes
eumel8 Aug 6, 2020
a891471
Bump chart api version
eumel8 Aug 6, 2020
4dc186d
Delete debug output
eumel8 Aug 12, 2020
ccfeeb8
Delete debug output
eumel8 Aug 12, 2020
5a2225b
Cleanup crd deletion in Travis
eumel8 Aug 12, 2020
e9a9cd2
Update Helm to 3.3.0
eumel8 Aug 12, 2020
db9f99b
Remove debug settings
eumel8 Aug 12, 2020
e35243a
Remove CRD_DIR
eumel8 Aug 12, 2020
70a18f1
Merge remote-tracking branch 'upstream/master' into helmv3
jimmidyson Aug 13, 2020
e755db9
docs: Move helm install output
jimmidyson Aug 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/kubefed/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requirements.lock
4 changes: 2 additions & 2 deletions charts/kubefed/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: v2
description: KubeFed helm chart
name: kubefed
version: 0.0.2
version: 0.0.3
89 changes: 44 additions & 45 deletions charts/kubefed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,7 @@ group](https://groups.google.com/forum/#!forum/kubernetes-sig-multicluster).
## Prerequisites

- Kubernetes 1.13+
- Helm 2.10+

## Configuring RBAC for Helm (Optional)

If your Kubernetes cluster has RBAC enabled, it will be necessary to
ensure that helm is deployed with a service account with the
permissions necessary to deploy KubeFed:

```bash
$ cat << EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: tiller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
EOF

$ helm init --service-account tiller
```
- Helm 3.2+

## Installing the Chart

Expand All @@ -71,15 +40,26 @@ kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/maste

With the repo added, available charts and versions can be viewed.
```bash
$ helm search kubefed --devel
$ helm search repo kubefed
```

Install the chart and specify the version to install with the
`--version` argument. Replace `<x.x.x>` with your desired version.
If you don't want to install CRDs, add a `--skip-crds` at the end of the line:

```bash
$ helm install kubefed-charts/kubefed --name kubefed --version=<x.x.x> --namespace kube-federation-system --devel
$ helm --namespace kube-federation-system upgrade -i kubefed kubefed-charts/kubefed --version=<x.x.x> --create-namespace

Release "kubefed" does not exist. Installing it now.
NAME: kubefed
LAST DEPLOYED: Wed Aug 5 16:03:46 2020
NAMESPACE: kube-federation-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
```


**NOTE:** For **namespace-scoped deployments** (configured with the `--set
global.scope=Namespaced` option in the `helm install` command): if you created
your namespace prior to installing the chart, make sure to **add a `name:
Expand All @@ -95,26 +75,16 @@ namespace with this label by default.

## Uninstalling the Chart

Due to this helm [issue](https://github.com/helm/helm/issues/4440), the CRDs cannot be deleted
when delete helm release, so before delete the helm release, we need first delete all
of the CR and CRDs for KubeFed release.

Delete all KubeFed `FederatedTypeConfig`:

```bash
$ kubectl -n kube-federation-system delete FederatedTypeConfig --all
```

Delete all KubeFed CRDs:

```bash
$ kubectl delete crd $(kubectl get crd | grep -E 'kubefed.io' | awk '{print $1}')
```

Then you can uninstall/delete the `kubefed` release:

```bash
$ helm delete --purge kubefed
$ helm --namespace kube-federation-system uninstall kubefed
```

The command above removes all the Kubernetes components associated with the chart
Expand Down Expand Up @@ -159,3 +129,32 @@ provided while installing the chart. For example:
```bash
$ helm install kubefed-charts/kubefed --name kubefed --namespace kube-federation-system --values values.yaml --devel
```

## Migration from Helm v2 to v3

Helm v3 has a built-in migration feature which can easy move your current Helm v2 installation to Helm v3.

Download Helm v3 CLI from [Release Page](https://github.com/helm/helm/releases).

Convert your kubefed installation to Helm v3:


```bash
$ helm 2to3 convert kubefed
2020/08/06 18:50:57 Release "kubefed" will be converted from Helm v2 to Helm v3.
2020/08/06 18:50:57 [Helm 3] Release "kubefed" will be created.
2020/08/06 18:50:57 [Helm 3] ReleaseVersion "kubefed.v1" will be created.
2020/08/06 18:50:58 [Helm 3] ReleaseVersion "kubefed.v1" created.
2020/08/06 18:50:58 [Helm 3] Release "kubefed" created.
2020/08/06 18:50:58 Release "kubefed" was converted successfully from Helm v2 to Helm v3.
2020/08/06 18:50:58 Note: The v2 release information still remains and should be removed to avoid conflicts with the migrated v3 release.
2020/08/06 18:50:58 v2 release information should only be removed using `helm 2to3` cleanup and when all releases have been migrated over.
```

Check your successful migration:

```bash
$ helm -n kube-federation-system list
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
kubefed kube-federation-system 1 2020-08-06 16:49:41.593438079 +0000 UTC deployed kubefed-0.3.1
```
6 changes: 3 additions & 3 deletions charts/kubefed/charts/controllermanager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "0.0.2"
apiVersion: v2
appVersion: "0.0.3"
description: A Helm chart for KubeFed Controller Manager
name: controllermanager
version: 0.0.2
version: 0.0.3
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
{{ if (or (or (not .Values.global.scope) (eq .Values.global.scope "Cluster")) (not (.Capabilities.APIVersions.Has "core.kubefed.io/v1beta1"))) }}
eumel8 marked this conversation as resolved.
Show resolved Hide resolved
---

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: clusterpropagatedversions.core.kubefed.io
spec:
Expand Down Expand Up @@ -89,8 +84,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: federatedservicestatuses.core.kubefed.io
spec:
Expand Down Expand Up @@ -174,8 +167,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: federatedtypeconfigs.core.kubefed.io
spec:
Expand Down Expand Up @@ -350,8 +341,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: kubefedclusters.core.kubefed.io
spec:
Expand Down Expand Up @@ -492,8 +481,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: kubefedconfigs.core.kubefed.io
spec:
Expand Down Expand Up @@ -625,8 +612,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: propagatedversions.core.kubefed.io
spec:
Expand Down Expand Up @@ -709,8 +694,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: dnsendpoints.multiclusterdns.kubefed.io
spec:
Expand Down Expand Up @@ -799,8 +782,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: domains.multiclusterdns.kubefed.io
spec:
Expand Down Expand Up @@ -854,8 +835,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: ingressdnsrecords.multiclusterdns.kubefed.io
spec:
Expand Down Expand Up @@ -953,8 +932,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: servicednsrecords.multiclusterdns.kubefed.io
spec:
Expand Down Expand Up @@ -1090,8 +1067,6 @@ status:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
creationTimestamp: null
name: replicaschedulingpreferences.scheduling.kubefed.io
spec:
Expand Down Expand Up @@ -1195,4 +1170,3 @@ status:
conditions: []
storedVersions: []
---
{{ end }}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{{ if (or (or (not .Values.global.scope) (eq .Values.global.scope "Cluster")) (not (.Capabilities.APIVersions.Has "types.kubefed.io/v1beta1"))) }}
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedclusterroles.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -133,8 +130,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedconfigmaps.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -265,8 +260,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federateddeployments.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -399,8 +392,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedingresses.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -531,8 +522,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedjobs.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -661,8 +650,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatednamespaces.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -793,8 +780,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedreplicasets.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -927,8 +912,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedsecrets.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -1057,8 +1040,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedserviceaccounts.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -1189,8 +1170,6 @@ spec:
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
"helm.sh/hook": crd-install
name: federatedservices.types.kubefed.io
spec:
group: types.kubefed.io
Expand Down Expand Up @@ -1317,4 +1296,3 @@ spec:
required:
- spec
version: v1beta1
{{ end }}
11 changes: 6 additions & 5 deletions scripts/delete-kubefed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@ source "$(dirname "${BASH_SOURCE}")/util.sh"

function delete-helm-deployment() {
# Clean kubefed resources
echo "Delete FederatedTypeConfigs"
${KCD} -n "${NS}" FederatedTypeConfig --all
if [[ ! "${NAMESPACED}" || "${DELETE_CLUSTER_RESOURCE}" ]]; then
${KCD} crd $(kubectl get crd | grep -E 'kubefed.io' | awk '{print $1}')
fi

if [[ "${NAMESPACED}" ]]; then
helm delete --purge kubefed-${NS}
helm -n ${NS} uninstall kubefed-${NS}
else
helm delete --purge kubefed
helm -n ${NS} uninstall kubefed
fi
}

Expand Down Expand Up @@ -64,6 +62,9 @@ delete-helm-deployment

${KCD} ns "${NS}"

echo "Helm uninstall finished"
exit 0

# Wait for the namespaces to be removed
function ns-deleted() {
kubectl get ns "${1}" &> /dev/null
Expand Down
Loading