Install Dashboard on Cluster
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
Verify the deployment
kubectl -n kubernetes-dashboard get pods
Proxy Cluster
kubectl proxy
#!/bin/bash | |
# in order to run, first install jq with: sudo apt-get install jq | |
oci() { docker run --rm --mount type=bind,source=$HOME/.oci,target=/root/.oci stephenpearson/oci-cli:latest "$@"; } | |
# set global variable OKE_COMPARTMENT_ID with the OCID for the compartment with name passed in $1 | |
set_oke_compartment() | |
{ | |
echo set_oke_compartments for $1 | |
compartments=$(oci iam compartment list --compartment-id $ROOT_COMPARTMENT_ID --all) | |
# echo "Compartments: $compartments" |
Export the OCID of the root compartment: | |
export ROOT_COMPARTMENT_ID=ocid1.tenancy.oc1..aaaaaaaaot | |
Create a new OKE policy in the root compartment of your tenancy: | |
oci iam policy create --name oke-service --compartment-id $ROOT_COMPARTMENT_ID --statements '[ "allow service OKE to manage all-resources in tenancy"]' --description 'policy for granting rights on OKE to manage cluster resources' | |
List all policies, to verify the success of the creation: | |
oci iam policy list --compartment-id $ROOT_COMPARTMENT_ID --all | |
Now create a special compartment for all OKE resources |
# a global variable | |
WELCOME_ROOT=Hello | |
# invoke this function with two arguments: | |
# 1. (FROM_VAR) the name of the greeter | |
# 2. (TO_VAR) the name of the greetee | |
# this function returns a welcoming message | |
get_welcoming_message() | |
{ | |
FROM_VAR=$1 |
const debug = function (debugBuffer, msg) { | |
// using the full UTC string is a bit heavy handed perhaps; only minutes, seconds and ms would be quite enough, or just the timestamp in ms | |
debugBuffer.push(`${new Date().toUTCString()} ${msg}`) | |
} | |
const spillDebugBeans = function (debugBuffer) { | |
debugBuffer.forEach(msg => { console.log(`DEBUG: ${msg}`) }); | |
}// spillDebugBeans | |
const calculateSums = async function (sums) { |
const debugBuffer = [] | |
const savepoints = {} | |
const debug = function (msg) { | |
// using the full UTC string is a bit heavy handed perhaps; only minutes, seconds and ms would be quite enough, or just the timestamp in ms | |
debugBuffer.push(`${new Date().toUTCString()} ${msg}`) | |
} | |
const setSavepoint = function (savepoint) { | |
savepoints[savepoint] = debugBuffer.length |
### Repository in the Container Image Registry for the container images underpinning the function | |
resource "oci_artifacts_container_repository" "container_repository_for_function" { | |
# note: repository = store for all images versions of a specific container image - so it included the function name | |
compartment_id = var.compartment_ocid | |
display_name = "${local.ocir_repo_name}/${var.function_name}" | |
is_immutable = false | |
is_public = false | |
} | |
resource "null_resource" "Login2OCIR" { |
terraform { | |
required_version = ">= 0.14" | |
} | |
provider oci { | |
region = var.region | |
} | |
variable tenancy_ocid {default = "the ocid of your tenancy"} | |
variable region {default = "the region in which you want to query"} |
variable "application_name" { default = "cloudnative-2021App"} | |
data "oci_functions_applications" "function_applications" { | |
compartment_id = var.compartment_id | |
display_name = "${var.application_name}" | |
} | |
data "oci_functions_functions" "application_functions" { | |
application_id = data.oci_functions_applications.function_applications.applications[0].id | |
} |
package main | |
import ( | |
"context" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" | |
"os" |