← Back to Blog

Openshift Host Continue on the setup ( OS Part 2 )

Openshift Host Continue on the setup ( OS Part 2 ) Main Script > My Goal to do everything there > Convert into a single skill and add the course/skill ware part / Would be an add on to linkedin > why > https://rifaterdemsahin.com/2024/04/09/why-complete-the-openshift-

Openshift Host Continue on the setup ( OS Part 2 )

Main Script > My Goal to do everything there > Convert into a single skill and add the course/skill ware part /

openshift host continue 1

Would be an add on to linkedin >

openshift host continue 2

why > https://rifaterdemsahin.com/2024/04/09/why-complete-the-openshift-creation/

gcp focus > https://rifaterdemsahin.com/2024/04/05/hackerrank-focus/

Customers are there >>> learn agents from all not only azure onpremises gateway

openshift host continue 3

miro board > https://miro.com/app/board/uXjVNi9RlUg=/

Move on From here > https://rifaterdemsahin.com/2024/03/04/openshift-course-pluralsight/

Pink Machine start

openshift host continue 4

The powershell script has other parts in this

openshift host continue 5

Start empty

openshift host continue 6

Add to dashboard

openshift host continue 7

remove the old ones keep it active

openshift host continue 8

openshift host continue 9

add to open shift

openshift host continue 10

Looks like he installed on windows not the linux enviroment

openshift host continue 11

Place we are trying to reach > While Andres outlines the estimation for his work!

openshift host continue 12

Hassle and demo would be great on Linkedin > Nana created a course in a package!

openshift host continue 13

AKS and nginx is there

openshift host continue 14

AKS practical expose is there

openshift host continue 15

Both are different > he used the windows on the kubernetes example which gives 2 sided examples to market on

openshift host continue 16

Today i expect to have these

openshift host continue 17

would trigger the create host

openshift host continue 18

Manually get the diff of the linux install and fix it

openshift host continue 19

ask your wishes

https://twitter.com/rifaterdemsahin/status/1782702096543818002

2 boxes to deliver

openshift host continue 20

nginx would be used

openshift host continue 21

Multiple controllers with one regfistry outside > delete them not to have cost!

openshift host continue 22

Delete all with speed

openshift host continue 23

Services and requirements

openshift host continue 24

setting up the access is the key

openshift host continue 25

redhat account

openshift host continue 26

Lastpass fixed

openshift host continue 27

More data

openshift host continue 28

openshift host continue 29

dns task automated

openshift host continue 30

he is setting up his own version of ubuntu there

openshift host continue 31

dns and connectivity of the host is also another project

openshift host continue 32

PTR getting added

openshift host continue 33

openshift host continue 34

dont target that step >>> still the ubuntu is the one that he downloaded...and created!

he uses the bootstap for the inital machine name

openshift host continue 35

My Steps >

Change the deployment to ubuntu latest version

Next Stage the vm gets created and the Openshift gets installed

openshift host continue 36

haproxy to manage

openshift host continue 37

see the oc command at the start is ok

openshift host continue 38

after install practical tools are coming in Grafana video would be coming in

openshift host continue 39

task 1 > update the ubuntu version 18 to 22 > ( done to 24 >>> UI loading takes too much time >> we need an image )

task 2 > install the bootstrapper

  • library install > script

  • dns *

task 3> Focus on the cluster! ( other role )

Openshift resolve the account

openshift host continue 40

https://developers.redhat.com/?extIdCarryOver=true&sc_cid=7013a000003SgNhAAK&source=sso

why empty ?

openshift host continue 41

openshift host continue 42

delete got triggered some how

openshift host continue 43

4 day cycle

openshift host continue 44

openshift host continue 45

we need this to create resources with our latest image

openshift host continue 46

To update your Azure ARM template to deploy the latest version of Ubuntu, you need to modify the imageReference section of the storageProfile within the Microsoft.Compute/virtualMachines resource definition. This section specifies the operating system image that the virtual machine will use.

Here's what you need to change:

  • SKU: Ubuntu frequently updates its SKU names with the release of new versions. For instance, if you want to use the latest long-term support (LTS) version after Ubuntu 18.04, such as Ubuntu 20.04 LTS, you need to change the SKU to 20_04-lts-gen2.

  • Publisher and Offer: Typically, for Ubuntu, the publisher is Canonical and the offer is UbuntuServer. These usually do not change unless Canonical changes their publishing details on Azure.

Here's an example of how the relevant part of your JSON template should look if you were updating to Ubuntu 20.04 LTS:

"storageProfile": {
"imageReference": {
"offer": "UbuntuServer",
"publisher": "Canonical",
"sku": "20_04-lts-gen2", // Change this line to the latest LTS version SKU
"version": "latest"
},
"osDisk": {
"createOption": "fromImage"
}
}

This adjustment will ensure that your deployment uses the Ubuntu 20.04 LTS image. If a newer LTS version is available and you want to use that, simply replace 20_04-lts-gen2 with the corresponding SKU of the new version, such as 22_04-lts-gen2 for Ubuntu 22.04 LTS.

Make sure to always check the Azure Marketplace or Canonical announcements for the latest available versions and their corresponding SKU names.

openshift host continue 47

Ran 18.04

https://portal.azure.com/#view/Microsoft_Azure_EMA/LogicAppsMonitorBlade/runid/%2Fsubscriptions%2F2cb217c1-366d-41c0-8934-3f82869320d8%2FresourceGroups%2FOpenshiftHelper%2Fproviders%2FMicrosoft.Logic%2Fworkflows%2Fopenshifthelper-createhost%2Fruns%2F08584877426683168670311406728CU07

20.04 did not work

{ "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'linuxhost20240423130012' is not valid according to the validation procedure. The tracking id is 'dca6e690-eb9b-41af-80ff-8e01f63e3a7d'. See inner errors for details.", "details": [ { "code": "InvalidParameter", "target": "imageReference", "message": "The following list of images referenced from the deployment template are not found: Publisher: Canonical, Offer: UbuntuServer, Sku: 20_04-lts-gen2, Version: latest. Please refer to https://docs.microsoft.com/en-us/azure/virtual-machines/windows/cli-ps-findimage for instructions on finding available images." } ] } }

retirgger

openshift host continue 48

openshift host continue 49

$locName="uksouth" Get-AzVMImagePublisher -Location $locName | Select PublisherName

$pubName="Canonical"

Get-AzVMImageOffer -Location $locName -PublisherName $pubName | Select Offer

openshift host continue 50

openshift host continue 51

$offerName="ubuntu-24_04-lts-daily"

Get-AzVMImageSku -Location $locName -PublisherName $pubName -Offer $offerName | Select Skus

openshift host continue 52

$skuName="server-gen1"

Get-AzVMImage -Location $locName -PublisherName $pubName -Offer $offerName -Sku $skuName | Select Version

openshift host continue 53

openshift host continue 54

openshift host continue 55

lets check the xrdp there now we can do this >

openshift host continue 56

the client software is what we are looking for

It looks like you've provided an image of a script related to installing and setting up an OpenShift environment on a developer's host. Based on this image, you may be looking to generate a similar script.

Here's an outline of the steps that might be contained in such a script, according to the commands visible in your image:

  • Install dos2unix: It's a utility to convert files from the DOS/Windows text format to the Unix text format.

  • Get Installer: Use curl to download the OpenShift installer from the provided URL.

  • Extract the Installer: Extract the downloaded tarball with tar xvf.

  • Get OC client: Download the OpenShift client (oc) using curl.

  • Extract the OC client: Extract the downloaded OpenShift client tarball.

  • Create Install Directory: Make a directory, typically named for organizing installation-related files.

  • Copy Configuration Files: Copy the OpenShift install configuration YAML files into the installation directory.

To recreate a full script for setting up OpenShift on a developer host, you would need to have more details, like specific URLs for downloads, which configuration files are needed, and how they should be configured.

If you can provide more details or additional parts of the script, I could help you construct a more complete version of the installation script.

than more on with xrdp to install there is they work ..this is going to be the second file in

openshift host continue 57

Andres is quiet >>> time for him to come up with the numbers

openshift host continue 58

openshift host continue 59

maybe the xrdp is not running there well

openshift host continue 60

I am able to login to the box

openshift host continue 61

htop machine status

openshift host continue 62

Practical sorters are there

openshift host continue 63

openshift host continue 64

xrdp is here

openshift host continue 65

old scripts

`#!/bin/bash

Ensure the script is run as root

if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi

Update the package list and upgrade all installed packages

apt-get update -y
if [ $? -ne 0 ]; then
echo "Failed to update package list" 1>&2
exit 1
fi

apt-get upgrade -y
if [ $? -ne 0 ]; then
echo "Failed to upgrade installed packages" 1>&2
exit 1
fi

Install xrdp and configure it

apt-get install xrdp -y
if [ $? -ne 0 ]; then
echo "Failed to install xrdp" 1>&2
exit 1
fi

ufw allow 3389/tcp
echo "gnome-session" > /etc/skel/.xsession
# Using /etc/skel so new users inherit this setup

Install Ubuntu desktop environment correctly

apt-get install ubuntu-desktop -y
if [ $? -ne 0 ]; then
echo "Failed to install ubuntu-desktop" 1>&2
exit 1
fi

systemctl restart xrdp
if [ $? -ne 0 ]; then
echo "Failed to restart xrdp" 1>&2
exit 1
fi

Log the reboot action

echo "$(date "+%Y-%m-%d %H:%M:%S") - System is rebooting" >> /var/log/reboot.log

Reboot the system silently

nohup shutdown -r now > /dev/null 2>&1 &
`

maybe it is out at starts?

openshift host continue 66

openshift host continue 67

To add a user to the sudo group on a Linux system, which essentially gives them superuser privileges, you would typically use the following command:

  • Open your terminal.

  • Type the following command to add the user "rifaterdemsahin" to the sudo group:

sudo usermod -aG sudo rifaterdemsahin

Here's what each part of the command does:

  • sudo: Runs the command as a superuser.

  • usermod: A utility to modify a user account.

  • -aG: The -a is to append the user to the given group, and -G specifies the group.

  • sudo: The name of the group to which the user will be added.

  • rifaterdemsahin: The username of the user you want to add to the sudo group.

Make sure that you have administrative privileges to execute this command. After running it, the user "rifaterdemsahin" will have sudo access and can execute commands that require superuser permissions.

openshift host continue 68

only sudo works maybde 24 is different

openshift host continue 69

it says the packages are there

openshift host continue 70

Looks like this part is working now > apt-get install xrdp -y

openshift host continue 71

openshift host continue 72

openshift host continue 73

up it could be stuck

this looks like it is working

openshift host continue 74

azure one looks like it is stuck

openshift host continue 75

UI brings much more components than the past

openshift host continue 76

openshift host continue 77

openshift host continue 78

!/bin/bash

Ensure the script is run as root

if [ "$(id -u)" -ne 0 ]; then
echo "This script must be run as root" 1>&2
exit 1
fi

Update the package list and upgrade all installed packages

sudo apt-get update -y
if [ $? -ne 0 ]; then
echo "Failed to update package list" 1>&2
exit 1
fi

sudo apt-get upgrade -y
if [ $? -ne 0 ]; then
echo "Failed to upgrade installed packages" 1>&2
exit 1
fi

Install xrdp and configure it

sudo apt-get install xrdp -y
if [ $? -ne 0 ]; then
echo "Failed to install xrdp" 1>&2
exit 1
fi

sudo ufw allow 3389/tcp
echo "gnome-session" | sudo tee /etc/skel/.xsession > /dev/null # Using /etc/skel so new users inherit this setup

Install Ubuntu desktop environment correctly

sudo apt-get install ubuntu-desktop -y
if [ $? -ne 0 ]; then
echo "Failed to install ubuntu-desktop" 1>&2
exit 1
fi

sudo systemctl restart xrdp
if [ $? -ne 0 ]; then
echo "Failed to restart xrdp" 1>&2
exit 1
fi

Log the reboot action

echo "$(date "+%Y-%m-%d %H:%M:%S") - System is rebooting" | sudo tee -a /var/log/reboot.log > /dev/null

Reboot the system silently

sudo nohup shutdown -r now > /dev/null 2>&1 &

If you're experiencing a failure with the command echo "gnome-session" | sudo tee /etc/skel/.xsession > /dev/null on Ubuntu 24.04 due to permission issues, there are a few things to check and ensure for it to execute successfully:

  • Sudo Privileges: Ensure the user executing the script has the necessary sudo privileges. This typically means the user should be able to execute commands with sudo without entering a password, or you must run the script in a context where the password can be entered if prompted.

  • Filesystem Permissions: Make sure that the /etc/skel directory has the correct permissions. You can check the permissions with the following command:

ls -ld /etc/skel

Typically, the directory should be owned by root, and writable by the owner. If the permissions are incorrect, you can set them with:

sudo chown root:root /etc/skel
sudo chmod 755 /etc/skel

  • Sudo Configuration: If the user has sudo access but cannot execute this specific command, check the sudoers file for any command-specific restrictions. You can view the sudoers file by running:

sudo visudo

Look for any lines that might limit the commands your user can run. Ensure there are no restrictive settings for the specific command or that the user isn’t limited to a subset of commands.

  • SELinux or AppArmor Policies: Ubuntu uses AppArmor as a security module that could restrict actions even under sudo. If AppArmor is enforcing a policy that prevents writing to /etc/skel/.xsession, you might need to adjust the policy. Check the status and logs of AppArmor with:

sudo aa-status
sudo dmesg | grep apparmor

Adjusting AppArmor policies can be complex, so it's essential to understand the implications of changes you make.

  • Debugging the Command: Run the command outside the script to check its output and error messages directly in your terminal. This might provide additional clues:

echo "gnome-session" | sudo tee /etc/skel/.xsession

By ensuring these aspects are correctly set up, the command should execute without permission issues. If problems persist after checking and adjusting these settings, you may need to look deeper into system logs or specific configurations unique to your setup.

openshift host continue 79

feels stuck

openshift host continue 80

openshift host continue 81

much longer install time is there

openshift host continue 82

Script pinned as well

openshift host continue 83


Imported from rifaterdemsahin.com · 2024