Skip to content

Commit c183eb1

Browse files
authored
Helm install via yum (#224)
* Helm install via yum from olcne repo Signed-off-by: Karthic Ravindran <[email protected]> * doc changes for kubernetes version Signed-off-by: Karthic Ravindran <[email protected]> * Update variables.tf Removed helm_version variable. * base version changed to 1.3.3,helm variables removed Signed-off-by: Karthic Ravindran <[email protected]>
1 parent 26ef0cc commit c183eb1

File tree

10 files changed

+17
-103
lines changed

10 files changed

+17
-103
lines changed

docs/configuration.adoc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
:uri-changelog: {uri-rel-file-base}/CHANGELOG.adoc
1717
:uri-contribute: {uri-rel-file-base}/CONTRIBUTING.adoc
1818
:uri-contributors: {uri-rel-file-base}/CONTRIBUTORS.adoc
19-
:uri-helm: https://helm.sh/
2019
:uri-instructions: {uri-docs}/instructions.adoc
2120
:uri-license: {uri-rel-file-base}/LICENSE.txt
2221
:uri-kubernetes: https://kubernetes.io/
@@ -56,7 +55,6 @@
5655
. link:#configure-oke-node-pool-parameters[Configure OKE Node Pool parameters]
5756
. link:#configure-oke-load-balancer-parameters[Configure OKE Load Balancer parameters]
5857
. link:#configure-ocir-parameters[Configure OCIR parameters]
59-
. link:#configure-helm-parameters[Configure helm parameters]
6058
. link:#configure-calico-parameters[Configure Calico parameters]
6159
. link:#configure-kubernetes-metrics-server-parameters[Configure Kubernetes Metrics Server parameters]
6260
. link:#configure-kms-integration-parameters[Configure KMS Integration parameters]
@@ -159,7 +157,7 @@ The OKE parameters concern mainly the following:
159157

160158
* whether you want to deploy public or private worker nodes
161159
* whether you want to allow NodePort or ssh access to the worker nodes
162-
* Kubernetes options such as dashboard, networking and helm
160+
* Kubernetes options such as dashboard, networking
163161
* number of node pools and their respective size of the cluster
164162
* services and pods cidr blocks
165163

@@ -215,12 +213,6 @@ kubectl --namespace=kube-system get secret ocirsecret --export -o yaml | kubectl
215213

216214
{uri-terraform-options}#ocir[Reference]
217215

218-
=== Configure helm parameters
219-
220-
The {uri-helm}[helm] parameters control the installation and the version of the helm client as well as optional helm repos to add and initialize on the bastion host.
221-
222-
{uri-terraform-options}#helm[Reference]
223-
224216
=== Configure Calico parameters
225217

226218
The calico parameters control the installation of {uri-calico}[Calico] for {uri-calico-policy}[network policy].

docs/instructions.adoc

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
:uri-terraform-oke-sample: https://github.com/terraform-providers/terraform-provider-oci/tree/master/examples/container_engine
4747
:uri-terraform-options: {uri-docs}/terraformoptions.adoc
4848
:uri-install-kubectl: https://kubernetes.io/docs/tasks/tools/install-kubectl/
49-
:uri-helm: https://helm.sh/
5049
:uri-metricserver: https://kubernetes.io/docs/tasks/debug-application-cluster/resource-metrics-pipeline/#metrics-server
5150
:uri-k8s-dashboard: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/
5251
:uri-psp: https://docs.cloud.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengusingpspswithoke.htm#Using_Pod_Security_Polices_with_Container_Engine_for_Kubernetes
@@ -64,7 +63,6 @@
6463
.. link:#recommendations-for-using-instance_principal[Recommendations for using instance_principal]
6564
. link:#interacting-with-the-oke-cluster[Interacting with the OKE Cluster locally]
6665
. link:#creating-a-secret-for-ocir[Creating a Secret for OCIR]
67-
. link:#installing-helm[Installing helm]
6866
. link:#installing-calico[Installing Calico]
6967
. link:#installing-kubernetes-metrics-server[Installing Kubernetes Metrics Server]
7068
. link:#scaling-the-number-of-node-pools[Scaling the number of node pools]
@@ -168,7 +166,7 @@ You can then copy the ssh_to_operator command, paste and run it in a terminal.
168166

169167
Any user who has access to the instance (who can SSH to the instance), automatically inherits the privileges granted to the instance. Before you enable this feature, ensure that you know who can access it, and that they should be authorized with the permissions you are granting to the instance.
170168

171-
By default, this feature is *_disabled_*. However, it is *_required_* at the time of cluster creation *_if_* you wish to enable link:#kms-integration[KMS Integration], calico, metricserver, helm or creating the OCIR secret.
169+
By default, this feature is *_disabled_*. However, it is *_required_* at the time of cluster creation *_if_* you wish to enable link:#kms-integration[KMS Integration], calico, metricserver or creating the OCIR secret.
172170

173171
When you enable this feature, by default, the operator host will have privileges to all resources in the compartment. If you are enabling it for link:#kms-integration[KMS Integration], the operator host will also have rights to create policies in the root tenancy.
174172

@@ -205,7 +203,7 @@ terraform apply
205203
==== Recommendations for using instance_principal
206204

207205
. Do not enable instance_principal if you are not using link:#kms-integration[KMS Integration] or calico
208-
. Enable instance_principal *_if and only if_* you are using link:#kms-integration[KMS Integration], calico, metricserver, helm or creating the OCIR secret.
206+
. Enable instance_principal *_if and only if_* you are using link:#kms-integration[KMS Integration], calico, metricserver or creating the OCIR secret.
209207
. Disable instance_principal once the cluster is created
210208

211209
=== Interacting with the OKE Cluster
@@ -241,12 +239,6 @@ You must then {uri-oci-secret}[create a Secret in OCI Vault to store] the value
241239

242240
Finally, assign the Secret OCID to *secret_id* in terraform.tfvars. Refer to {uri-terraform-options}#ocir[OCIR parameters] for other parameters to be set.
243241

244-
=== Installing helm
245-
246-
{uri-helm}[Helm] is a package manager for kubernetes. If you want to install helm on the operator host, set the parameter *helm_enabled = true* in terraform.tfvars. By default, it is set to false.
247-
248-
An alias "*h*" will be created for helm on the operator host. For other available parameters, refer to {uri-terraform-options}#helm[Helm parameters].
249-
250242
=== Installing Calico
251243

252244
Calico enables network policy in Kubernetes clusters. To install calico set the parameter *calico_enabled = true* in terraform.tfvars. By default its set to false. Refer to {uri-terraform-options}#calico[Calico parameters] for other available parameters.

docs/terraformoptions.adoc

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
:uri-calico-policy: https://docs.projectcalico.org/v3.8/getting-started/kubernetes/installation/other
1212
:uri-cert-manager: https://cert-manager.readthedocs.io/en/latest/
1313
:uri-docs: {uri-rel-file-base}/docs
14-
:uri-helm: https://helm.sh/
1514
:uri-kubernetes-hpa: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
1615
:uri-metrics-server: https://github.com/kubernetes-incubator/metrics-server
1716
:uri-oci-images: https://docs.cloud.oracle.com/iaas/images/
@@ -34,7 +33,6 @@ Configuration Terraform Options:
3433
. link:#oke[OKE]
3534
. link:#oke-load-balancers[OKE Load Balancers]
3635
. link:#ocir[OCIR]
37-
. link:#helm[Helm]
3836
. link:#calico[Calico]
3937
. link:#kubernetes-metrics-server[Kubernetes Metrics Server]
4038
. link:#kms-integration[KMS integration]
@@ -452,8 +450,8 @@ admission_controller_options = {
452450

453451
|`kubernetes_version`
454452
|The version of Kubernetes to provision. This is based on the available versions in OKE. By default, the latest version is selected. The use of 'LATEST' is no longer permitted in order to facilitate upgrades.
455-
|v1.14.8,v1.15.7, v1.16.8
456-
|v1.16.8
453+
|v1.15.7, v1.16.8 ,v1.17.9
454+
|v1.17.9
457455

458456
|`node_pools`
459457
a|The number, shape of node pools and node_pool_size to create. Each key and tuple pair corresponds to 1 node pool.
@@ -612,27 +610,6 @@ Refer to {uri-topology}[topology] for more thorough examples.
612610

613611
|===
614612

615-
== Helm
616-
617-
[stripes=odd,cols="1d,4d,3a,3a", options=header,width="100%"]
618-
|===
619-
|Parameter
620-
|Description
621-
|Values
622-
|Default
623-
624-
|`helm_version`
625-
|The version of the {uri-helm}[helm] client to install on the bastion.
626-
|
627-
|3.2.4
628-
629-
|`helm_enabled`
630-
|Whether to install {uri-helm}[helm] on the bastion instance.
631-
|true/false
632-
|false
633-
634-
|===
635-
636613
== Calico
637614

638615
[stripes=odd,cols="1d,4d,3a,3a", options=header,width="100%"]

locals.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,6 @@ locals {
128128
secret_id = var.secret_id
129129
}
130130

131-
helm = {
132-
helm_enabled = var.helm_enabled
133-
helm_version = var.helm_version
134-
}
135-
136131
calico = {
137132
calico_enabled = var.calico_enabled
138133
calico_version = var.calico_version

main.tf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terraform {
77

88
module "base" {
99
source = "oracle-terraform-modules/base/oci"
10-
version = "1.3.2"
10+
version = "1.3.3"
1111

1212
# general oci parameters
1313
oci_base_general = local.oci_base_general
@@ -106,9 +106,6 @@ module "oke" {
106106
# ocir parameters
107107
oke_ocir = local.oke_ocir
108108

109-
# helm parameters
110-
helm = local.helm
111-
112109
# calico parameters
113110
calico = local.calico
114111

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
11
# Copyright 2017, 2019, Oracle Corporation and/or affiliates. All rights reserved.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

4-
data "template_file" "helm_enabled" {
4+
data "template_file" "install_helm" {
55
template = file("${path.module}/scripts/install_helm.template.sh")
66

7-
vars = {
8-
helm_version = var.helm.helm_version
9-
}
10-
11-
count = var.oke_operator.operator_enabled == true && var.helm.helm_enabled == true ? 1 : 0
7+
count = var.oke_operator.operator_enabled == true ? 1 : 0
128
}
139

1410
resource null_resource "install_helm_operator" {
@@ -24,20 +20,20 @@ resource null_resource "install_helm_operator" {
2420
bastion_private_key = file(var.oke_ssh_keys.ssh_private_key_path)
2521
}
2622

27-
depends_on = [null_resource.install_kubectl_operator, null_resource.write_kubeconfig_on_operator]
23+
depends_on = [null_resource.install_kubectl_operator]
2824

2925
provisioner "file" {
30-
content = data.template_file.helm_enabled[0].rendered
31-
destination = "~/helm_enabled.sh"
26+
content = data.template_file.install_helm[0].rendered
27+
destination = "~/install_helm.sh"
3228
}
3329

3430
provisioner "remote-exec" {
3531
inline = [
36-
"chmod +x $HOME/helm_enabled.sh",
37-
"bash $HOME/helm_enabled.sh",
38-
"rm -f $HOME/helm_enabled.sh"
32+
"chmod +x $HOME/install_helm.sh",
33+
"bash $HOME/install_helm.sh",
34+
"rm -f $HOME/install_helm.sh"
3935
]
4036
}
4137

42-
count = var.oke_operator.bastion_enabled == true && var.oke_operator.operator_enabled == true && var.helm.helm_enabled == true ? 1 : 0
38+
count = var.oke_operator.bastion_enabled == true && var.oke_operator.operator_enabled == true ? 1 : 0
4339
}

modules/oke/scripts/install_helm.template.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,7 @@
22
# Copyright 2017, 2019, Oracle Corporation and/or affiliates. All rights reserved.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
44

5-
wget https://get.helm.sh/helm-v${helm_version}-linux-amd64.tar.gz
6-
7-
tar zxvf helm-v${helm_version}-linux-amd64.tar.gz
8-
9-
sudo mv linux-amd64/helm /usr/local/bin
10-
11-
rm -f helm-v${helm_version}-linux-amd64.tar.gz
12-
13-
rm -rf linux-amd64
5+
sudo yum install -y helm
146

157
helm repo add stable https://kubernetes-charts.storage.googleapis.com
168
helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com

modules/oke/variables.tf

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,6 @@ variable "oke_ocir" {
8181
})
8282
}
8383

84-
85-
# helm
86-
variable "helm" {
87-
type = object({
88-
helm_enabled = bool
89-
helm_version = string
90-
})
91-
}
92-
9384
# calico
9485
variable "calico" {
9586
type = object({

terraform.tfvars.example

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ check_node_active = "none"
130130

131131
dashboard_enabled = false
132132

133-
kubernetes_version = "v1.16.8"
133+
kubernetes_version = "v1.17.9"
134134

135135
node_pools = {
136136
np1 = {shape="VM.Standard.E3.Flex",ocpus=2,node_pool_size=2,boot_volume_size=150}
@@ -176,11 +176,6 @@ tenancy_name = ""
176176

177177
username = ""
178178

179-
# helm
180-
helm_enabled = false
181-
182-
helm_version = "3.1.0"
183-
184179
# calico
185180
calico_enabled = false
186181

variables.tf

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -426,19 +426,6 @@ variable "username" {
426426
type = string
427427
}
428428

429-
# helm
430-
variable "helm_enabled" {
431-
description = "Whether to install helm client on the bastion."
432-
default = false
433-
type = bool
434-
}
435-
436-
variable "helm_version" {
437-
default = "3.2.4"
438-
description = "The version of helm to install."
439-
type = string
440-
}
441-
442429
# calico
443430
variable "calico_enabled" {
444431
description = "whether to install calico for network pod security policy"

0 commit comments

Comments
 (0)