├── Dockerfile ├── README.md ├── demo.yaml ├── diagram.svg ├── infrastructure ├── argo-events │ ├── event-bus.yaml │ └── kustomization.yaml ├── argo-rollouts │ ├── argo-rollouts-clusterrole-binding.yaml │ └── kustomization.yaml ├── argo-workflow │ ├── argo-binding.yaml │ ├── argo-server-binding.yaml │ ├── argo-server-service.yaml │ ├── kustomization.yaml │ ├── workflow-controller-cm.yaml │ ├── workflow-role-binding.yaml │ └── workflow-role.yaml └── minio │ ├── .gitignore │ ├── Chart.yaml │ ├── demo-minio-deployment.yaml │ ├── demo-minio-service.yaml │ ├── kustomization.yaml │ ├── requirements.yaml │ ├── update.sh │ ├── upstream.yaml │ └── values.yaml └── web-service ├── Dockerfile ├── demo-filestash-config.json ├── event-source.yaml ├── filestash-preview-service.yaml ├── filestash-rollout.yaml ├── filestash-service.yaml ├── index.html ├── index.html.br ├── kustomization.yaml └── sensor.yaml /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:10-slim 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | python python-opencv libopencv-dev wget && \ 5 | apt-get clean && \ 6 | rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 7 | 8 | RUN mkdir /app && wget https://gitlab.com/wavexx/facedetect/-/raw/master/facedetect?inline=false -O /app/facedetect -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Argoproj - Application Delivery Platform 2 | 3 |  4 | 5 | 6 | Argoproj is a set of loosely coupled tools that aims to unleash to power of Kubernetes: 7 | 8 | * Argo Workflows - container-native workflow engine for orchestrating parallel jobs on Kubernetes. 9 | * Argo Events - The event-driven workflow automation framework 10 | * Argo CD - Declarative continuous delivery for Kubernetes 11 | * Argo Rollouts - Progressive delivery for Kubernetes 12 | 13 | Each Argo sub-project is focused on a separate use-case and can be used independently. But together, Argo projects 14 | complement each other and form a **powerful application delivery platform**. 15 | 16 | ## Demo 17 | 18 | This repository demonstrates how Argo allows gluing disconnected open-source projects into a complex system that 19 | solves real-world use cases, with zero code written. 20 | 21 | We are going to build a web application consisting of multiple microservices as well as a background batch processing 22 | system that leverages machine learning. The application allows users to upload an image, stores the photo in an 23 | S3 compatible storage and produces a new image with highlighted faces on it using a pre-trained ML model. 24 | 25 |  26 | 27 | ## Components 28 | 29 | Instead of building an application from scratch, we are going to leverage existing open-source projects and 30 | the Argo projects to make them work together for profit: 31 | 32 |  33 | 34 | * [minio](https://github.com/minio/minio) - Kubernetes native S3 compatible storage. Minio is going to store 35 | user uploaded images and ML workflows outputs. 36 | * [filestash](https://www.filestash.app/) - A modern web client for the storage of your choice. Filestash 37 | allows user to upload an image and view processing results. 38 | * [facedetect](https://www.thregr.org/~wavexx/software/facedetect/) - a simple face detector for batch processing. 39 | The facedetect encapsulates the magic and produces an image with detected faces. 40 | * [argo-workflows](https://github.com/argoproj/argo) - workflow engine for Kubernetes. Argo Workflows orchestrates 41 | steps requires to access uploaded image, process the image and store processing results. 42 | * [argo-events](https://github.com/argoproj/argo-events) - event-driven automation framework for Kubernetes. 43 | Argo Events are watching for new images in the S3 storage and triggers the batch processing workflow. 44 | * [argo-cd](https://github.com/argoproj/argo-cd) - GitOps continuous delivery tool for Kubernetes. Argo CD 45 | manages components listed above it the Kubernetes cluster and encapsulates both day one and day two operations. 46 | 47 | 48 | ## Let's do it 49 | 50 | 1. First of all we need a Kubernetes cluster. Nothing fancy is required here. Use your GKE, EKS cluster or just run 51 | [minikube](https://github.com/kubernetes/minikube) cluster on your laptop. 52 | 2. Install Argo CD. Follow the getting started instructions in Argo CD [documentation](https://argoproj.github.io/argo-cd/getting_started/). 53 | > TLDR: 54 | ``` 55 | kubectl create namespace argocd 56 | kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml 57 | ``` 58 | 3. Deploy the demo scenario using Argo CD, which in turn will spawn all required components in your K8s cluster: 59 | 60 | ``` 61 | kubectl apply -f https://raw.githubusercontent.com/alexmt/argo-combined-demo/master/demo.yaml -n argocd 62 | ``` 63 | 4. Check the components' status in Argo CD user interface. 64 | 65 |  66 | 67 | 68 | ## Try it 69 | 70 | 1. Navigate to the external IP address of `demo-filestash` service on port `9001` and upload an image using the 71 | [filestash](https://www.filestash.app/) web user interface. Note: image file must have ".jpg" extension. 72 | 2. Use [argo workflows](https://github.com/argoproj/argo) user interface to observe background processing process. 73 | Workflows user interface is available via external IP address of `argo-server` service on port `2746`. 74 |  75 | 3. See image processing results in [filestash](https://www.filestash.app/) interface. 76 |  77 | 78 | -------------------------------------------------------------------------------- /demo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: List 3 | items: 4 | - apiVersion: argoproj.io/v1alpha1 5 | kind: Application 6 | metadata: 7 | name: argo-events 8 | labels: 9 | type: infrastructure 10 | spec: 11 | project: default 12 | source: 13 | repoURL: https://github.com/alexmt/argo-combined-demo.git 14 | path: infrastructure/argo-events 15 | destination: &dest 16 | server: "https://kubernetes.default.svc" 17 | namespace: demo 18 | syncPolicy: &policy 19 | automated: 20 | prune: true 21 | selfHeal: true 22 | 23 | - apiVersion: argoproj.io/v1alpha1 24 | kind: Application 25 | metadata: 26 | name: argo-rollouts 27 | labels: 28 | type: infrastructure 29 | spec: 30 | project: default 31 | source: 32 | repoURL: https://github.com/alexmt/argo-combined-demo.git 33 | path: infrastructure/argo-rollouts 34 | destination: *dest 35 | syncPolicy: *policy 36 | 37 | - apiVersion: argoproj.io/v1alpha1 38 | kind: Application 39 | metadata: 40 | name: argo-workflows 41 | labels: 42 | type: infrastructure 43 | spec: 44 | project: default 45 | source: 46 | repoURL: https://github.com/alexmt/argo-combined-demo.git 47 | path: infrastructure/argo-workflow 48 | destination: *dest 49 | syncPolicy: *policy 50 | 51 | - apiVersion: argoproj.io/v1alpha1 52 | kind: Application 53 | metadata: 54 | name: minio 55 | labels: 56 | type: infrastructure 57 | spec: 58 | project: default 59 | source: 60 | repoURL: https://github.com/alexmt/argo-combined-demo.git 61 | path: infrastructure/minio 62 | destination: *dest 63 | syncPolicy: *policy 64 | 65 | - apiVersion: argoproj.io/v1alpha1 66 | kind: Application 67 | metadata: 68 | name: web-service 69 | labels: 70 | type: application 71 | spec: 72 | project: default 73 | source: 74 | repoURL: https://github.com/alexmt/argo-combined-demo.git 75 | path: web-service 76 | destination: *dest 77 | syncPolicy: *policy 78 | 79 | - apiVersion: v1 80 | kind: Namespace 81 | metadata: 82 | name: demo 83 | -------------------------------------------------------------------------------- /diagram.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /infrastructure/argo-events/event-bus.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: EventBus 3 | metadata: 4 | name: default 5 | spec: 6 | nats: 7 | native: 8 | # Optional, defaults to 3. If it is < 3, set it to 3, that is the minimal requirement. 9 | replicas: 3 10 | # Optional, authen strategy, "none" or "token", defaults to "none" 11 | auth: token 12 | # containerTemplate: 13 | # resources: 14 | # requests: 15 | # cpu: "10m" 16 | # metricsContainerTemplate: 17 | # resources: 18 | # requests: 19 | # cpu: "10m" 20 | # antiAffinity: false 21 | # persistence: 22 | # storageClassName: standard 23 | # accessMode: ReadWriteOnce 24 | # volumeSize: 10Gi -------------------------------------------------------------------------------- /infrastructure/argo-events/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - https://raw.githubusercontent.com/argoproj/argo-events/v1.0.0/manifests/install.yaml 6 | - event-bus.yaml 7 | 8 | namespace: demo -------------------------------------------------------------------------------- /infrastructure/argo-rollouts/argo-rollouts-clusterrole-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: argo-rollouts-clusterrolebinding 5 | subjects: 6 | - kind: ServiceAccount 7 | name: argo-rollouts 8 | namespace: demo 9 | -------------------------------------------------------------------------------- /infrastructure/argo-rollouts/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - https://raw.githubusercontent.com/argoproj/argo-rollouts/v0.9.2/manifests/install.yaml 6 | 7 | patchesStrategicMerge: 8 | - argo-rollouts-clusterrole-binding.yaml 9 | -------------------------------------------------------------------------------- /infrastructure/argo-workflow/argo-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: argo-binding 5 | subjects: 6 | - kind: ServiceAccount 7 | name: argo 8 | namespace: demo 9 | -------------------------------------------------------------------------------- /infrastructure/argo-workflow/argo-server-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRoleBinding 3 | metadata: 4 | name: argo-server-binding 5 | subjects: 6 | - kind: ServiceAccount 7 | name: argo-server 8 | namespace: demo -------------------------------------------------------------------------------- /infrastructure/argo-workflow/argo-server-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: argo-server 5 | spec: 6 | type: LoadBalancer 7 | -------------------------------------------------------------------------------- /infrastructure/argo-workflow/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - https://raw.githubusercontent.com/argoproj/argo/v2.11.5/manifests/install.yaml 6 | - workflow-role-binding.yaml 7 | - workflow-role.yaml 8 | 9 | patchesStrategicMerge: 10 | - argo-server-service.yaml 11 | - workflow-controller-cm.yaml 12 | - argo-binding.yaml 13 | - argo-server-binding.yaml 14 | -------------------------------------------------------------------------------- /infrastructure/argo-workflow/workflow-controller-cm.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: workflow-controller-configmap 5 | data: 6 | artifactRepository: | 7 | archiveLogs: false 8 | s3: 9 | endpoint: demo-minio:9000 10 | bucket: demo 11 | insecure: true 12 | keyPrefix: artifacts 13 | accessKeySecret: 14 | name: demo-minio 15 | key: accesskey 16 | secretKeySecret: 17 | name: demo-minio 18 | key: secretkey -------------------------------------------------------------------------------- /infrastructure/argo-workflow/workflow-role-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: RoleBinding 3 | metadata: 4 | name: workflow-role-binding 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: workflow-role 9 | subjects: 10 | - kind: ServiceAccount 11 | name: default 12 | -------------------------------------------------------------------------------- /infrastructure/argo-workflow/workflow-role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: Role 3 | metadata: 4 | name: workflow-role 5 | rules: 6 | # pod get/watch is used to identify the container IDs of the current pod 7 | # pod patch is used to annotate the step's outputs back to controller (e.g. artifact location) 8 | - apiGroups: 9 | - "" 10 | resources: 11 | - pods 12 | verbs: 13 | - get 14 | - watch 15 | - patch 16 | # logs get/watch are used to get the pods logs for script outputs, and for log archival 17 | - apiGroups: 18 | - "" 19 | resources: 20 | - pods/log 21 | verbs: 22 | - get 23 | - watch -------------------------------------------------------------------------------- /infrastructure/minio/.gitignore: -------------------------------------------------------------------------------- 1 | charts 2 | requirements.lock -------------------------------------------------------------------------------- /infrastructure/minio/Chart.yaml: -------------------------------------------------------------------------------- 1 | name: upstream-deps 2 | version: 1.0.0 -------------------------------------------------------------------------------- /infrastructure/minio/demo-minio-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: demo-minio 5 | spec: 6 | template: 7 | spec: 8 | containers: 9 | - name: minio 10 | resources: 11 | requests: 12 | memory: 1Gi 13 | -------------------------------------------------------------------------------- /infrastructure/minio/demo-minio-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: demo-minio 5 | spec: 6 | type: LoadBalancer 7 | -------------------------------------------------------------------------------- /infrastructure/minio/kustomization.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: kustomize.config.k8s.io/v1beta1 2 | kind: Kustomization 3 | 4 | resources: 5 | - upstream.yaml 6 | 7 | patchesStrategicMerge: 8 | - demo-minio-service.yaml 9 | - demo-minio-deployment.yaml -------------------------------------------------------------------------------- /infrastructure/minio/requirements.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: minio 3 | version: 7.2.1 4 | repository: https://helm.min.io 5 | -------------------------------------------------------------------------------- /infrastructure/minio/update.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rm requirements.lock && helm dependency build 4 | helm template demo . | grep -v namespace: > upstream.yaml -------------------------------------------------------------------------------- /infrastructure/minio/upstream.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | # Source: upstream-deps/charts/minio/templates/post-install-prometheus-metrics-serviceaccount.yaml 3 | apiVersion: v1 4 | kind: ServiceAccount 5 | metadata: 6 | name: demo-minio-update-prometheus-secret 7 | labels: 8 | app: minio-update-prometheus-secret 9 | chart: minio-7.2.1 10 | release: demo 11 | heritage: Helm 12 | --- 13 | # Source: upstream-deps/charts/minio/templates/serviceaccount.yaml 14 | apiVersion: v1 15 | kind: ServiceAccount 16 | metadata: 17 | name: "demo-minio" 18 | labels: 19 | app: minio 20 | chart: minio-7.2.1 21 | release: "demo" 22 | --- 23 | # Source: upstream-deps/charts/minio/templates/secrets.yaml 24 | apiVersion: v1 25 | kind: Secret 26 | metadata: 27 | name: demo-minio 28 | labels: 29 | app: minio 30 | chart: minio-7.2.1 31 | release: demo 32 | heritage: Helm 33 | type: Opaque 34 | data: 35 | accesskey: "YWRtaW4=" 36 | secretkey: "cGFzc3dvcmQ=" 37 | --- 38 | # Source: upstream-deps/charts/minio/templates/configmap.yaml 39 | apiVersion: v1 40 | kind: ConfigMap 41 | metadata: 42 | name: demo-minio 43 | labels: 44 | app: minio 45 | chart: minio-7.2.1 46 | release: demo 47 | heritage: Helm 48 | data: 49 | initialize: |- 50 | #!/bin/sh 51 | set -e ; # Have script exit in the event of a failed command. 52 | MC_CONFIG_DIR="/etc/minio/mc/" 53 | MC="/usr/bin/mc --config-dir ${MC_CONFIG_DIR}" 54 | 55 | # connectToMinio 56 | # Use a check-sleep-check loop to wait for Minio service to be available 57 | connectToMinio() { 58 | SCHEME=$1 59 | ATTEMPTS=0 ; LIMIT=29 ; # Allow 30 attempts 60 | set -e ; # fail if we can't read the keys. 61 | ACCESS=$(cat /config/accesskey) ; SECRET=$(cat /config/secretkey) ; 62 | set +e ; # The connections to minio are allowed to fail. 63 | echo "Connecting to Minio server: $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT" ; 64 | MC_COMMAND="${MC} config host add myminio $SCHEME://$MINIO_ENDPOINT:$MINIO_PORT $ACCESS $SECRET" ; 65 | $MC_COMMAND ; 66 | STATUS=$? ; 67 | until [ $STATUS = 0 ] 68 | do 69 | ATTEMPTS=`expr $ATTEMPTS + 1` ; 70 | echo \"Failed attempts: $ATTEMPTS\" ; 71 | if [ $ATTEMPTS -gt $LIMIT ]; then 72 | exit 1 ; 73 | fi ; 74 | sleep 2 ; # 1 second intervals between attempts 75 | $MC_COMMAND ; 76 | STATUS=$? ; 77 | done ; 78 | set -e ; # reset `e` as active 79 | return 0 80 | } 81 | 82 | # checkBucketExists ($bucket) 83 | # Check if the bucket exists, by using the exit code of `mc ls` 84 | checkBucketExists() { 85 | BUCKET=$1 86 | CMD=$(${MC} ls myminio/$BUCKET > /dev/null 2>&1) 87 | return $? 88 | } 89 | 90 | # createBucket ($bucket, $policy, $purge) 91 | # Ensure bucket exists, purging if asked to 92 | createBucket() { 93 | BUCKET=$1 94 | POLICY=$2 95 | PURGE=$3 96 | VERSIONING=$4 97 | 98 | # Purge the bucket, if set & exists 99 | # Since PURGE is user input, check explicitly for `true` 100 | if [ $PURGE = true ]; then 101 | if checkBucketExists $BUCKET ; then 102 | echo "Purging bucket '$BUCKET'." 103 | set +e ; # don't exit if this fails 104 | ${MC} rm -r --force myminio/$BUCKET 105 | set -e ; # reset `e` as active 106 | else 107 | echo "Bucket '$BUCKET' does not exist, skipping purge." 108 | fi 109 | fi 110 | 111 | # Create the bucket if it does not exist 112 | if ! checkBucketExists $BUCKET ; then 113 | echo "Creating bucket '$BUCKET'" 114 | ${MC} mb myminio/$BUCKET 115 | else 116 | echo "Bucket '$BUCKET' already exists." 117 | fi 118 | 119 | 120 | # set versioning for bucket 121 | if [ ! -z $VERSIONING ] ; then 122 | if [ $VERSIONING = true ] ; then 123 | echo "Enabling versioning for '$BUCKET'" 124 | ${MC} version enable myminio/$BUCKET 125 | elif [ $VERSIONING = false ] ; then 126 | echo "Suspending versioning for '$BUCKET'" 127 | ${MC} version suspend myminio/$BUCKET 128 | fi 129 | else 130 | echo "Bucket '$BUCKET' versioning unchanged." 131 | fi 132 | 133 | # At this point, the bucket should exist, skip checking for existence 134 | # Set policy on the bucket 135 | echo "Setting policy of bucket '$BUCKET' to '$POLICY'." 136 | ${MC} policy set $POLICY myminio/$BUCKET 137 | } 138 | 139 | # Try connecting to Minio instance 140 | scheme=http 141 | connectToMinio $scheme 142 | # Create the bucket 143 | createBucket demo public false 144 | --- 145 | # Source: upstream-deps/charts/minio/templates/post-install-prometheus-metrics-role.yaml 146 | apiVersion: rbac.authorization.k8s.io/v1 147 | kind: Role 148 | metadata: 149 | name: demo-minio-update-prometheus-secret 150 | labels: 151 | app: minio-update-prometheus-secret 152 | chart: minio-7.2.1 153 | release: demo 154 | heritage: Helm 155 | rules: 156 | - apiGroups: 157 | - "" 158 | resources: 159 | - secrets 160 | verbs: 161 | - get 162 | - create 163 | - update 164 | - patch 165 | resourceNames: 166 | - demo-minio-prometheus 167 | - apiGroups: 168 | - "" 169 | resources: 170 | - secrets 171 | verbs: 172 | - create 173 | - apiGroups: 174 | - monitoring.coreos.com 175 | resources: 176 | - servicemonitors 177 | verbs: 178 | - get 179 | resourceNames: 180 | - demo-minio 181 | --- 182 | # Source: upstream-deps/charts/minio/templates/post-install-prometheus-metrics-rolebinding.yaml 183 | apiVersion: rbac.authorization.k8s.io/v1 184 | kind: RoleBinding 185 | metadata: 186 | name: demo-minio-update-prometheus-secret 187 | labels: 188 | app: minio-update-prometheus-secret 189 | chart: minio-7.2.1 190 | release: demo 191 | heritage: Helm 192 | roleRef: 193 | apiGroup: rbac.authorization.k8s.io 194 | kind: Role 195 | name: demo-minio-update-prometheus-secret 196 | subjects: 197 | - kind: ServiceAccount 198 | name: demo-minio-update-prometheus-secret 199 | --- 200 | # Source: upstream-deps/charts/minio/templates/service.yaml 201 | apiVersion: v1 202 | kind: Service 203 | metadata: 204 | name: demo-minio 205 | labels: 206 | app: minio 207 | chart: minio-7.2.1 208 | release: demo 209 | heritage: Helm 210 | spec: 211 | type: ClusterIP 212 | ports: 213 | - name: http 214 | port: 9000 215 | protocol: TCP 216 | targetPort: 9000 217 | selector: 218 | app: minio 219 | release: demo 220 | --- 221 | # Source: upstream-deps/charts/minio/templates/deployment.yaml 222 | apiVersion: apps/v1 223 | kind: Deployment 224 | metadata: 225 | name: demo-minio 226 | labels: 227 | app: minio 228 | chart: minio-7.2.1 229 | release: demo 230 | heritage: Helm 231 | spec: 232 | strategy: 233 | type: RollingUpdate 234 | rollingUpdate: 235 | maxSurge: 100% 236 | maxUnavailable: 0 237 | selector: 238 | matchLabels: 239 | app: minio 240 | release: demo 241 | template: 242 | metadata: 243 | name: demo-minio 244 | labels: 245 | app: minio 246 | release: demo 247 | annotations: 248 | checksum/secrets: c221e1cbc62563a3a8c0143af58178301358f91a5c57c3c7fc98984011982bb2 249 | checksum/config: 3a947ac7c7b7381c3685c6d4146cf7e31a605ffec2c71e0c0a6a336060cdd46c 250 | spec: 251 | serviceAccountName: "demo-minio" 252 | containers: 253 | - name: minio 254 | image: "minio/minio:RELEASE.2020-10-09T22-55-05Z" 255 | imagePullPolicy: IfNotPresent 256 | command: 257 | - "/bin/sh" 258 | - "-ce" 259 | - "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs/ server /export" 260 | volumeMounts: 261 | ports: 262 | - name: http 263 | containerPort: 9000 264 | env: 265 | - name: MINIO_ACCESS_KEY 266 | valueFrom: 267 | secretKeyRef: 268 | name: demo-minio 269 | key: accesskey 270 | - name: MINIO_SECRET_KEY 271 | valueFrom: 272 | secretKeyRef: 273 | name: demo-minio 274 | key: secretkey 275 | - name: MINIO_API_READY_DEADLINE 276 | value: "5s" 277 | livenessProbe: 278 | httpGet: 279 | path: /minio/health/live 280 | port: http 281 | scheme: HTTP 282 | initialDelaySeconds: 120 283 | periodSeconds: 15 284 | timeoutSeconds: 10 285 | successThreshold: 1 286 | failureThreshold: 3 287 | resources: 288 | requests: 289 | memory: 4Gi 290 | volumes: 291 | - name: export 292 | emptyDir: {} 293 | - name: minio-user 294 | secret: 295 | secretName: demo-minio 296 | --- 297 | # Source: upstream-deps/charts/minio/templates/post-install-create-bucket-job.yaml 298 | apiVersion: batch/v1 299 | kind: Job 300 | metadata: 301 | name: demo-minio-make-bucket-job 302 | labels: 303 | app: minio-make-bucket-job 304 | chart: minio-7.2.1 305 | release: demo 306 | heritage: Helm 307 | annotations: 308 | "helm.sh/hook": post-install,post-upgrade 309 | "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation 310 | spec: 311 | template: 312 | metadata: 313 | labels: 314 | app: minio-job 315 | release: demo 316 | spec: 317 | restartPolicy: OnFailure 318 | volumes: 319 | - name: minio-configuration 320 | projected: 321 | sources: 322 | - configMap: 323 | name: demo-minio 324 | - secret: 325 | name: demo-minio 326 | serviceAccountName: "demo-minio" 327 | containers: 328 | - name: minio-mc 329 | image: "minio/mc:RELEASE.2020-10-03T02-54-56Z" 330 | imagePullPolicy: IfNotPresent 331 | command: ["/bin/sh", "/config/initialize"] 332 | env: 333 | - name: MINIO_ENDPOINT 334 | value: demo-minio 335 | - name: MINIO_PORT 336 | value: "9000" 337 | volumeMounts: 338 | - name: minio-configuration 339 | mountPath: /config 340 | resources: 341 | requests: 342 | memory: 128Mi 343 | -------------------------------------------------------------------------------- /infrastructure/minio/values.yaml: -------------------------------------------------------------------------------- 1 | minio: 2 | accessKey: admin 3 | secretKey: password 4 | persistence: 5 | enabled: false 6 | defaultBucket: 7 | enabled: true 8 | name: demo 9 | policy: public 10 | purge: false -------------------------------------------------------------------------------- /web-service/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM machines/filestash:b26eb6b 2 | 3 | WORKDIR "/app" 4 | 5 | COPY index.html /app/data/public/index.html 6 | COPY index.html.br /app/data/public/index.html.br 7 | 8 | CMD ["/app/filestash"] -------------------------------------------------------------------------------- /web-service/demo-filestash-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "general": { 3 | "name": null, 4 | "port": null, 5 | "host": null, 6 | "secret_key": "y4m7efYiEoV3NSik", 7 | "force_ssl": null, 8 | "editor": null, 9 | "fork_button": null, 10 | "display_hidden": null, 11 | "auto_connect": true, 12 | "remember_me": null, 13 | "upload_button": true 14 | }, 15 | "features": { 16 | "share": { 17 | "enable": null 18 | }, 19 | "search": { 20 | "enable": null, 21 | "explore_timeout": null, 22 | "process_max": null, 23 | "process_par": null, 24 | "reindex_time": null, 25 | "cycle_time": null, 26 | "max_size": null, 27 | "indexer_ext": null 28 | }, 29 | "server": { 30 | "tunnel_enable": null, 31 | "tunnel_url": null, 32 | "tor_enable": null, 33 | "tor_url": null, 34 | "console_enable": null, 35 | "enable_tunnel": false 36 | }, 37 | "video": { 38 | "blacklist_format": null, 39 | "enable_transcoder": null 40 | }, 41 | "office": { 42 | "enable": null, 43 | "onlyoffice_server": null 44 | }, 45 | "syncthing": { 46 | "enable": null, 47 | "server_url": null 48 | }, 49 | "image": { 50 | "enable_image": null, 51 | "thumbnail_size": null, 52 | "thumbnail_quality": null, 53 | "thumbnail_caching": null, 54 | "image_quality": null, 55 | "image_caching": null 56 | }, 57 | "protection": { 58 | "enable": null, 59 | "disable_svg": null, 60 | "iframe": null 61 | } 62 | }, 63 | "log": { 64 | "enable": null, 65 | "level": null, 66 | "telemetry": null 67 | }, 68 | "email": { 69 | "server": null, 70 | "port": null, 71 | "username": null, 72 | "password": null, 73 | "from": null 74 | }, 75 | "auth": { 76 | "admin": "$2a$10$SkkqOj6D6t0BJe7gPwFPBuRb3LtC9kG/TjHOnNTSYaWoBi1hH6YpW" 77 | }, 78 | "connections": [ 79 | { 80 | "access_key_id": "admin", 81 | "advanced": true, 82 | "endpoint": "http://demo-minio:9000", 83 | "label": "S3", 84 | "path": "/demo", 85 | "secret_access_key": "password", 86 | "type": "s3" 87 | } 88 | ] 89 | } -------------------------------------------------------------------------------- /web-service/event-source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: EventSource 3 | metadata: 4 | name: minio 5 | spec: 6 | minio: 7 | example: 8 | bucket: 9 | name: demo 10 | endpoint: demo-minio:9000 11 | events: 12 | - s3:ObjectCreated:Put 13 | insecure: true 14 | filter: 15 | suffix: ".jpg" 16 | accessKey: 17 | name: demo-minio 18 | key: accesskey 19 | secretKey: 20 | name: demo-minio 21 | key: secretkey 22 | -------------------------------------------------------------------------------- /web-service/filestash-preview-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: demo-filestash-preview 5 | spec: 6 | ports: 7 | - name: tcp-demo-filestash 8 | port: 9002 9 | targetPort: 8334 10 | selector: 11 | app.kubernetes.io/name: demo-filestash 12 | type: LoadBalancer 13 | -------------------------------------------------------------------------------- /web-service/filestash-rollout.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: argoproj.io/v1alpha1 2 | kind: Rollout 3 | metadata: 4 | name: demo-filestash 5 | spec: 6 | selector: 7 | matchLabels: 8 | app.kubernetes.io/name: demo-filestash 9 | template: 10 | metadata: 11 | labels: 12 | app.kubernetes.io/name: demo-filestash 13 | spec: 14 | containers: 15 | - image: 'machines/filestash:b26eb6b' 16 | imagePullPolicy: Always 17 | name: filestash 18 | ports: 19 | - containerPort: 8334 20 | volumeMounts: 21 | - mountPath: /app/data/state/config 22 | name: config-volume 23 | volumes: 24 | - configMap: 25 | items: 26 | - key: demo-filestash-config.json 27 | path: config.json 28 | name: demo-filestash-cm 29 | name: config-volume 30 | strategy: 31 | blueGreen: 32 | activeService: demo-filestash 33 | previewService: demo-filestash-preview 34 | autoPromotionEnabled: false -------------------------------------------------------------------------------- /web-service/filestash-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: demo-filestash 5 | spec: 6 | ports: 7 | - name: tcp-demo-filestash 8 | port: 9001 9 | targetPort: 8334 10 | selector: 11 | app.kubernetes.io/name: demo-filestash 12 | type: LoadBalancer 13 | -------------------------------------------------------------------------------- /web-service/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |
5 | 6 | 15 |