-
Notifications
You must be signed in to change notification settings - Fork 535
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Portworx Storage Labs to the Kubernetes Hackfest repo (#393)
* creating a new Portworx folder * updating intro * Installing Portworx steps * adding pxbbq files * deploying pxbbq and adding pxbbq images * adding modules * moving yaml files to yaml folder * first test * removing individual wrapup modules * update permissions * update instance size * update busybox * adding troublshooting section * Removing App IO control * updating wrap up script * updating pgbench * Fix issues for demo * Update README.md --------- Co-authored-by: Tommy Falgout <[email protected]>
- Loading branch information
1 parent
003875e
commit 8c8526a
Showing
42 changed files
with
1,701 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,61 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: pgbench | ||
labels: | ||
app: pgbench | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: pgbench | ||
strategy: | ||
rollingUpdate: | ||
maxSurge: 1 | ||
maxUnavailable: 1 | ||
type: RollingUpdate | ||
replicas: 1 | ||
template: | ||
metadata: | ||
labels: | ||
app: pgbench | ||
spec: | ||
schedulerName: stork | ||
containers: | ||
- image: postgres:9.5 | ||
name: postgres | ||
ports: | ||
- containerPort: 5432 | ||
env: | ||
- name: POSTGRES_USER | ||
value: pgbench | ||
- name: POSTGRES_PASSWORD | ||
value: superpostgres | ||
- name: PGBENCH_PASSWORD | ||
value: superpostgres | ||
- name: PGDATA | ||
value: /var/lib/postgresql/data/pgdata | ||
volumeMounts: | ||
- mountPath: /var/lib/postgresql/data | ||
name: pgbenchdb | ||
- name: pgbench | ||
image: portworx/torpedo-pgbench:latest | ||
imagePullPolicy: "Always" | ||
env: | ||
- name: PG_HOST | ||
value: 127.0.0.1 | ||
- name: PG_USER | ||
value: pgbench | ||
- name: SIZE | ||
value: "7" | ||
volumeMounts: | ||
- mountPath: /var/lib/postgresql/data | ||
name: pgbenchdb | ||
- mountPath: /pgbench | ||
name: pgbenchstate | ||
volumes: | ||
- name: pgbenchdb | ||
persistentVolumeClaim: | ||
claimName: pgbench-data | ||
- name: pgbenchstate | ||
persistentVolumeClaim: | ||
claimName: pgbench-state |
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,25 @@ | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: pgbench-data | ||
labels: | ||
app: postgres | ||
spec: | ||
storageClassName: block-sc | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi | ||
--- | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: pgbench-state | ||
spec: | ||
storageClassName: block-sc | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi |
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,29 @@ | ||
apiVersion: autopilot.libopenstorage.org/v1alpha1 | ||
kind: AutopilotRule | ||
metadata: | ||
name: volume-resize | ||
spec: | ||
##### selector filters the objects affected by this rule given labels | ||
selector: | ||
matchLabels: | ||
app: postgres | ||
##### namespaceSelector selects the namespaces of the objects affected by this rule | ||
namespaceSelector: | ||
matchLabels: | ||
type: db | ||
##### conditions are the symptoms to evaluate. All conditions are AND'ed | ||
conditions: | ||
# volume usage should be less than 20% | ||
expressions: | ||
- key: "100 * (px_volume_usage_bytes / px_volume_capacity_bytes)" | ||
operator: Gt | ||
values: | ||
- "20" | ||
##### action to perform when condition is true | ||
actions: | ||
- name: openstorage.io.action.volume/resize | ||
params: | ||
# resize volume by scalepercentage of current size | ||
scalepercentage: "20" | ||
# volume capacity should not exceed 50GiB | ||
maxsize: "50Gi" |
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,10 @@ | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1 | ||
metadata: | ||
name: block-sc | ||
provisioner: pxd.portworx.com | ||
parameters: | ||
repl: "3" | ||
priority_io: "high" | ||
io_profile: "auto" | ||
allowVolumeExpansion: true |
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,63 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: shared-demo | ||
name: shared-busybox | ||
spec: | ||
replicas: 3 | ||
selector: | ||
matchLabels: | ||
app: shared-demo | ||
template: | ||
metadata: | ||
labels: | ||
app: shared-demo | ||
spec: | ||
volumes: | ||
- name: shared-vol | ||
persistentVolumeClaim: | ||
claimName: px-sharedv4-pvc | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- image: busybox | ||
imagePullPolicy: Always | ||
name: busybox | ||
volumeMounts: | ||
- name: shared-vol | ||
mountPath: "/mnt" | ||
command: | ||
- sh | ||
args: | ||
- -c | ||
- | | ||
while true; do | ||
echo -e "{"time":$(date +%H:%M:%S),"hostname":$(hostname) writing to shared vol }""\n" >> /mnt/shared.log | ||
sleep 1 | ||
done | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: shared-demo-reader | ||
spec: | ||
volumes: | ||
- name: shared-vol | ||
persistentVolumeClaim: | ||
claimName: px-sharedv4-pvc | ||
terminationGracePeriodSeconds: 5 | ||
containers: | ||
- image: busybox | ||
imagePullPolicy: Always | ||
name: busybox | ||
volumeMounts: | ||
- name: shared-vol | ||
mountPath: "/mnt" | ||
command: | ||
- sh | ||
args: | ||
- -c | ||
- | | ||
while true; do | ||
tail -f /mnt/shared.log | ||
done |
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,11 @@ | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1 | ||
metadata: | ||
name: file-sc | ||
provisioner: pxd.portworx.com | ||
parameters: | ||
repl: "2" | ||
priority_io: "high" | ||
sharedv4: "true" | ||
sharedv4_svc_type: "ClusterIP" | ||
sharedv4_failover_strategy: "aggressive" |
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,66 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: grafana | ||
namespace: portworx | ||
labels: | ||
app: grafana | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: grafana | ||
template: | ||
metadata: | ||
labels: | ||
app: grafana | ||
spec: | ||
containers: | ||
- image: grafana/grafana:7.5.17 | ||
name: grafana | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
limits: | ||
cpu: 100m | ||
memory: 100Mi | ||
requests: | ||
cpu: 100m | ||
memory: 100Mi | ||
readinessProbe: | ||
httpGet: | ||
path: /login | ||
port: 3000 | ||
volumeMounts: | ||
- name: grafana-dash-config | ||
mountPath: /etc/grafana/provisioning/dashboards | ||
- name: dashboard-templates | ||
mountPath: /var/lib/grafana/dashboards | ||
- name: grafana-source-config | ||
mountPath: /etc/grafana/provisioning/datasources | ||
volumes: | ||
- name: grafana-source-config | ||
configMap: | ||
name: grafana-source-config | ||
- name: grafana-dash-config | ||
configMap: | ||
name: grafana-dashboard-config | ||
- name: dashboard-templates | ||
configMap: | ||
name: grafana-dashboards | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grafana-svc | ||
namespace: portworx | ||
labels: | ||
app: grafana | ||
spec: | ||
type: LoadBalancer | ||
selector: | ||
app: grafana | ||
ports: | ||
- protocol: TCP | ||
port: 3000 | ||
targetPort: 3000 | ||
name: grafana |
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,7 @@ | ||
kind: StorageClass | ||
apiVersion: storage.k8s.io/v1 | ||
metadata: | ||
name: group-sc | ||
provisioner: pxd.portworx.com | ||
parameters: | ||
repl: "2" |
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,30 @@ | ||
#!/bin/bash | ||
|
||
curl -O https://docs.portworx.com/samples/k8s/pxc/grafana-dashboard-config.yaml | ||
sleep 3 | ||
curl -O https://docs.portworx.com/samples/k8s/pxc/grafana-datasource.yaml | ||
sleep 5 | ||
|
||
kubectl -n portworx create configmap grafana-dashboard-config --from-file=grafana-dashboard-config.yaml | ||
kubectl -n portworx create configmap grafana-source-config --from-file=grafana-datasource.yaml | ||
|
||
sleep 5 | ||
|
||
curl "https://docs.portworx.com/samples/k8s/pxc/portworx-cluster-dashboard.json" -o portworx-cluster-dashboard.json && \ | ||
curl "https://docs.portworx.com/samples/k8s/pxc/portworx-node-dashboard.json" -o portworx-node-dashboard.json && \ | ||
curl "https://docs.portworx.com/samples/k8s/pxc/portworx-volume-dashboard.json" -o portworx-volume-dashboard.json && \ | ||
curl "https://docs.portworx.com/samples/k8s/pxc/portworx-performance-dashboard.json" -o portworx-performance-dashboard.json && \ | ||
curl "https://docs.portworx.com/samples/k8s/pxc/portworx-etcd-dashboard.json" -o portworx-etcd-dashboard.json | ||
|
||
sleep 5 | ||
|
||
kubectl -n portworx create configmap grafana-dashboards \ | ||
--from-file=portworx-cluster-dashboard.json \ | ||
--from-file=portworx-performance-dashboard.json \ | ||
--from-file=portworx-node-dashboard.json \ | ||
--from-file=portworx-volume-dashboard.json \ | ||
--from-file=portworx-etcd-dashboard.json | ||
|
||
sleep 5 | ||
|
||
kubectl apply -f grafana.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,7 @@ | ||
apiVersion: volumesnapshot.external-storage.k8s.io/v1 | ||
kind: VolumeSnapshot | ||
metadata: | ||
name: px-mongo-snapshot | ||
namespace: pxbbq | ||
spec: | ||
persistentVolumeClaimName: mongodb-pvc |
Oops, something went wrong.