Skip to content

Commit

Permalink
Merge pull request #320 from gianlucam76/techsupport
Browse files Browse the repository at this point in the history
(feat) remove techsupport
  • Loading branch information
gianlucam76 authored Jan 2, 2025
2 parents 0f02d4b + 2ae59d4 commit 8a53d8f
Show file tree
Hide file tree
Showing 39 changed files with 184 additions and 4,093 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.22.7
go-version: 1.23.4
- name: Build
run: make build
- name: FMT
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0
with:
go-version: 1.22.7
go-version: 1.23.4
- name: ut
run: make test
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.22.7 AS builder
FROM golang:1.23.4 AS builder

ARG ARCH
ARG GIT_VERSION=unknown
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ KUBECTL := $(TOOLS_BIN_DIR)/kubectl
SETUP_ENVTEST := $(TOOLS_BIN_DIR)/setup_envs
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen

GOLANGCI_LINT_VERSION := "v1.61.0"
GOLANGCI_LINT_VERSION := "v1.62.2"

KUSTOMIZE_VER := v5.3.0
KUSTOMIZE_BIN := kustomize
Expand All @@ -44,7 +44,7 @@ KUSTOMIZE_PKG := sigs.k8s.io/kustomize/kustomize/v5
$(KUSTOMIZE): # Build kustomize from tools folder.
CGO_ENABLED=0 GOBIN=$(TOOLS_BIN_DIR) $(GO_INSTALL) $(KUSTOMIZE_PKG) $(KUSTOMIZE_BIN) $(KUSTOMIZE_VER)

CONVERSION_GEN_VER := v0.31.0
CONVERSION_GEN_VER := v0.32.0
CONVERSION_GEN_BIN := conversion-gen
# We are intentionally using the binary without version suffix, to avoid the version
# in generated files.
Expand Down Expand Up @@ -120,7 +120,6 @@ generate: ## Run all generate-manifests-*, generate-go-deepcopy-*
echo "---" >> manifest/manifest.yaml
cat tmp/apiextensions.k8s.io_v1_customresourcedefinition_snapshots.utils.projectsveltos.io.yaml >> manifest/manifest.yaml
echo "---" >> manifest/manifest.yaml
cat tmp/apiextensions.k8s.io_v1_customresourcedefinition_techsupports.utils.projectsveltos.io.yaml >> manifest/manifest.yaml
rm -rf tmp
MANIFEST_IMG=$(SVELTOSCTL_IMG) MANIFEST_TAG=$(TAG) $(MAKE) set-manifest-image
$(MAKE) fmt
Expand Down
53 changes: 0 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ You might also want to change the timezone of sveltosctl pod by using specific t
- [Multi-tenancy: display admin permissions](#multi-tenancy-display-admin-permissions)
- [Log severity settings](#log-severity-settings)
- [Display outcome of ClusterProfile/Profile in DryRun mode](#display-outcome-of-clusterprofile-in-dryrun-mode)
- [Techsupport](#techsupport)
- [list](#list)
- [Snapshot](#snapshot)
- [list](#list-1)
- [diff](#diff)
Expand Down Expand Up @@ -248,57 +246,6 @@ Usage:
--profile=<name> Show which Kubernetes addons would change because of this clusterprofile/profile. If not specified all clusterprofiles/profiles are considered.
```

## Techsupport

When running sveltosctl as pod in the management cluster, it can take collect techsupports (both logs and resources).

Define a Techsupport instance, following for instance will collect a techsupport every hour, collecting:

1. logs for all pods in kube-system namespace (last 10 minutes,i.e, 600 seconds, of logs);
2. All Secrets and Deployments

from all managed clusters matching cluster selectors __env=fv__

```
apiVersion: utils.projectsveltos.io/v1beta1
kind: Techsupport
metadata:
name: hourly
spec:
clusterSelector:
matchLabels:
env: fv
schedule: “00 * * * *”
storage: /techsupport
logs:
- namespace: kube-system
sinceSeconds: 600
resources:
- group: “”
version: v1
kind: Secret
- group: “”
version: v1
kind: Deployment
```

where field _schedule_ is defined in [Cron format](https://en.wikipedia.org/wiki/Cron).


### list

**techsupport list** can be used to display all collected techsupports:

```
kubectl exec -it -n projectsveltos sveltosctl-0 -- ./sveltosctl techsupport list --techsupport=hourly
+--------------------+---------------------+
| TECHSUPPORT POLICY | DATE |
+--------------------+---------------------+
| hourly | 2022-10-10:22:00:00 |
| hourly | 2022-10-10:23:00:00 |
+--------------------+---------------------+
```

## Snapshot

When running sveltosctl as pod in the management cluster, it can take configuration snapshot.
Expand Down
92 changes: 0 additions & 92 deletions api/v1alpha1/techsupport_conversion.go

This file was deleted.

155 changes: 0 additions & 155 deletions api/v1alpha1/techsupport_types.go

This file was deleted.

Loading

0 comments on commit 8a53d8f

Please sign in to comment.