Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

added persistent disk for docker storage #341

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ cloud_infrastructure:
name_prefix: master
preemptible: false
docker_volume_size: 12
# docker volume type options are persistent or ephemeral (default persistent)
docker_volume_type: persistent
appnodes:
count: 3
flavor: n1-standard-4
Expand All @@ -39,6 +41,7 @@ cloud_infrastructure:
name_prefix: node
preemptible: false
docker_volume_size: 50
docker_volume_type: persistent
infranodes:
count: 3
flavor: n1-standard-4
Expand All @@ -49,9 +52,11 @@ cloud_infrastructure:
name_prefix: infranode
preemptible: false
docker_volume_size: 20
docker_volume_type: persistent

# docker_storage_block_device: "/dev/vdb"
# docker_storage_mount_point: "/var/lib/containers/docker"
docker_volume_name: docker-storage
container_runtime_docker_storage_setup_device: /dev/disk/by-id/google-{{ gcloud_docker_volume_name }}
container_runtime_docker_storage_type: overlay2

# Subscription Management Details
rhsm_register: True
Expand Down
5 changes: 4 additions & 1 deletion roles/manage-gcp-infra/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ cloud_infrastructure:
preemptible: false
# default docker volume size
docker_volume_size: 10
docker_volume_type: persistent
appnodes:
name_prefix: node
flavor: n1-standard-2
preemptible: false
docker_volume_size: 50
docker_volume_type: persistent
infranodes:
name_prefix: infranode
flavor: n1-standard-2
preemptible: false
docker_volume_size: 20
docker_volume_size: 20
docker_volume_type: persistent
39 changes: 39 additions & 0 deletions roles/manage-gcp-infra/templates/openshift-gcloud.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,26 @@ resources:
diskSizeGb: {{ gcloud_vm_disk_size }}
sourceImage: https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/family/rhel-7
diskType: pd-ssd
{% if gcloud_masters_docker_volume_type == 'persistent' %}
- deviceName: {{ gcloud_docker_volume_name }}
boot: false
index: 1
kind: compute#attachedDisk
type: persistent
autoDelete: true
initializeParams:
diskType: pd-ssd
diskSizeGb: {{ gcloud_masters_docker_volume_size }}
{% endif %}
{% if gcloud_masters_docker_volume_type == 'ephemeral' %}
- autoDelete: true
boot: false
index: 1
deviceName: {{ gcloud_docker_volume_name }}
type: SCRATCH
initializeParams:
diskType: local-ssd
{% endif %}
machineType: {{ gcloud_masters_flavor }}
networkInterfaces:
- accessConfigs:
Expand Down Expand Up @@ -60,13 +73,26 @@ resources:
diskSizeGb: {{ gcloud_vm_disk_size }}
sourceImage: https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/family/rhel-7
diskType: pd-ssd
{% if gcloud_appnodes_docker_volume_type == 'persistent' %}
- deviceName: {{ gcloud_docker_volume_name }}
boot: false
index: 1
kind: compute#attachedDisk
type: persistent
autoDelete: true
initializeParams:
diskType: pd-standard
diskSizeGb: {{ gcloud_appnodes_docker_volume_size }}
{% endif %}
{% if gcloud_appnodes_docker_volume_type == 'ephemeral' %}
- autoDelete: true
boot: false
index: 1
deviceName: {{ gcloud_docker_volume_name }}
type: SCRATCH
initializeParams:
diskType: local-ssd
{% endif %}
machineType: {{ gcloud_appnodes_flavor }}
networkInterfaces:
- accessConfigs:
Expand Down Expand Up @@ -105,13 +131,26 @@ resources:
diskSizeGb: {{ gcloud_vm_disk_size }}
sourceImage: https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/family/rhel-7
diskType: pd-ssd
{% if gcloud_infranodes_docker_volume_type == 'persistent' %}
- deviceName: {{ gcloud_docker_volume_name }}
boot: false
index: 1
kind: compute#attachedDisk
type: persistent
autoDelete: true
initializeParams:
diskType: pd-standard
diskSizeGb: {{ gcloud_infranodes_docker_volume_size }}
{% endif %}
{% if gcloud_infranodes_docker_volume_type == 'ephemeral' %}
- autoDelete: true
boot: false
index: 1
deviceName: {{ gcloud_docker_volume_name }}
type: SCRATCH
initializeParams:
diskType: local-ssd
{% endif %}
machineType: {{ gcloud_infranodes_flavor }}
networkInterfaces:
- accessConfigs:
Expand Down
6 changes: 5 additions & 1 deletion roles/manage-gcp-infra/vars/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ gcloud_masters_docker_volume_size: "{{ cloud_infrastructure.masters.docker_volum
gcloud_appnodes_docker_volume_size: "{{ cloud_infrastructure.appnodes.docker_volume_size }}"
gcloud_infranodes_docker_volume_size: "{{ cloud_infrastructure.infranodes.docker_volume_size }}"

gcloud_masters_docker_volume_type: "{{ cloud_infrastructure.masters.docker_volume_type }}"
gcloud_appnodes_docker_volume_type: "{{ cloud_infrastructure.appnodes.docker_volume_type }}"
gcloud_infranodes_docker_volume_type: "{{ cloud_infrastructure.infranodes.docker_volume_type }}"

gcloud_region: "{{ cloud_infrastructure.region }}"
gcloud_project_name: "{{ project_id }}"
gcloud_managed_zone: "{{ dns_domain }}"
gcloud_env: "{{ env_id }}"
gcloud_master_external_fqdn: "{{ openshift_master_cluster_public_hostname }}"
gcloud_master_internal_fqdn: "{{ openshift_master_cluster_hostname }}"
gcloud_infranode_wildcard_fqdn: "*.{{ openshift_master_default_subdomain }}"
gcloud_docker_volume_name: docker-storage
gcloud_docker_volume_name: "{{ docker_volume_name }}"
gcloud_vm_disk_size: 50
gcloud_registry_configmap_name: registry-config
gcloud_registry_bucket_name: "{{ google_registry_bucket_name }}"
Expand Down