Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[minor] Install Instana Agent Operator for GitOps #1446

Merged
merged 34 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6a5291a
Jinja template & function
boonware Dec 17, 2024
1bc24e1
Merge branch 'master' into 4798
boonware Dec 17, 2024
bbb73a7
tekton updates
boonware Dec 17, 2024
f843f90
Merge branch '4798' of github.com:ibm-mas/cli into 4798
boonware Dec 17, 2024
f99b2e3
jinja indentation
boonware Dec 17, 2024
a795639
fix jinja indentation
boonware Dec 17, 2024
bf32afc
update var name
boonware Dec 18, 2024
c0dda9c
Merge branch 'master' of github.com:ibm-mas/cli into 4798
boonware Jan 6, 2025
c203269
fix setting env var
boonware Jan 6, 2025
814bdbd
Merge branch '4798' into 4799
boonware Jan 7, 2025
72fe165
wip
boonware Jan 7, 2025
9d415af
Merge branch 'master' of github.com:ibm-mas/cli into 4799
boonware Jan 8, 2025
a81cf06
wip
boonware Jan 8, 2025
e7e9966
update env var
boonware Jan 8, 2025
653f165
fix template vars
boonware Jan 8, 2025
4aa3937
Merge branch 'master' into 4799
boonware Jan 16, 2025
99fb2af
fix var name
boonware Jan 16, 2025
1a0dad2
Merge branch 'master' of github.com:ibm-mas/cli into 4799
boonware Jan 16, 2025
3f4afa1
Merge branch '4799' of github.com:ibm-mas/cli into 4799
boonware Jan 16, 2025
89d95c8
update var name
boonware Jan 20, 2025
dca4adc
rename var
boonware Jan 21, 2025
cd55493
Merge branch 'master' into 4799
boonware Jan 21, 2025
cfe1bf6
echo value of param
boonware Jan 23, 2025
d3c3fc2
Merge branch '4799' of github.com:ibm-mas/cli into 4799
boonware Jan 23, 2025
cf28e32
install Instana Agent Operator
boonware Jan 23, 2025
ed694f8
fix syntax
boonware Jan 24, 2025
e4cffed
Merge branch 'master' of github.com:ibm-mas/cli into 5070
boonware Jan 24, 2025
0072645
fix template generation
boonware Jan 24, 2025
4753820
add install param
boonware Jan 24, 2025
974f6f8
jsk storage class param
boonware Jan 24, 2025
f2470d1
update tekton params
boonware Jan 28, 2025
c519dfc
Merge branch 'master' of github.com:ibm-mas/cli into 5070
boonware Feb 6, 2025
68ee0dd
trigger CI
boonware Feb 6, 2025
8e94288
Merge branch 'master' into 5070
boonware Feb 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "^.secrets.baseline$",
"lines": null
},
"generated_at": "2025-01-23T11:46:57Z",
"generated_at": "2025-01-23T12:00:32Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down Expand Up @@ -172,7 +172,7 @@
"hashed_secret": "b2817467154949a61f8e9ad31d1eeaf03221cbfa",
"is_secret": false,
"is_verified": false,
"line_number": 403,
"line_number": 411,
"type": "Secret Keyword",
"verified_result": null
}
Expand Down
28 changes: 28 additions & 0 deletions image/cli/mascli/functions/gitops_cluster
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ CrowdStrike Falcon Operator (Optional):
Cluster Logging Operator (Optional):
--install-cluster-logging-operator ${COLOR_YELLOW}CLUSTER_LOGGING_OPERATOR_INSTALL${TEXT_RESET} Install the Cluster Logging Operator

Instana Agent Operator (Optional):
--install-instana-agent-operator ${COLOR_YELLOW}INSTANA_AGENT_OPERATOR_INSTALL${TEXT_RESET} Install the Instana Agent Operator

Other Commands:
-h, --help Show this help message
EOM
Expand Down Expand Up @@ -284,6 +287,11 @@ function gitops_cluster_noninteractive() {
export CLUSTER_LOGGING_OPERATOR_INSTALL=true
;;

# Instana Agent Operator
--install-instana-agent-operator)
export INSTANA_AGENT_OPERATOR_INSTALL=true
;;

# Other Commands
-h|--help)
gitops_cluster_help
Expand Down Expand Up @@ -481,6 +489,11 @@ function gitops_cluster() {
echo_reset_dim "Use Syslog Forwarder ........... ${COLOR_MAGENTA}${CLUSTER_LOGGING_OPERATOR_USE_SYSLOG_FORWARDER}"
reset_colors

echo "${TEXT_DIM}"
echo_h2 "Instana Agent Operator" " "
echo_reset_dim "Install the Instana Agent Operator ........... ${COLOR_MAGENTA}${INSTANA_AGENT_OPERATOR_INSTALL}"
reset_colors

# Set up secrets
# ---------------------------------------------------------------------------
echo
Expand Down Expand Up @@ -509,6 +522,9 @@ function gitops_cluster() {
export SECRET_KEY_CLOUDWATCH_AWS_SECRET_ACCESS_KEY=${SECRET_NAME_CLOUDWATCH}#aws_secret_access_key
export SECRET_KEY_CLOUDWATCH_AWS_ACCESS_KEY_ID=${SECRET_NAME_CLOUDWATCH}#aws_access_key_id

export SECRET_NAME_INSTANA=${ACCOUNT_ID}${SM_DELIM}${CLUSTER_ID}${SM_DELIM}instana
export SECRET_KEY_INSTANA_KEY=${SECRET_NAME_INSTANA}#key

if [ -n "$DEVOPS_MONGO_URI" ];then
echo "- Update DEVOPS_MONGO_URI secret"
TAGS="[{\"Key\": \"source\", \"Value\": \"gitops_cluster\"}, {\"Key\": \"account\", \"Value\": \"${ACCOUNT_ID}\"}, {\"Key\": \"cluster\", \"Value\": \"${CLUSTER_ID}\"}]"
Expand All @@ -533,6 +549,12 @@ function gitops_cluster() {
sm_update_secret $SECRET_NAME_CLOUDWATCH "{\"aws_secret_access_key\": \"${CLOUDWATCH_AWS_SECRET_ACCESS_KEY}\", \"aws_access_key_id\": \"${CLOUDWATCH_AWS_ACCESS_KEY_ID}\"}" "${TAGS}"
fi

if [ -n "$INSTANA_KEY" ]; then
echo "- Update INSTANA_KEY secret"
TAGS="[{\"Key\": \"source\", \"Value\": \"gitops_cluster\"}, {\"Key\": \"account\", \"Value\": \"${ACCOUNT_ID}\"}, {\"Key\": \"cluster\", \"Value\": \"${CLUSTER_ID}\"}]"
sm_update_secret $SECRET_NAME_INSTANA "{\"key\": \"${INSTANA_KEY}\"}" "${TAGS}"
fi

if [ -z $GIT_SSH ]; then
export GIT_SSH="false"
fi
Expand Down Expand Up @@ -651,6 +673,12 @@ function gitops_cluster() {
jinja -X .+ $CLI_DIR/templates/gitops/appset-configs/cluster/cluster-logging-operator.yaml.j2 -o ${GITOPS_CLUSTER_DIR}/cluster-logging-operator.yaml
fi

if [[ -n "$INSTANA_AGENT_OPERATOR_INSTALL" ]]; then
echo "- Instana Agent Operator"
sm_verify_secret_exists $SECRET_NAME_INSTANA "key"
jinja -X .+ $CLI_DIR/templates/gitops/appset-configs/cluster/instana-agent-operator.yaml.j2 -o ${GITOPS_CLUSTER_DIR}/instana-agent-operator.yaml
fi

# Commit and push to github target repo
# ---------------------------------------------------------------------------
if [ "$GITHUB_PUSH" == "true" ]; then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
merge-key: "{{ ACCOUNT_ID }}/{{ CLUSTER_ID }}"

instana_agent_operator:
install: "{{ INSTANA_AGENT_OPERATOR_INSTALL }}"
jks_storage_class: "{{ INSTANA_AGENT_OPERATOR_JKS_STORAGE_CLASS }}"
key: "<path:{{ SECRETS_PATH }}:{{ SECRET_KEY_INSTANA_KEY }}>"
endpoint_host: "{{ INSTANA_AGENT_OPERATOR_ENDPOINT_HOST }}"
endpoint_port: "{{ INSTANA_AGENT_OPERATOR_ENDPOINT_PORT }}"
{%- if INSTANA_AGENT_OPERATOR_ENV is defined and INSTANA_AGENT_OPERATOR_ENV %}
env:
{{ INSTANA_AGENT_OPERATOR_ENV | indent }}
{%- endif %}
27 changes: 27 additions & 0 deletions tekton/src/pipelines/gitops/gitops-mas-cluster.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,22 @@ spec:
type: string
default: 'true'

- name: instana_agent_operator_install
type: string
default: 'false'
- name: instana_agent_operator_endpoint_host
type: string
default: ''
- name: instana_agent_operator_endpoint_port
type: string
default: ''
- name: instana_agent_operator_env
type: string
default: ''
- name: instana_agent_operator_jks_storage_class
type: string
default: ''

tasks:
- name: gitops-cluster
params:
Expand Down Expand Up @@ -270,6 +286,17 @@ spec:
value: $(params.cluster_logging_operator_install)
- name: cluster_logging_operator_use_syslog_forwarder
value: $(params.cluster_logging_operator_use_syslog_forwarder)

- name: instana_agent_operator_install
value: $(params.instana_agent_operator_install)
- name: instana_agent_operator_endpoint_host
value: $(params.instana_agent_operator_endpoint_host)
- name: instana_agent_operator_endpoint_port
value: $(params.instana_agent_operator_endpoint_port)
- name: instana_agent_operator_env
value: $(params.instana_agent_operator_env)
- name: instana_agent_operator_env
value: $(params.instana_agent_operator_jks_storage_class)

taskRef:
kind: Task
Expand Down
27 changes: 27 additions & 0 deletions tekton/src/tasks/gitops/gitops-cluster.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@ spec:
type: string
default: 'true'

- name: instana_agent_operator_install
type: string
default: 'false'
- name: instana_agent_operator_endpoint_host
type: string
default: ''
- name: instana_agent_operator_endpoint_port
type: string
default: ''
- name: instana_agent_operator_env
type: string
default: ''
- name: instana_agent_operator_jks_storage_class
type: string
default: ''

stepTemplate:
name: gitops-cluster
env:
Expand Down Expand Up @@ -207,6 +223,17 @@ spec:
- name: CLUSTER_LOGGING_OPERATOR_USE_SYSLOG_FORWARDER
value: $(params.cluster_logging_operator_use_syslog_forwarder)

- name: INSTANA_AGENT_OPERATOR_INSTALL
value: $(params.instana_agent_operator_install)
- name: INSTANA_AGENT_OPERATOR_ENDPOINT_HOST
value: $(params.instana_agent_operator_endpoint_host)
- name: INSTANA_AGENT_OPERATOR_ENDPOINT_PORT
value: $(params.instana_agent_operator_endpoint_port)
- name: INSTANA_AGENT_OPERATOR_ENV
value: $(params.instana_agent_operator_env)
- name: INSTANA_AGENT_OPERATOR_JKS_STORAGE_CLASS
value: $(params.instana_agent_operator_jks_storage_class)

envFrom:
- configMapRef:
name: environment-properties
Expand Down