Skip to content

Commit b1d4916

Browse files
authored
Merge pull request #205 from adamrushuk/develop
v1.6.0 release
2 parents 150450e + 32672d5 commit b1d4916

25 files changed

+1133
-687
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ RUN if [ "${INSTALL_AZURE_CLI}" = "true" ]; then bash /tmp/library-scripts/azcli
4545

4646
# Install Terraform, tflint, Go, PowerShell, and other useful tools
4747
# TODO: move this into main "RUN" layer above
48-
ARG TERRAFORM_VERSION=0.14.9
49-
ARG TFLINT_VERSION=0.18.0
48+
ARG TERRAFORM_VERSION=1.0.0
49+
ARG TFLINT_VERSION=0.29.0
5050
RUN bash /tmp/library-scripts/terraform-debian.sh "${TERRAFORM_VERSION}" "${TFLINT_VERSION}" \
5151
&& bash /tmp/library-scripts/powershell-debian.sh \
5252
&& bash /tmp/library-scripts/kubectl-helm-debian.sh \

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"build": {
66
"dockerfile": "Dockerfile",
77
"args": {
8-
"TERRAFORM_VERSION": "0.14.9",
9-
"TFLINT_VERSION": "0.22.0",
8+
"TERRAFORM_VERSION": "1.0.0",
9+
"TFLINT_VERSION": "0.29.0",
1010
"INSTALL_AZURE_CLI": "true",
1111
"INSTALL_DOCKER": "true",
1212
"INSTALL_NODE": "true"

.github/workflows/build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# build - github workflow
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3+
14
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
25
name: build
36

@@ -58,12 +61,12 @@ env:
5861
TF_INPUT: "false"
5962
TF_PLAN: "tfplan"
6063
# https://github.com/hashicorp/terraform/releases
61-
TF_VERSION: "0.14.9"
64+
TF_VERSION: "1.0.3"
6265
TF_WORKING_DIR: ./terraform
6366
# https://github.com/terraform-linters/tflint-ruleset-azurerm/releases
64-
TFLINT_RULESET_AZURERM_VERSION: "v0.9.0"
67+
TFLINT_RULESET_AZURERM_VERSION: "v0.11.0"
6568
# https://github.com/terraform-linters/tflint/releases
66-
TFLINT_VERSION: "v0.25.0"
69+
TFLINT_VERSION: "v0.30.0"
6770

6871
# Env var concatenation is currently not supported at Workflow or Job scope. See workaround below:
6972
# https://github.community/t5/GitHub-Actions/How-can-we-concatenate-multiple-env-vars-at-workflow-and-job/td-p/48489
@@ -190,9 +193,11 @@ jobs:
190193
run: ./scripts/push_docker_images.sh
191194

192195
# TODO: Remove once issue has been fixed
193-
# https://github.com/terraform-providers/terraform-provider-azurerm/issues/8546
194-
- name: Restart Function App
195-
run: az functionapp restart --name "${{ env.PREFIX }}-funcapp" --resource-group "${{ env.PREFIX }}-rg-function-app"
196+
- name: Fix Function App version
197+
run: pwsh -command "./scripts/Fix-FunctionApp.ps1"
198+
env:
199+
FUNCTION_APP_NAME: "${{ env.PREFIX }}-funcapp"
200+
FUNCTION_APP_RG: "${{ env.PREFIX }}-rg-function-app"
196201

197202
# Pester tests
198203
- name: 🧪 Run Pester tests

.github/workflows/destroy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# destroy - github workflow
2+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
3+
14
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions
25
name: destroy
36

@@ -52,7 +55,7 @@ env:
5255
TF_LOG_PATH: terraform.log
5356
TF_LOG: TRACE
5457
# https://github.com/hashicorp/terraform/releases
55-
TF_VERSION: "0.14.9"
58+
TF_VERSION: "1.0.3"
5659
TF_WORKING_DIR: terraform
5760

5861
# Env var concatenation is currently not supported at Workflow or Job scope. See workaround below:

.vscode/launch.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2-
"version": "0.2.0",
32
"configurations": [
4-
{
5-
"name": "Attach to PowerShell Functions",
6-
"type": "PowerShell",
7-
"request": "attach",
8-
"customPipeName": "AzureFunctionsPSWorker",
9-
"runspaceId": 1,
10-
"preLaunchTask": "func: host start"
11-
}
3+
{
4+
"name": "PowerShell Launch Current File",
5+
"type": "PowerShell",
6+
"request": "launch",
7+
"script": "${file}",
8+
"cwd": "${file}"
9+
}
1210
]
1311
}

function_app/profile.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,10 @@ function Send-IftttAppNotification {
5656
value3 = $Value3
5757
}
5858

59-
Invoke-RestMethod -Method Get -Uri $webhookUrl -Body $body -ResponseHeadersVariable responseHeaders -StatusCodeVariable statusCode
59+
# TEMP removal of "StatusCodeVariable" until PowerShell 7 function app issues are resolved
60+
Invoke-RestMethod -Method Get -Uri $webhookUrl -Body $body -ResponseHeadersVariable responseHeaders #-StatusCodeVariable statusCode
6061

61-
Write-Host "Status Code: [$statusCode]"
62+
# Write-Host "Status Code: [$statusCode]"
6263
Write-Host "Response Headers:`n"
6364
$responseHeaders | Out-String
6465
}

scripts/Fix-FunctionApp.ps1

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# source: https://github.com/terraform-providers/terraform-provider-azurerm/issues/8867#issuecomment-849842849
2+
3+
# Fixes PowerShell function app stack version to 7
4+
5+
# Change function app to PS 7
6+
Write-Host 'Change function app to PS 7'
7+
$function = az functionapp show --name $env:FUNCTION_APP_NAME --resource-group $env:FUNCTION_APP_RG | ConvertFrom-Json
8+
9+
if ($function.siteConfig.powerShellVersion -ne "~7") {
10+
Write-Host "Updating powershell version to ~7..."
11+
az functionapp update --name $env:FUNCTION_APP_NAME --resource-group $env:FUNCTION_APP_RG --set "siteConfig.powerShellVersion=~7"
12+
13+
# Restart Function App
14+
# az functionapp restart --name $env:FUNCTION_APP_NAME --resource-group $env:FUNCTION_APP_RG
15+
} else {
16+
Write-Host "Powershell version already set to to ~7"
17+
}
18+
19+
Write-Host ''

scripts/tflint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ trap "echo 'error: Script failed: see failed command above'" ERR
99

1010
# vars
1111
# Set local vars from env var, with default fallbacks
12-
TFLINT_VERSION="${TFLINT_VERSION:-v0.23.1}"
13-
TFLINT_RULESET_AZURERM_VERSION="${TFLINT_RULESET_AZURERM_VERSION:-v0.7.0}"
12+
TFLINT_VERSION="${TFLINT_VERSION:-v0.29.1}"
13+
TFLINT_RULESET_AZURERM_VERSION="${TFLINT_RULESET_AZURERM_VERSION:-v0.10.1}"
1414
TF_FLAGS=("$TF_WORKING_DIR")
1515
export TFLINT_LOG=debug
1616
# use empty array to skip adding disabled rules, eg: "DISABLED_RULES=()"

splunk/.terraform.lock.hcl

Lines changed: 116 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

splunk/README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# Splunk
2+
3+
Used for Splunk related testing.
4+
5+
## Installation
6+
7+
### Terraform
8+
9+
Build an AKS cluster:
10+
11+
```bash
12+
# Init
13+
cd ./splunk
14+
terraform init #-upgrade
15+
16+
# Apply
17+
terraform apply
18+
19+
# Outputs
20+
terraform output
21+
22+
---
23+
24+
# Delete
25+
terraform destroy
26+
```
27+
28+
### Splunk Operator
29+
30+
There is a current issue with [Admin Installation for All Namespaces](https://github.com/splunk/splunk-operator/issues/206),
31+
so use the [non-admin user method](https://github.com/splunk/splunk-operator/blob/develop/docs/Install.md#installation-using-a-non-admin-user).
32+
33+
#### Install
34+
35+
Install the Splunk Operator as a non-admin user.
36+
37+
```bash
38+
# create namespace
39+
kubectl create namespace splunk-operator
40+
41+
# an admin needs to install the CRDs
42+
kubectl apply -f https://github.com/splunk/splunk-operator/releases/download/1.0.1/splunk-operator-crds.yaml
43+
44+
# install splunk operator into namespace
45+
# v1.0.1 doesnt currently work - I've raised this issue: https://github.com/splunk/splunk-operator/issues/373
46+
kubectl apply -f https://github.com/splunk/splunk-operator/releases/download/1.0.1/splunk-operator-noadmin.yaml --namespace splunk-operator
47+
48+
49+
# 1.0.0 works
50+
kubectl apply -f https://github.com/splunk/splunk-operator/releases/download/1.0.0/splunk-operator-crds.yaml
51+
kubectl apply -f https://github.com/splunk/splunk-operator/releases/download/1.0.0/splunk-operator-noadmin.yaml --namespace splunk-operator
52+
```
53+
54+
### Splunk Deployments
55+
56+
After deploying one of the methods below, [get the password](https://github.com/splunk/splunk-operator/blob/develop/docs/Examples.md#reading-global-kubernetes-secret-object)
57+
by running the following code:
58+
59+
```bash
60+
# kubectl get secret splunk-<desired_namespace>-secret -o go-template=' {{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}'
61+
kubectl get secret --namespace splunk-operator splunk-splunk-operator-secret -o go-template=' {{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}'
62+
```
63+
64+
You can then port-forward to the pod and view the web interface:
65+
66+
```bash
67+
kubectl port-forward splunk-s1-standalone-0 8000
68+
kubectl port-forward --namespace splunk-operator splunk-single-standalone-0 8000
69+
```
70+
71+
#### Standalone
72+
73+
https://github.com/splunk/splunk-operator/blob/develop/docs/Examples.md#creating-a-clustered-deployment
74+
75+
```bash
76+
cat <<EOF | kubectl apply --namespace splunk-operator -f -
77+
apiVersion: enterprise.splunk.com/v1
78+
kind: Standalone
79+
metadata:
80+
name: single
81+
finalizers:
82+
- enterprise.splunk.com/delete-pvc
83+
EOF
84+
```
85+
86+
#### Cluster Master and Indexers
87+
88+
https://github.com/splunk/splunk-operator/blob/develop/docs/Examples.md#indexer-clusters
89+
90+
```bash
91+
# Cluster Master
92+
cat <<EOF | kubectl apply -f -
93+
apiVersion: enterprise.splunk.com/v1
94+
kind: ClusterMaster
95+
metadata:
96+
name: cm
97+
finalizers:
98+
- enterprise.splunk.com/delete-pvc
99+
EOF
100+
101+
# Indexers
102+
cat <<EOF | kubectl apply -f -
103+
apiVersion: enterprise.splunk.com/v1
104+
kind: IndexerCluster
105+
metadata:
106+
name: example
107+
finalizers:
108+
- enterprise.splunk.com/delete-pvc
109+
spec:
110+
clusterMasterRef:
111+
name: cm
112+
EOF
113+
```

0 commit comments

Comments
 (0)