-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from kanisterio/sync
Volume snapshot prep work; TemplateParam Phases Doc updates
- Loading branch information
Showing
13 changed files
with
916 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Walkthrough of Picture Gallery | ||
|
||
The blueprint for this application is in progress. Once it is ready, we will be able to take PVC screenshots, restore PVCs and delete the backup data. |
17 changes: 17 additions & 0 deletions
17
examples/picture-gallery-pvc-snapshot/backup-actionset.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: cr.kanister.io/v1alpha1 | ||
kind: ActionSet | ||
metadata: | ||
generateName: pic-gal-pvc-snapshot- | ||
namespace: kanister | ||
spec: | ||
actions: | ||
- name: backup | ||
blueprint: picture-gallery | ||
object: | ||
kind: Deployment | ||
name: picture-gallery | ||
namespace: default | ||
profile: | ||
kind: Profile | ||
name: default-profile | ||
namespace: kanister |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
apiVersion: cr.kanister.io/v1alpha1 | ||
kind: Blueprint | ||
metadata: | ||
name: picture-gallery | ||
namespace: kanister | ||
actions: | ||
backup: | ||
type: Deployment | ||
outputArtifacts: | ||
backupLocation: | ||
keyValue: | ||
path: "{{ .Phases.backupVolume.Output.backupLocation }}" | ||
phases: | ||
- func: CreateVolumeSnapshot | ||
name: backupVolume | ||
args: | ||
namespace: "{{ .Deployment.Namespace }}" | ||
restore: | ||
type: Deployment | ||
inputArtifactNames: | ||
- backupLocation | ||
phases: | ||
- func: ScaleWorkload | ||
name: shutdownPod | ||
args: | ||
namespace: "{{ .Deployment.Namespace }}" | ||
name: "{{ .Deployment.Name }}" | ||
kind: Deployment | ||
replicas: 0 | ||
- func: CreateVolumeFromSnapshot | ||
name: restoreVolume | ||
args: | ||
namespace: "{{ .Deployment.Namespace }}" | ||
snapshots: "{{ .ArtifactsIn.backupLocation.KeyValue.path }}" | ||
- func: ScaleWorkload | ||
name: bringupPod | ||
args: | ||
namespace: "{{ .Deployment.Namespace }}" | ||
name: "{{ .Deployment.Name }}" | ||
kind: Deployment | ||
replicas: 1 | ||
delete: | ||
type: Deployment | ||
inputArtifactNames: | ||
- backupLocation | ||
phases: | ||
- func: DeleteVolumeSnapshot | ||
name: deleteVolumeSnapshot | ||
args: | ||
namespace: "{{ .Deployment.Namespace }}" | ||
snapshots: "{{ .ArtifactsIn.backupLocation.KeyValue.path }}" |
122 changes: 122 additions & 0 deletions
122
examples/picture-gallery-pvc-snapshot/picture-gallery-deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: picture-gallery | ||
labels: | ||
app: picture-gallery | ||
spec: | ||
ports: | ||
- port: 80 | ||
selector: | ||
app: picture-gallery | ||
tier: frontend | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: pic-gal-php-cfg | ||
labels: | ||
app: picture-gallery | ||
contains: php-config | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: pic-gal-pics | ||
labels: | ||
app: picture-gallery | ||
contains: uploaded-pictures | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 2Gi | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: pic-gal-mysql | ||
labels: | ||
app: picture-gallery | ||
contains: mysql-dbs | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: extensions/v1beta1 | ||
kind: Deployment | ||
metadata: | ||
name: picture-gallery | ||
labels: | ||
app: picture-gallery | ||
spec: | ||
strategy: | ||
type: Recreate | ||
selector: | ||
matchLabels: | ||
app: picture-gallery | ||
template: | ||
metadata: | ||
labels: | ||
app: picture-gallery | ||
tier: frontend | ||
spec: | ||
containers: | ||
- image: kastenio/picturegallery:70307e | ||
livenessProbe: | ||
httpGet: | ||
path: / | ||
port: 80 | ||
scheme: HTTP | ||
initialDelaySeconds: 30 | ||
timeoutSeconds: 5 | ||
name: picture-gallery | ||
ports: | ||
- containerPort: 80 | ||
name: picture-gallery | ||
volumeMounts: | ||
- name: pic-gal-php-cfg | ||
mountPath: /data | ||
- name: pic-gal-pic | ||
mountPath: /uploads | ||
- name: pic-gal-mysql | ||
mountPath: /mysql | ||
volumes: | ||
- name: pic-gal-php-cfg | ||
persistentVolumeClaim: | ||
claimName: pic-gal-php-cfg | ||
- name: pic-gal-pic | ||
persistentVolumeClaim: | ||
claimName: pic-gal-pics | ||
- name: pic-gal-mysql | ||
persistentVolumeClaim: | ||
claimName: pic-gal-mysql | ||
--- | ||
kind: Ingress | ||
apiVersion: extensions/v1beta1 | ||
#creating ingress for picture-gallery | ||
#is accessible by cluster.domainname/picture-gallery | ||
metadata: | ||
name: picture-gallery | ||
annotations: | ||
kubernetes.io/ingress.class: "nginx" | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
nginx.ingress.kubernetes.io/proxy-body-size: "100m" | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /picture-gallery | ||
backend: | ||
serviceName: picture-gallery | ||
servicePort: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.