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

[DOC] update the Uninstall Longhorn documentation #7228

Open
kourosh7 opened this issue Nov 29, 2023 · 5 comments
Open

[DOC] update the Uninstall Longhorn documentation #7228

kourosh7 opened this issue Nov 29, 2023 · 5 comments
Labels
kind/doc Doc request
Milestone

Comments

@kourosh7
Copy link

What's the document you plan to update? Why? Please describe

Update the Uninstall Longhorn documentation

Additional context

This particular section tells you to redeploy the same version of the Longhorn App and then uninstall:
However, it seems the correct action is either:

  • Patch the deleting-confirmation-flag setting and retry the uninstallation, or
  • Roll back the Helm uninstallation

Perhaps we should also consider documenting steps to follow if the user deleted the longhorn-crd from the Rancher Apps > Installed Apps

@ejweber
Copy link
Contributor

ejweber commented Nov 29, 2023

From an out-of-band discussion with @kourosh7, @PhanLe1010, and I:

If you deleted the Longhorn App via the Rancher UI without first editing the deleting-confirmation-flag setting, it is not possible to redeploy. You will get Error: UPGRADE FAILED: "longhorn" has no deployed releases instead. (There is a release, but it has status uninstalling). So you must do one of the two things @kourosh7 mentioned.

I think it is probably best to remove the section @kourosh7 linked and clarify the related sections.

@ejweber
Copy link
Contributor

ejweber commented Nov 29, 2023

Perhaps we should also consider documenting steps to follow if the user deleted the longhorn-crd from the Rancher Apps > Installed Apps

Can you help by documented the steps you followed here @kourosh7?

@ejweber ejweber moved this from New to Pending user response in Community Review Sprint Nov 29, 2023
@kourosh7
Copy link
Author

These are the steps I followed when the longhorn-crd was deleted from Rancher Apps > Installed Apps:

  1. If the longhorn app is stuck in an Uninstalling state first do a helm rollback to the most recent revision number. For example:

helm ls -a -n longhorn-system
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
longhorn longhorn-system 2 2023-11-29 22:28:09.201234959 +0000 UTC uninstalling longhorn-102.3.0+up1.5.1 v1.5.1
helm rollback -n longhorn-system longhorn 2

  1. I manually re-created the settings.longhorn.io CRD by doing a kubectl apply on a manifest with the following content:
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.7.0
    meta.helm.sh/release-name: longhorn-crd
    meta.helm.sh/release-namespace: longhorn-system
  creationTimestamp: null
  labels:
    app.kubernetes.io/instance: longhorn-crd
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: longhorn-crd
    app.kubernetes.io/version: v1.4.0
    helm.sh/chart: longhorn-crd-101.2.0_up1.4.0
    longhorn-manager: ""
  name: settings.longhorn.io
spec:
  group: longhorn.io
  names:
    kind: Setting
    listKind: SettingList
    plural: settings
    shortNames:
    - lhs
    singular: setting
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - description: The value of the setting
      jsonPath: .value
      name: Value
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1beta1
    schema:
      openAPIV3Schema:
        description: Setting is where Longhorn stores setting object.
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          value:
            type: string
        required:
        - value
        type: object
    served: true
    storage: false
    subresources:
      status: {}
  - additionalPrinterColumns:
    - description: The value of the setting
      jsonPath: .value
      name: Value
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    name: v1beta2
    schema:
      openAPIV3Schema:
        description: Setting is where Longhorn stores setting object.
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          value:
            type: string
        required:
        - value
        type: object
    served: true
    storage: true
    subresources:
      status: {}
status:
  acceptedNames:
    kind: ""
    plural: ""
  conditions: []
  storedVersions: []
  1. The settings.longhorn.io CRD has a deleting-confirmation-flag object that is required with value set to true. So, I manually created that object by doing a kubectl apply on the following manifest:
apiVersion: longhorn.io/v1beta2
kind: Setting
metadata:
  annotations:
    longhorn.io/configmap-resource-version: "122768460"
  creationTimestamp: "2023-11-29T19:26:21Z"
  generation: 1
  name: deleting-confirmation-flag
  namespace: longhorn-system
  resourceVersion: "122769040"
  uid: 1e36b9ce-92fb-4f69-a83d-55af918078bf
value: "true"
  1. Then I was able to successfully delete the longhorn app from Rancher Apps > Installed Apps
  2. You must then manually delete the object and CRD that were created in steps 2 and 3.

This is what worked for me. I'm not sure if there is a cleaner way of reinstalling the longhorn-crd to achieve the same results.

@kourosh7
Copy link
Author

I think it is probably best to remove the section @kourosh7 linked and clarify the related sections.

I do agree with this because earlier in the same doc, it says, From Rancher UI, navigate to Catalog Apps tab and delete Longhorn app. So I wasn't sure why there was a section titled I deleted the Longhorn App from Rancher UI instead of following the uninstallation procedure. It seems contradicting. Also, Catalog apps are deprecated in Rancher. In recent versions of Rancher you would see the app by exploring the cluster and going to Apps > Installed Apps. So I think the wording in this section should be updated as well.

@ejweber ejweber moved this from Pending user response to Backlog Candidates in Community Review Sprint Nov 30, 2023
@derekbit derekbit moved this to Triage in Longhorn Sprint Aug 3, 2024
@innobead innobead moved this to New Issues in Longhorn Sprint Sep 10, 2024
Copy link

github-actions bot commented Jan 4, 2025

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jan 4, 2025
@derekbit derekbit removed the stale label Jan 4, 2025
@derekbit derekbit added this to the Backlog milestone Jan 4, 2025
@derekbit derekbit moved this to Resolved in Community Review Sprint Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/doc Doc request
Projects
Status: Resolved
Status: New Issues
Development

No branches or pull requests

3 participants