Skip to content

Instantly share code, notes, and snippets.

@frapontillo
Last active August 29, 2015 14:27
Show Gist options
  • Save frapontillo/e9fa7666b0e8919c4d7f to your computer and use it in GitHub Desktop.
Save frapontillo/e9fa7666b0e8919c4d7f to your computer and use it in GitHub Desktop.
Multiple pods on same cluster/port
apiVersion: v1
kind: Service
metadata:
labels:
name: upsource-service
name: upsource-service
spec:
type: LoadBalancer
ports:
- # The port that this service should serve on.
port: 80
# The port exposed by the container
targetPort: 8080
protocol: TCP
# Label keys and values that must match in order to receive traffic for this service.
selector:
name: upsource
apiVersion: v1
kind: Pod
metadata:
name: upsource
labels:
name: upsource
spec:
containers:
- image: gcr.io/my-project/upsource:latest
name: upsource
ports:
- name: http
# The port exposed by the container
containerPort: 8080
volumeMounts:
# Name must match the volume name below.
- name: my-persistent-disk
# Mount path within the container.
mountPath: /var/upsource
volumes:
- name: my-persistent-disk
gcePersistentDisk:
# This GCE persistent disk must already exist.
pdName: my-persistent-disk
fsType: ext4
apiVersion: v1
kind: Service
metadata:
labels:
name: youtrack-service
name: youtrack-service
spec:
type: LoadBalancer
ports:
- # The port that this service should serve on.
port: 80
# The port exposed by the container
targetPort: 8080
protocol: TCP
# Label keys and values that must match in order to receive traffic for this service.
selector:
name: youtrack
apiVersion: v1
kind: Pod
metadata:
name: youtrack
labels:
name: youtrack
spec:
containers:
- image: gcr.io/my-project/youtrack:latest
name: youtrack
ports:
- name: http
# The port exposed by the container
containerPort: 8080
volumeMounts:
# Name must match the volume name below.
- name: my-persistent-disk
# Mount path within the container.
mountPath: /var/youtrack
volumes:
- name: my-persistent-disk
gcePersistentDisk:
# This GCE persistent disk must already exist.
pdName: my-persistent-disk
fsType: ext4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment