blob: 0aa88bd9302340e69a551f1a24aeb536753891c9 [file] [log] [blame]
# Copyright 2016 The Fuchsia Authors
#
# 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.
# This file contans the definitions of the Shuffler's Deployment object
# (which includes an embedded defintion of the Shuffler's Pod object) and the
# Shuffler's Service object.
#
# The definitions contain some parameters (indicated by $$PARAMETER_NAME$$)
# that will be replaced by the script tools/container_util.py prior to being
# passed to "kubectl create"
# The defintion of the Deployment and Pod
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: shuffler
labels:
name: shuffler
# Pod object
spec:
replicas: 1
template:
metadata:
name: shuffler
labels:
name: shuffler
spec:
containers:
- name: shuffler
# The URI of a Docker image in a Docker repository.
image: $$SHUFFLER_IMAGE_URI$$
args:
- '-port'
- '5001'
- '-analyzer_uri'
# This must match the defintion of the "analyzer-service" Service
# in analyzer_service_deployment.yaml
- 'analyzer-service:6001'
- '-config_file'
# This is the path to where the file is copied in Dockerfile.
- '/etc/cobalt/shuffler_config.txt'
- '-db_dir'
# This path must match mountPath for shuffler-persistent-storage
# below.
- '/var/lib/cobalt/db'
- '-use_memstore=$$SHUFFLER_USE_MEMSTORE$$'
- '-private_key_pem_file'
# The directory path must match mountPath for shuffler-key-storage
# below.
- '/var/lib/cobalt/key/$$SHUFFLER_PRIVATE_PEM_NAME$$'
- '-danger_danger_delete_all_data_at_startup=$$DANGER_DANGER_DELETE_ALL_DATA_AT_STARTUP$$'
# TODO(rudominer) Eventually remove this.
- '-logtostderr'
- '-v=3'
ports:
- containerPort: 5001
volumeMounts:
# This name must match the volumes.name for
# shuffler-persistent-storage below.
- name: shuffler-persistent-storage
mountPath: /var/lib/cobalt/db
# This name must match the volumes.name for shuffler-key-storage
# below.
- name: shuffler-key-storage
mountPath: /var/lib/cobalt/key
readOnly: true
volumes:
- name: shuffler-persistent-storage
gcePersistentDisk:
# The name of a GCE persistent disk that has already been created.
pdName: $$GCE_PERSISTENT_DISK_NAME$$
fsType: ext4
- name: shuffler-key-storage
secret:
secretName: $$SHUFFLER_PRIVATE_KEY_SECRET_NAME$$
---
# The defintion of the Service
apiVersion: v1
kind: Service
metadata:
name: shuffler
spec:
ports:
# The port that this service should serve on. This should match the
# port used several times above and the port specified in the Dockerfile.
- port: 5001
selector:
# This must match the metadata.labels section of the Deployment above.
name: shuffler
type: LoadBalancer
loadBalancerIP: $$SHUFFLER_STATIC_IP_ADDRESS$$