Stable-Diffusion-UI-GKE/templates/deployment-timeshare.yaml (43 lines of code) (raw):

# Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. apiVersion: apps/v1 kind: Deployment metadata: name: stable-diffusion-deployment labels: app: stable-diffusion spec: replicas: 1 selector: matchLabels: app: stable-diffusion template: metadata: labels: app: stable-diffusion spec: nodeSelector: cloud.google.com/gke-gpu-sharing-strategy: time-sharing cloud.google.com/gke-max-shared-clients-per-gpu: "2" volumes: - name: stable-diffusion-storage persistentVolumeClaim: claimName: $fileshare_name # replace with fileshare name containers: - name: stable-diffusion-webui image: $image_url # e.g. us-central1-docker.pkg.dev/<PROJECT_ID>/<BUILD_REGIST>/sd-webui:0.1 resources: limits: cpu: 2 memory: 15Gi nvidia.com/gpu: 1 ports: - containerPort: 7860 volumeMounts: - mountPath: "/stable-diffusion-webui/models/Stable-diffusion" name: stable-diffusion-storage subPath: models/Stable-diffusion/sd15 - mountPath: "/stable-diffusion-webui/outputs" name: stable-diffusion-storage subPath: outputs - mountPath: "/stable-diffusion-webui/models/ControlNet" name: stable-diffusion-storage subPath: models/ControlNet