Skip to content

Commit 5d1238f

Browse files
authored
Merge pull request #4 from junior/101_update
101 update
2 parents 9ebf8b4 + 9fcbf2a commit 5d1238f

18 files changed

+1070
-39
lines changed

.github/workflows/stack.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
3+
#
4+
5+
# Creates and Publishes the Oracle Resource Manager stack
6+
7+
name: Generate stacks and publish release
8+
9+
on:
10+
push:
11+
branches: [ main ]
12+
paths: ['terraform/VERSION']
13+
14+
jobs:
15+
16+
publish_stack:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Create stacks
23+
id: create_stacks
24+
run: |
25+
#
26+
STACKNAME=${{ github.event.repository.name }}
27+
FOLDER=terraform/
28+
RELEASE=$(cat terraform/VERSION)
29+
ASSETS+="${STACKNAME}-stack.zip ${STACKNAME}-${RELEASE}.zip "
30+
echo "::group::Processing $STACKNAME"
31+
zip -r ${STACKNAME}-stack.zip $FOLDER || { printf '\n⛔ Unable to create %s stack.\n'; exit 1; }
32+
cp ${STACKNAME}-stack.zip ${STACKNAME}-${RELEASE}.zip || { printf '\n⛔ Unable to create %s stack.\n'; exit 1; }
33+
echo "::endgroup::"
34+
echo "::set-output name=assets::$ASSETS"
35+
echo "::set-output name=release::$RELEASE"
36+
echo "::set-output name=prefix::$STACKNAME"
37+
38+
- name: Prepare Release Notes
39+
run: |
40+
#
41+
printf '%s\n' '${{ steps.create_stacks.outputs.prefix }} Stack - v${{ steps.create_stacks.outputs.release }}' >release.md
42+
printf '%s\n' '' '## [![Deploy to Oracle Cloud][magic_button]][magic_stack]' >>release.md
43+
printf '%s\n' '' '' >>release.md
44+
printf '%s\n' '' '[magic_button]: https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg' >>release.md
45+
printf '%s\n' '' '[magic_stack]: https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/${{ github.repository }}/releases/download/${{ steps.create_stacks.outputs.release }}/${{ steps.create_stacks.outputs.prefix }}-${{ steps.create_stacks.outputs.release }}.zip' >>release.md
46+
47+
- name: Create Release
48+
run: gh release create ${{ steps.create_stacks.outputs.release }} --generate-notes -F release.md ${{ steps.create_stacks.outputs.assets }}
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
**/.DS_Store
44
*.tgz
55
*.zip
6+
.vscode/
67

78
# Terraform ###
89
## Local .terraform directories

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ![Sysdig Logo](./images/sysdig-logo-white-text.svg#gh-light-mode-only)![Sysdig Logo - Dark Mode](./images/sysdig-logo.svg#gh-dark-mode-only) [![Deploy to Oracle Cloud][magic_button]][magic_sysdig_stack]
1+
# ![Sysdig Logo](./images/sysdig-logo.svg#gh-light-mode-only)![Sysdig Logo - Dark Mode](./images/sysdig-logo-white-text.svg#gh-dark-mode-only) [![Deploy to Oracle Cloud][magic_button]][magic_sysdig_stack]
22

33
Terraform module that deploys the Sysdig Secure Agents in Oracle Kubernetes Engine (OKE) Cluster.
44

images/sysdig-icon.svg

Lines changed: 6 additions & 0 deletions
Loading

terraform/.terraform.lock.hcl

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

terraform/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.0
1+
1.0.1

terraform/oke-autoscaler.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55
locals {
6-
cluster_autoscaler_supported_k8s_versions = { "1.18" = "1.18.3-4", "1.19" = "1.19.1-8", "1.20" = "1.20.0-6", "1.21" = "1.21.1-3" } # There's no API to get that list. Need to be updated manually
6+
cluster_autoscaler_supported_k8s_versions = { "1.18" = "1.18.3-4", "1.19" = "1.19.1-8", "1.20" = "1.20.0-6", "1.21" = "1.21.1-3", "1.22" = "1.22.2-4" } # There's no API to get that list. Need to be updated manually
77
cluster_autoscaler_image_version = lookup(local.cluster_autoscaler_supported_k8s_versions, local.k8s_major_minor_version, reverse(values(local.cluster_autoscaler_supported_k8s_versions))[0])
88
cluster_autoscaler_image_region = "iad" # Available regions: iad, phx, fra, lhr
99
cluster_autoscaler_image = "${local.cluster_autoscaler_image_region}.ocir.io/oracle/oci-cluster-autoscaler:${local.cluster_autoscaler_image_version}"

terraform/oke-datasources.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ data "oci_containerengine_cluster_option" "oke" {
1818
data "oci_containerengine_node_pool_option" "oke" {
1919
node_pool_option_id = "all"
2020
}
21+
data "oci_containerengine_clusters" "oke" {
22+
compartment_id = local.oke_compartment_ocid
23+
}
2124

2225
# Gets a list of Availability Domains
2326
data "oci_identity_availability_domains" "ADs" {

terraform/oke-outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ output "comments" {
77
}
88

99
output "deployed_oke_kubernetes_version" {
10-
value = (var.k8s_version == "Latest") ? local.cluster_k8s_latest_version : var.k8s_version
10+
value = local.deployed_k8s_version
1111
}
1212
output "kubeconfig_for_kubectl" {
1313
value = "export KUBECONFIG=./generated/kubeconfig"

terraform/oke-variables.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ variable "existent_oke_cluster_id" {
1616
default = ""
1717
description = "Using existent OKE Cluster. Only the application and services will be provisioned. If select cluster autoscaler feature, you need to get the node pool id and enter when required"
1818
}
19+
variable "existent_oke_cluster_compartment_ocid" {
20+
default = ""
21+
description = "Existent OKE Cluster Compartment"
22+
}
1923
variable "create_new_compartment_for_oke" {
2024
default = false
2125
description = "Creates new compartment for OKE Nodes and OCI Services deployed. NOTE: The creation of the compartment increases the deployment time by at least 3 minutes, and can increase by 15 minutes when destroying"

0 commit comments

Comments
 (0)