Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions charts/external-snapshotter/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
21 changes: 21 additions & 0 deletions charts/external-snapshotter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v2
name: external-snapshotter
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "6.0.1"
155 changes: 155 additions & 0 deletions charts/external-snapshotter/crds/external-snapshotter.crds.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: snapshot-controller
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: snapshot-controller-leaderelection
namespace: kube-system
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- watch
- list
- delete
- update
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: snapshot-controller-runner
rules:
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- list
- watch
- create
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotclasses
verbs:
- get
- list
- watch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- create
- get
- list
- watch
- update
- delete
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents/status
verbs:
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots/status
verbs:
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: snapshot-controller-leaderelection
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: snapshot-controller-leaderelection
subjects:
- kind: ServiceAccount
name: snapshot-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: snapshot-controller-role
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: snapshot-controller-runner
subjects:
- kind: ServiceAccount
name: snapshot-controller
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: snapshot-controller
namespace: kube-system
spec:
minReadySeconds: 15
replicas: 2
selector:
matchLabels:
app: snapshot-controller
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: snapshot-controller
spec:
containers:
- args:
- --v=5
- --leader-election=true
image: gcr.io/k8s-staging-sig-storage/snapshot-controller:v6.0.1
imagePullPolicy: IfNotPresent
name: snapshot-controller
serviceAccountName: snapshot-controller
151 changes: 151 additions & 0 deletions charts/external-snapshotter/templates/snapshot-controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: snapshot-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: snapshot-controller-leaderelection
rules:
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- watch
- list
- delete
- update
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: snapshot-controller-runner
rules:
- apiGroups:
- ""
resources:
- persistentvolumes
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- persistentvolumeclaims
verbs:
- get
- list
- watch
- update
- apiGroups:
- ""
resources:
- events
verbs:
- list
- watch
- create
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotclasses
verbs:
- get
- list
- watch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents
verbs:
- create
- get
- list
- watch
- update
- delete
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshotcontents/status
verbs:
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots
verbs:
- get
- list
- watch
- update
- patch
- apiGroups:
- snapshot.storage.k8s.io
resources:
- volumesnapshots/status
verbs:
- update
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: snapshot-controller-leaderelection
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: snapshot-controller-leaderelection
subjects:
- kind: ServiceAccount
name: snapshot-controller
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: snapshot-controller-role
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: snapshot-controller-runner
subjects:
- kind: ServiceAccount
name: snapshot-controller
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: snapshot-controller
spec:
minReadySeconds: 15
replicas: 2
selector:
matchLabels:
app: snapshot-controller
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: snapshot-controller
spec:
containers:
- args:
- --v=5
- --leader-election=true
image: gcr.io/k8s-staging-sig-storage/snapshot-controller:v6.0.1
imagePullPolicy: IfNotPresent
name: snapshot-controller
serviceAccountName: snapshot-controller
Empty file.
19 changes: 19 additions & 0 deletions release-tools/update-helm-charts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# update crds
rm charts/external-snapshotter/crds/*
kubectl kustomize deploy/kubernetes/snapshot-controller | yq 'del(.metadata.creationTimestamp)' > charts/external-snapshotter/crds/external-snapshotter.crds.yaml

# update templates
rm charts/external-snapshotter/templates/*
kubectl kustomize deploy/kubernetes/snapshot-controller | yq 'del(.metadata.namespace)' > charts/external-snapshotter/templates/snapshot-controller.yaml

cp charts/external-snapshotter/Chart.yaml .tmp.Chart.yaml

# update version
yq '.version | capture("(?P<n>[0-9]$)") | .n tag= "!!int" | load(".tmp.Chart.yaml") * {"version": (load(".tmp.Chart.yaml") | .version | capture("(?P<n>[0-9]+\.[0-9]+\.)[0-9]+$") | .n) + .n + 1}' .tmp.Chart.yaml > charts/external-snapshotter/Chart.yaml

cp charts/external-snapshotter/Chart.yaml .tmp.Chart.yaml

# update appVersion
kubectl kustomize deploy/kubernetes/snapshot-controller | yq 'select(.kind == "Deployment") | .spec.template.spec.containers[] | select(.name == "snapshot-controller") | .image | capture(".*v(?P<n>[0-9\.]+)") | load(".tmp.Chart.yaml") * {"appVersion": .n}' > charts/external-snapshotter/Chart.yaml

rm .tmp.Chart.yaml