Skip to content

Commit 13d90ad

Browse files
authored
Merge pull request #1025 from oracle-devrel/hpc-oke
hpc oke fss
2 parents eed97e9 + d98610b commit 13d90ad

File tree

9 files changed

+196
-0
lines changed

9 files changed

+196
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: PersistentVolume
3+
metadata:
4+
name: fss-pv
5+
spec:
6+
capacity:
7+
storage: 50Gi
8+
volumeMode: Filesystem
9+
accessModes:
10+
- ReadWriteMany
11+
persistentVolumeReclaimPolicy: Retain
12+
csi:
13+
driver: fss.csi.oraclecloud.com
14+
volumeHandle: ocid1.filesystem.oc1.iad.aaaa______j2xw:10.0.0.6:/FileSystem1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: hpc-fss-pvc
5+
spec:
6+
accessModes:
7+
- ReadWriteMany
8+
storageClassName: ""
9+
resources:
10+
requests:
11+
storage: 50Gi
12+
volumeName: hpc-fss-pv
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# OCI HPC with OKE and FSS
2+
3+
4+
This section includes step by step manuals to create and deploy HPC using OKE and FSS.
5+
6+
7+
# License
8+
9+
Copyright (c) 2024 Oracle and/or its affiliates.
10+
11+
Licensed under the Universal Permissive License (UPL), Version 1.0.
12+
13+
See [LICENSE](https://github.com/oracle-devrel/technology-engineering/blob/main/LICENSE) for more details.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Get the API server endpoint & the CA cert from IMDS
4+
OKE_APISERVER_ENDPOINT=$(curl -sH "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/instance/ | jq -r '.metadata."apiserver_host"')
5+
OKE_KUBELET_CA_CERT=$(curl -sH "Authorization: Bearer Oracle" -L http://169.254.169.254/opc/v2/instance/ | jq -r '.metadata."cluster_ca_cert"')
6+
7+
# Adjust boot volume size
8+
sudo dd iflag=direct if=/dev/oracleoci/oraclevda of=/dev/null count=1
9+
echo "1" | sudo tee /sys/class/block/`readlink /dev/oracleoci/oraclevda | cut -d'/' -f 2`/device/rescan
10+
sudo /usr/libexec/oci-growfs -y
11+
12+
bash /etc/oke/oke-install.sh \
13+
--apiserver-endpoint $OKE_APISERVER_ENDPOINT \
14+
--kubelet-ca-cert $OKE_KUBELET_CA_CERT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
module "oke" {
2+
source = "oracle-terraform-modules/oke/oci"
3+
version = "5.1.5"
4+
5+
# Provider
6+
providers = { oci.home = oci.home }
7+
home_region = var.home_region
8+
region = var.region
9+
tenancy_id = var.tenancy_id
10+
compartment_id = var.compartment_id
11+
ssh_public_key = var.ssh_public_key_path
12+
ssh_private_key_path = var.ssh_private_key_path
13+
14+
kubernetes_version = var.kubernetes_version
15+
cluster_type = var.cluster_type
16+
17+
18+
allow_worker_ssh_access = true
19+
control_plane_allowed_cidrs = ["0.0.0.0/0"]
20+
21+
control_plane_is_public = true
22+
23+
24+
vcn_name = "hpc"
25+
26+
#subnets
27+
subnets = {
28+
bastion = { newbits = 13, netnum = 0, dns_label = "bastion" }
29+
operator = { newbits = 13, netnum = 1, dns_label = "operator" }
30+
cp = { newbits = 13, netnum = 2, dns_label = "cp" }
31+
int_lb = { newbits = 11, netnum = 16, dns_label = "ilb" }
32+
pub_lb = { newbits = 11, netnum = 17, dns_label = "plb" }
33+
workers = { newbits = 2, netnum = 1, dns_label = "workers" }
34+
}
35+
36+
assign_dns = true
37+
38+
39+
# bastion host
40+
create_bastion = true
41+
bastion_allowed_cidrs = ["0.0.0.0/0"]
42+
bastion_upgrade = false
43+
bastion_image_os = "Oracle Linux"
44+
bastion_image_os_version = "8"
45+
bastion_image_type = "platform"
46+
bastion_shape = {
47+
shape = "VM.Standard.E4.Flex",
48+
ocpus = 1,
49+
memory = 4,
50+
boot_volume_size = 50
51+
}
52+
53+
54+
#operator host
55+
create_operator = true
56+
operator_upgrade = false
57+
create_iam_resources = true
58+
create_iam_operator_policy = "always"
59+
operator_install_k9s = true
60+
operator_image_os = "Oracle Linux"
61+
operator_image_os_version = "8"
62+
operator_image_type = "platform"
63+
operator_install_k9s = true
64+
operator_shape = {
65+
shape = "VM.Standard.E4.Flex",
66+
ocpus = 1,
67+
memory = 4,
68+
boot_volume_size = 50
69+
}
70+
71+
72+
create_cluster = true
73+
use_defined_tags = false
74+
75+
76+
#node pools
77+
worker_pools = {
78+
79+
hpc = {
80+
description = "HPC pool", enabled = true,
81+
disable_default_cloud_init=true,
82+
mode = "cluster-network",
83+
size = 2,
84+
shape = var.hpc_shape
85+
boot_volume_size = 250,
86+
placement_ads = [1],
87+
image_type = "custom",
88+
image_id = var.hpc_image,
89+
cloud_init = [{ content = "./cloud-init/ol8.sh" }],
90+
agent_config = {
91+
are_all_plugins_disabled = false,
92+
is_management_disabled = false,
93+
is_monitoring_disabled = false,
94+
plugins_config = {
95+
"Compute HPC RDMA Authentication" = "ENABLED",
96+
"Compute HPC RDMA Auto-Configuration" = "ENABLED",
97+
"Compute Instance Monitoring" = "ENABLED",
98+
"Compute Instance Run Command" = "ENABLED",
99+
"Custom Logs Monitoring" = "ENABLED",
100+
"Management Agent" = "ENABLED",
101+
"Oracle Autonomous Linux" = "DISABLED",
102+
"OS Management Service Agent" = "DISABLED",
103+
}
104+
}
105+
}
106+
}
107+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
provider "oci" {
2+
alias = "home"
3+
region = var.home_region
4+
tenancy_ocid = var.tenancy_id
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
variable "home_region" { type = string }
2+
variable "region" { type = string }
3+
variable "tenancy_id" { type = string }
4+
variable "compartment_id" { type = string }
5+
variable "ssh_public_key_path" { type = string }
6+
variable "ssh_private_key_path" { type = string }
7+
8+
variable hpc_image { default = "" }
9+
variable hpc_shape { default = "" }
10+
variable kubernetes_version { default = "v1.29.1" }
11+
variable cluster_type { default = "enhanced" }
12+
variable cluster_name { default = "hpc-cluster" }
13+
variable cni_type {default = "flannel"}
14+
variable cluster_name { default = "oke-rdma-quickstart" }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
home_region = ""
2+
region = ""
3+
tenancy_id = ""
4+
compartment_id = ""
5+
ssh_public_key_path = ""
6+
ssh_private_key_path = ""
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
terraform {
2+
required_providers {
3+
oci = {
4+
configuration_aliases = [oci.home]
5+
source = "oracle/oci"
6+
version = ">= 5.4.0"
7+
}
8+
}
9+
10+
required_version = ">= 1.2.0"
11+
}

0 commit comments

Comments
 (0)