Skip to content

Commit

Permalink
Merge pull request #313 from junior/quick_fixes
Browse files Browse the repository at this point in the history
Quick fixes
  • Loading branch information
junior authored Feb 25, 2022
2 parents 8d35747 + e2a18a2 commit c64c257
Show file tree
Hide file tree
Showing 24 changed files with 130 additions and 122 deletions.
35 changes: 5 additions & 30 deletions deploy/basic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,40 +83,15 @@ This creates a `.zip` file in your working directory that can be imported in to
docker buildx build --pull --rm --load -t mushop-basic -f deploy/basic/Dockerfile .
```
Note: Building Multi-Arch and loading locally (using --load) currently is not supported by Docker. You need to build one platform at time.
* linux/amd64
```shell
docker buildx build --pull --rm --platform linux/amd64 --load -t mushop-basic -f deploy/basic/Dockerfile .
```
* linux/arm64
```shell
docker buildx build --pull --rm --platform linux/arm64 --load -t mushop-basic-arm64 -f deploy/basic/Dockerfile .
```
* linux/amd64,linux/arm64 if pushing the mushop builder to local registry:
```shell
docker buildx build --pull --rm --platform linux/amd64,linux/arm64 --push -t <registry>/mushop-basic -f deploy/basic/Dockerfile .
```
1. Run locally
* linux/amd64 (or default builder)
```shell
docker run --rm -it mushop-basic:latest
```
* linux/arm64
```shell
docker run --rm -it -p 8888:80 mushop-basic:latest
```
```shell
docker run --rm -it mushop-basic-arm64:latest
```
1. Browse to http://localhost:8888
## Deploying using local or CloudShell *Terraform* instead of ORM stack
## Deploying using local or OCI CloudShell *Terraform* instead of ORM stack
After complete the Build steps 1 and 2, generate the binaries:
Expand Down
77 changes: 42 additions & 35 deletions deploy/basic/terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion deploy/basic/terraform/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.1.1
2 changes: 1 addition & 1 deletion deploy/basic/terraform/compute.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ resource "oci_core_instance" "app_instance" {

metadata = {
ssh_authorized_keys = var.generate_public_ssh_key ? tls_private_key.compute_ssh_key.public_key_openssh : var.public_ssh_key
user_data = data.template_cloudinit_config.nodes.rendered
user_data = data.cloudinit_config.nodes.rendered
}

count = var.num_nodes
Expand Down
2 changes: 1 addition & 1 deletion deploy/basic/terraform/datasources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ data "oci_core_services" "all_services" {
}

# Cloud Init
data "template_cloudinit_config" "nodes" {
data "cloudinit_config" "nodes" {
gzip = true
base64_encode = true

Expand Down
15 changes: 10 additions & 5 deletions deploy/basic/terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@ terraform {
required_providers {
oci = {
source = "hashicorp/oci"
version = ">= 4.62.0"
# https://registry.terraform.io/providers/hashicorp/oci/4.62.0
version = ">= 4.65.0"
# https://registry.terraform.io/providers/hashicorp/oci/4.65.0
}
local = {
source = "hashicorp/local"
version = "2.1.0" # Latest version as June 2021 = 2.1.0.
version = "2.1.0" # Latest version as February 2022 = 2.1.0.
# https://registry.terraform.io/providers/hashicorp/local/2.1.0
}
random = {
source = "hashicorp/random"
version = "3.1.0" # Latest version as June 2021 = 3.1.0.
version = "3.1.0" # Latest version as February 2022 = 3.1.0.
# https://registry.terraform.io/providers/hashicorp/random/3.1.0
}
tls = {
source = "hashicorp/tls"
version = "3.1.0" # Latest version as June 2021 = 3.1.0.
version = "3.1.0" # Latest version as February 2022 = 3.1.0.
# https://registry.terraform.io/providers/hashicorp/tls/3.1.0
}
cloudinit = {
source = "hashicorp/cloudinit"
version = "2.2.0" # Latest version as February 2022 = 2.2.0.
# https://registry.terraform.io/providers/hashicorp/tls/3.1.0
}
}
Expand Down
19 changes: 9 additions & 10 deletions deploy/basic/terraform/schema.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2019-2021 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2019-2022 Oracle and/or its affiliates. All rights reserved.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#

Expand All @@ -20,10 +20,6 @@ groupings:
- tenancy_ocid
- region

- title: "General Configuration"
variables:
- num_nodes

- title: "Optional Configuration"
variables:
- autonomous_database_name
Expand All @@ -43,6 +39,7 @@ groupings:

- title: "Advanced Resource Options - Compute"
variables:
- num_nodes
- instance_shape
- instance_ocpus
- instance_shape_config_memory_in_gbs
Expand Down Expand Up @@ -115,6 +112,9 @@ variables:
description: "Choose the number of compute instances to deploy."
default: "2"
required: true
visible:
and:
- show_advanced

autonomous_database_name:
type: string
Expand Down Expand Up @@ -521,6 +521,8 @@ outputGroups:
outputs:
- lb_public_url
- lb_nip_host_url
- mushop_source_code
- mushop_version

- title: Passwords and Keys
outputs:
Expand All @@ -537,8 +539,6 @@ outputGroups:
outputs:
- dev
- comments
- mushop_source_code
- mushop_version

outputs:
lb_public_url_button:
Expand All @@ -549,8 +549,7 @@ outputs:

lb_public_url:
type: link
title: MuShop
displayText: Storefront
title: MuShop URL
visible: true

lb_nip_host_url:
Expand Down Expand Up @@ -601,4 +600,4 @@ outputs:
displayText: "The application URL will be unavailable for a few minutes after provisioning, while the application is configured"
visible: true

primaryOutputButton: ${lb_public_url}
primaryOutputButton: ${lb_public_url_button}
4 changes: 2 additions & 2 deletions deploy/basic/terraform/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ variable "generate_public_ssh_key" {
default = true
}
variable "instance_shape" {
default = "VM.Standard.E3.Flex"
default = "VM.Standard.A1.Flex"
}
variable "instance_ocpus" {
default = 1
}
variable "instance_shape_config_memory_in_gbs" {
default = 16
default = 6
}
variable "image_operating_system" {
default = "Oracle Linux"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ spec:
medium: Memory
{{- include "carts.volumes" . | nindent 8 }}
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,4 @@ spec:
medium: Memory
{{- include "orders.volumes" . | nindent 8 }}
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ spec:
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ spec:
periodSeconds: 5
volumes: {{- include "user.volumes" . | nindent 8 }}
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
6 changes: 3 additions & 3 deletions deploy/complete/helm-chart/setup/requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
dependencies:
# Prometheus
- name: prometheus
version: 15.1.3
version: 15.4.0
condition: prometheus.enabled
repository: https://prometheus-community.github.io/helm-charts
# Grafana
- name: grafana
version: 6.21.2
version: 6.22.0
condition: grafana.enabled
repository: https://grafana.github.io/helm-charts
# HPA Metrics
- name: metrics-server
version: 3.8.0
version: 3.8.2
condition: metrics-server.enabled
repository: https://kubernetes-sigs.github.io/metrics-server
# Ingress Controller
Expand Down
3 changes: 2 additions & 1 deletion deploy/complete/helm-chart/setup/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ prometheus:
static_configs:
- targets:
- {{ .Release.Name }}-ingress-nginx-controller-metrics:9913
nodeExporter:
hostRootfs: false

# https://github.com/kubernetes-sigs/service-catalog/blob/master/charts/catalog/README.md
catalog:
Expand Down
6 changes: 6 additions & 0 deletions deploy/complete/kubernetes/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# Deploy in Kubernetes

> Note: The preferable deployment option is using Helm Charts or Resource Manager Stack. The Kubernetes manifests do not perform some of the actions needed (need manual interaction), and is not updated often like the Helm Charts. Is left here for reference and to review the manifests generated by the helm charts.
## Deploy using Helm Chart

Refer to [helm-chart](../helm-chart/README.md)

---

> If you decide to deploy using the plain kubernetes manifests (Generated from the Helm Charts), follow the instructions bellow:
## Prerequisites

### Install Ingress Controller
Expand Down
Loading

0 comments on commit c64c257

Please sign in to comment.