Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback, please email oracle-forums_moderators_us@oracle.com

OCI terraform provider not working

User_LJTCLOct 9 2021

I have created K8 cluster using OCI terraform providers ( datablazeOKI ) . it was created successfully but when I am creating a pod and installing a tomcat image in it. It giving this error: │ Error: Post "http://localhost/api/v1/namespaces/default/services": dial tcp [::1]:80: connectex: No connection could be made because the target machine actively refused it

However if create it using YAML file it works.
my prvider.tf is as :
provider "oci" {
cluster_id = "ocid1.cluster.oc1.."
tenancy_ocid = "ocid1.tenancy.oc1..aa.."
user_ocid = "ocid1.user.oc1..aa.."
private_key_path = "....\\databl-09-19-16-50.pem"
fingerprint = "xyyyyz..8"
region = "us-ashburn-1"
}

and deployment terraform script:
resource "kubernetes_service" "datablazefront" {
metadata {
name = "datablazefront"
}
spec {
selector = {
app = "datablaze"
}
session_affinity = "ClientIP"
port {
port = 8080
target_port = 80
}

type = "LoadBalancer"
}
}

resource "kubernetes_pod" "tomcatpod" {
metadata {
name = "tomcatpod"
labels = {
app = "datablaze"
}
}

spec {
container {
image = "us-ashburn-1.ocir.io/idoevyl860om/repo1/tomcat-image:test01"
name = "datablazefront"
}
}
}

pls suggest ASAP what is missing ?

Comments
Post Details
Added on Oct 9 2021
0 comments
330 views