Skip to content

Commit b16ecd5

Browse files
authored
CLIP-1587: Fix the Invalid apiVersion problem (#240)
* CLIP-1587: Changed client.authentication.k8s.io/v1alpha1 to client.authentication.k8s.io/v1beta1 * CLIP-1587: Updated the prequisites documentation. * CLIP-1587: Upgraded kubectl version to 1.24.0 * CLIP-1587: replaced apiVersion in context file used by e2e tests. * Updated the changelog * CLIP-1587: fixed the nfs connectivity test for bitbucket. * CLIP-1590: Upgraded helm chart versions to 1.4.0 (#239) Co-authored-by: nghazalibeiklar <nghazalibeiklar@atlassian.com> Co-authored-by: nghazalibeiklar <nghazalibeiklar@atlassian.com>
1 parent 0bd5b5f commit b16ecd5

File tree

10 files changed

+30
-27
lines changed

10 files changed

+30
-27
lines changed

.github/workflows/e2e-test-no-domain.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Pin Kubectl version
3232
uses: azure/setup-kubectl@v2.0
3333
with:
34-
version: 'v1.23.6'
34+
version: 'v1.24.0'
3535

3636
- name: Setup Go environment
3737
uses: actions/setup-go@v2.1.4

.github/workflows/e2e-test-with-domain.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Pin Kubectl version
3232
uses: azure/setup-kubectl@v2.0
3333
with:
34-
version: 'v1.23.6'
34+
version: 'v1.24.0'
3535

3636
- name: Setup Go environment
3737
uses: actions/setup-go@v2.1.4

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 2.0.2
4+
5+
**Release date:** 2022-06-30
6+
7+
* Upgraded Helm chart version to 1.4.0
8+
* Using v1beta1 apiVersion for client.authentication.k8s.io
9+
10+
311
## 2.0.1
412

513
**Release date:** 2022-05-18

config.tfvars

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ max_cluster_capacity = 5
4646
################################################################################
4747

4848
# Helm chart version of Jira
49-
jira_helm_chart_version = "1.3.0"
49+
jira_helm_chart_version = "1.4.0"
5050

5151
# Number of Jira application nodes
5252
# Note: For initial installation this value needs to be set to 1 and it can be changed only after Jira is fully
@@ -125,7 +125,7 @@ jira_db_name = "jira"
125125
################################################################################
126126

127127
# Helm chart version of Confluence
128-
confluence_helm_chart_version = "1.3.0"
128+
confluence_helm_chart_version = "1.4.0"
129129

130130
# Number of Confluence application nodes
131131
# Note: For initial installation this value needs to be set to 1 and it can be changed only after Confluence is fully
@@ -205,7 +205,7 @@ confluence_collaborative_editing_enabled = true
205205
################################################################################
206206

207207
# Helm chart version of Bitbucket
208-
bitbucket_helm_chart_version = "1.3.0"
208+
bitbucket_helm_chart_version = "1.4.0"
209209

210210
# Number of Bitbucket application nodes
211211
bitbucket_replica_count = 1
@@ -304,8 +304,8 @@ bitbucket_db_name = "bitbucket"
304304
################################################################################
305305

306306
# Helm chart version of Bamboo and Bamboo agent instances
307-
bamboo_helm_chart_version = "1.3.0"
308-
bamboo_agent_helm_chart_version = "1.3.0"
307+
bamboo_helm_chart_version = "1.4.0"
308+
bamboo_agent_helm_chart_version = "1.4.0"
309309

310310
# By default, Bamboo and the Bamboo Agent will use the versions defined in their respective Helm charts:
311311
# https://github.com/atlassian/data-center-helm-charts/blob/main/src/main/charts/bamboo/Chart.yaml

docs/docs/userguide/PREREQUISITES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Its advised that the tooling below is installed to your development environment.
88

99
1. [Terraform](#terraform)
1010
2. [Helm v3.3 or later](#helm)
11-
3. [AWS CLI](#aws-cli)
11+
3. [AWS CLI v2.7 or later](#aws-cli)
1212
4. [Kubectl](#kubectl) (optional)
1313
5. [Kubernetes cluster monitoring tools](#kubernetes-cluster-monitoring-tools) (optional)
1414

install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ set_current_context_k8s() {
223223
if [ -z "${FORCE_FLAG}" ]; then
224224
aws --region "${REGION}" eks update-kubeconfig --name "${EKS_CLUSTER}"
225225
fi
226+
# e2e test uses context file to connect to k8s and since aws-iam-authenticator 0.5.5 is using v1beta1 api version
227+
# for authentication, then we need to switch to v1beta1
228+
sed 's/client.authentication.k8s.io\/v1alpha1/client.authentication.k8s.io\/v1beta1/g' "${CONTEXT_FILE}" > tmp && mv tmp "${CONTEXT_FILE}"
226229
else
227230
log "Kubernetes context file '${CONTEXT_FILE}' could not be found."
228231
fi

providers.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ provider "kubernetes" {
1212
host = module.base-infrastructure.eks.kubernetes_provider_config.host
1313
cluster_ca_certificate = module.base-infrastructure.eks.kubernetes_provider_config.cluster_ca_certificate
1414
exec {
15-
api_version = "client.authentication.k8s.io/v1alpha1"
15+
api_version = "client.authentication.k8s.io/v1beta1"
1616
args = ["eks", "get-token", "--cluster-name", local.cluster_name]
1717
command = "aws"
1818
}
@@ -23,7 +23,7 @@ provider "helm" {
2323
host = module.base-infrastructure.eks.kubernetes_provider_config.host
2424
cluster_ca_certificate = module.base-infrastructure.eks.kubernetes_provider_config.cluster_ca_certificate
2525
exec {
26-
api_version = "client.authentication.k8s.io/v1alpha1"
26+
api_version = "client.authentication.k8s.io/v1beta1"
2727
args = ["eks", "get-token", "--cluster-name", local.cluster_name]
2828
command = "aws"
2929
}

test/e2etest/bitbucket_test.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"strings"
1111
"testing"
1212

13-
"github.com/go-git/go-git/v5"
13+
"github.com/go-git/go-git/v5"
1414
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
1515
"github.com/gruntwork-io/terratest/modules/k8s"
1616
"github.com/stretchr/testify/assert"
@@ -44,11 +44,7 @@ func assertBitbucketNfsConnectivity(t *testing.T, testConfig TestConfig) {
4444
"-c", "echo \"Greetings from an NFS\" >> $(find /srv/nfs/ | head -1)/nfs-file-share-test.txt; echo $?")
4545

4646
assert.Nil(t, kubectlError)
47-
// Due to the deprecation of v1alpha1, there will be an extra line added to kubectl output:
48-
// Kubeconfig user entry is using deprecated API version client.authentication.k8s.io/v1alpha1. Run 'aws eks update-kubeconfig' to update.\n0
49-
outputSlice := strings.Split(output, "\n")
50-
returnCode := outputSlice[1]
51-
assert.Equal(t, "0", returnCode)
47+
assert.Equal(t, "0", output)
5248

5349
// Read the file from the Bitbucket pod
5450
output, kubectlError = k8s.RunKubectlAndGetOutputE(t, kubectlOptions,
@@ -58,11 +54,7 @@ func assertBitbucketNfsConnectivity(t *testing.T, testConfig TestConfig) {
5854
"-c", "cat /var/atlassian/application-data/shared-home/nfs-file-share-test.txt")
5955

6056
assert.Nil(t, kubectlError)
61-
// Due to the deprecation of v1alpha1, there will be an extra line added to kubectl output:
62-
// Kubeconfig user entry is using deprecated API version client.authentication.k8s.io/v1alpha1. Run 'aws eks update-kubeconfig' to update.\nGreetings from an NFS
63-
outputSlice = strings.Split(output, "\n")
64-
fileContents := outputSlice[1]
65-
assert.Equal(t, "Greetings from an NFS", fileContents)
57+
assert.Equal(t, "Greetings from an NFS", output)
6658
}
6759

6860
func assertBitbucketSshConnectivity(t *testing.T, testConfig TestConfig, productUrl string) {

test/unittest/test_variables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ var BitbucketInvalidVariables = map[string]interface{}{
271271
"replica_count": 1,
272272
"installation_timeout": invalidTestTimeout,
273273
"bitbucket_configuration": map[string]interface{}{
274-
"helm_version": "1.3.0",
274+
"helm_version": "1.4.0",
275275
"cpu": "1",
276276
"mem": "1Gi",
277277
"min_heap": "256m",

variables.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ variable "logging_bucket" {
108108
variable "jira_helm_chart_version" {
109109
description = "Version of Jira Helm chart"
110110
type = string
111-
default = "1.3.0"
111+
default = "1.4.0"
112112
}
113113

114114
variable "jira_image_repository" {
@@ -293,7 +293,7 @@ variable "confluence_license" {
293293
variable "confluence_helm_chart_version" {
294294
description = "Version of confluence Helm chart"
295295
type = string
296-
default = "1.3.0"
296+
default = "1.4.0"
297297
}
298298

299299
variable "confluence_version_tag" {
@@ -457,7 +457,7 @@ variable "confluence_shared_home_snapshot_id" {
457457
variable "bitbucket_helm_chart_version" {
458458
description = "Version of Bitbucket Helm chart"
459459
type = string
460-
default = "1.3.0"
460+
default = "1.4.0"
461461
}
462462

463463
variable "bitbucket_version_tag" {
@@ -726,14 +726,14 @@ variable "number_of_bamboo_agents" {
726726

727727
variable "bamboo_helm_chart_version" {
728728
description = "Version of Bamboo Helm chart"
729-
default = "1.3.0"
729+
default = "1.4.0"
730730
type = string
731731
}
732732

733733
variable "bamboo_agent_helm_chart_version" {
734734
description = "Version of Bamboo agent Helm chart"
735735
type = string
736-
default = "1.3.0"
736+
default = "1.4.0"
737737
}
738738

739739
variable "bamboo_version_tag" {

0 commit comments

Comments
 (0)