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

Some comments on the installation in an Airgapped environment. #689

Open
dikpater opened this issue Oct 15, 2024 · 4 comments
Open

Some comments on the installation in an Airgapped environment. #689

dikpater opened this issue Oct 15, 2024 · 4 comments

Comments

@dikpater
Copy link

Mr. Smith.
We , my collegue Rob and I had to make some changes to get the installation working in our environment, I wanted to email , but I did not know how.
If there is a better way to inform you, please inform me.

  • We changed the common.sh :
    #function v4m_replace {

if echo "$OSTYPE" | grep 'darwin' > /dev/null 2>&1; then

sed -i '' s/"$1"/"$2"/g "$3"

else

sed -i s/"$1"/"$2"/g "$3"

fi

#}
INTO
function v4m_replace {
sed -i ''s%$1%$2%g'' "$3"
}

  • In the example yaml user.env here stood AIRGAP_HELM_FORMAT: oci. we changed : to = → AIRGAP_HELM_FORMAT= tgz
  • Change in /appl/mon/viya4-monitoring-kubernetes/monitoring/prom-operator_container_image.template the line
    #imagePullSecrets: IMAGE_PULL_SECRETS
    into
    imagePullSecrets: [name: IMAGE_PULL_SECRET]
  • /appl/mon/viya4-monitoring-kubernetes/monitoring/pushgateway_container_image.template also needs this change.
  • adding smtp configuration
    added these lines in the user-values-prom-operator.yaml(create a kubernets secret kube-prometheus-stack-grafana-secret-mail with MAILUSER + MAILPASSWORD):
    This was a struggle, with outlining..so I think to post it.
    grafana:

    See https://grafana.com/docs/grafana/latest/administration/configuration/#smtp

    envFromSecret: kube-prometheus-stack-grafana-secret-mail
    "grafana.ini":
    smtp:
    enabled: "true"
    host: mailhost:25
    from_address: [email protected]
    from_name: someone
    skip_verify: "true"
    user: $__env{MAILUSER}
    password: $__env{MAILPASSWORD}
@gsmith-sas
Copy link
Member

@dikpater Thank you for opening this issue to let us know about the problems you ran into and the work-arounds you needed. I am sorry you had trouble; but it sounds like you were able to get everything working in the end.

  • The v4m_replace function issue
    I am not aware of any other users having problems with this function. The existing function code has generally worked on Bash 4 on Linux and with the Bash built into the Apple Mac. But there can always be compatibility issues. What operating system were you using? What version of BASH are you using?
  • The AIRGAP_HELM_FORMAT environment variable
    I am glad you found the AIRGAP_HELM_FORMAT environment variable. We discuss it in the documentation about deploying into an air-gapped environment but some people miss it.
  • Specifying the imagePullSecret
    It is very strange that you needed to make that change. What value did you specify for the AIRGAP_IMAGE_PULL_SECRET_NAME environment variable? I have just double-checked the code and it should have generated the line properly (including the brackets and name:). Seeing how you set the environment variable will allow us to do additional testing.
  • Providing SMTP Configuration
    I think GitHub markdown formatting may have garbled your sample code a bit, I don't think the proper yaml indentations were preserved. For future reference, you can include a block of code (or yaml) and have the indentation preserved by clicking on the <> icon in the formatting toolbar after typing your code. (Or, you can put a line with 3 tick marks (`) before and after a block of code.) For example:
yaml:
  indentations:
    can_be: difficult

In any case, we know providing additional Grafana configuration information can be difficult. We hope to make things like this easier in the future.

Thank you again for opening this issue and sharing information on the problems you ran into. Please provide the information I requested so we can make any needed improvements.

Regards,
Greg

@gsmith-sas
Copy link
Member

@dikpater Sorry, I've been out of office and haven't had a chance to follow-up on this for the last couple of weeks. It would be very helpful if you could provide more information about your experience so we can address any bugs or needed tweaks to our code or documentation. I included some questions in my earlier response, but let me list them here:

  • Please describe the environment in which you were running our deployment scripts (e.g. operating system, BASH versions, etc.)
  • Please share information on the values you set for the various air-gap related environment variables (e.g. AIRGAP_HELM_FORMAT, AIRGAP_IMAGE_PULL_SECRET_NAME, etc.)

Regards,
Greg

@dikpater
Copy link
Author

dikpater commented Nov 1, 2024 via email

@sorin1sima
Copy link

sorin1sima commented Nov 6, 2024

Hi Greg,

I also had an error related to v4m_replace function definition I believe as my deployment was failing with sed error:

./deploy_logging.sh
_INFO User directory: /opt/work/deployments/sas-prod-oss/viya4mon/config
INFO Helm client version: 3.16.2
INFO Kubernetes client version: v1.27.9
INFO Kubernetes server version: v1.27.9
INFO Loading user environment file: /opt/work/deployments/sas-prod-oss/viya4mon/config/logging/user.env
INFO Deploying into an 'air-gapped' cluster from private registry [x.x.x.x/monitoring]

Deploying logging components to the [logging] namespace [Tue Nov 5 09:04:06 PM UTC 2024]_

sed: -e expression #1, char 44: unknown option to `s'
ERROR Exiting script [deploy_logging.sh] due to an error executing the command [logging/bin/deploy_osd.sh]._

After editing the function as per the above, deployment went through... I saw some sed errors from time to time:
sed: can't read : No such file or directory

...but resources were created and pods were Running, however, deployment failed.

INFO Loading Content into OpenSearch
ERROR The OpenSearch REST endpoint has NOT become accessible in the expected time; exiting.
ERROR Review the OpenSearch pod's events and log to identify the issue and resolve it before trying again.
ERROR Exiting script [deploy_logging.sh] due to an error executing the command [logging/bin/deploy_opensearch_content.sh].

_export NODE_PORT=$(kubectl get --namespace logging -o jsonpath="{.spec.ports[0].nodePort}" services v4m-osd)
export NODE_IP=$(kubectl get nodes --namespace logging -o jsonpath="{.items[0].status.addresses[0].address}")

echo http://$NODE_IP:$NODE_PORT
http://x.x.x.x:31033_
...
x.x.x.x is the IP of the CAS node.

,and indeed I get nothing in the browser.

What am I doing wrong? Is it ok to run this on the CAS node?
Can I take this with SAS Support?

Please describe the environment in which you were running our deployment scripts (e.g. operating system, BASH versions, etc.):

Ubuntu 22.04.1 LTS (GNU/Linux 5.15.0-43-generic x86_64)
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)

Please share information on the values you set for the various air-gap related environment variables (e.g. AIRGAP_HELM_FORMAT, AIRGAP_IMAGE_PULL_SECRET_NAME, etc.)

AIRGAP_DEPLOYMENT=true
AIRGAP_REGISTRY=x.x.x.x/monitoring
AIRGAP_IMAGE_PULL_SECRET_NAME=v4m-image-pull-secret
AIRGAP_HELM_FORMAT=tgz
AIRGAP_HELM_REPO=/opt/helm

We are using harbor for private registry.

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants