root

joined 2 years ago
MODERATOR OF
 

Author: Swapnanil Chatterjee

"Being a small nation like Maldives, I sincerely value the support of the Indian NCC," said Brigadier General Wais Waheed, Commandant of Maldives Marine Corps.

Brigadier General Wais Waheed, Commandant of Maldives the Marine Corps, seeks Indian help to enchance Maldives defence capabilities (Image:PIB, MNDF)

Maldives has sought India’s help in training its cadets and for acquiring equipment for its forces. Maldives Marine Corps Commandant Brigadier General Wais Waheed on Thursday (June 22, 2023) requested assistance for the same from India’s Director General of the NCC, Lieutenant General Gurbirpal Singh.

"As a small country like the Maldives, I would greatly appreciate any assistance that the Indian NCC can provide us in terms of training, resources, and structural reforms," stated Brigadier General Waheed.

India to enhance Maldives defence and disaster response capabilities

  • Maldives will send a proposal to India, requesting assistance in training and acquiring equipment. If India deems it acceptable, then it will sanction the necessary aid for Maldives.
  • The Commandant of the Maldives National Defense Force (MNDF) spoke about the potential for future collaboration between the two countries.
  • Given that the Maldives is prone to natural disasters, Brig Gen Waheed expressed his desire to jointly train Maldivian cadets with India's support, particularly for natural disaster response and relief efforts, considering it as a force multiplier.

Military Cooperation between Maldives and India

According to the Maldivian Commandant, the training module implemented by the Indian Army is also employed by the defence forces of Maldives. The ongoing 12th edition of their annual joint exercise, Ekuverin, between the Indian Army and the Maldives National Defense Force is taking place at Chaubatia, Uttarakhand. This exercise focuses on counter-insurgency/terrorism operations, as well as humanitarian assistance and disaster relief operations conducted under the UN mandate, spanning from June 11 to 24.

Personnel of the Maldives National Defence Force, along with the Indian Army, holding the DRDO Corner Shot Weapon System.(Credit: Press Information Bureau)

Another ongoing exercise is Operation Ekatha, an annual bilateral exercise between the navies of both countries. The sixth edition of this exercise is being held in the Maldives from June 4 to July 3. The naval exercise will see the participation of Maldivian Coast Guard and Indian divers from the Navy and Marine Commandos (MARCOS). The training regimen includes underwater demolition, close-quarter battle, diving operations, and VBSS (visit, board, search, and seizure) operations.

Indian Navy personnel, along with the MNDF Coast Guard, are participating in Operation Ekatha (Credit:ANI)

How do India and Maldives benefit

Both exercises aim to enhance interoperability between the armed forces of both countries, focusing on sharing best practices, improving coordination, and fostering cooperation at the tactical level. A Ministry of Defence statement emphasised, "The defence cooperation between the two countries extends beyond joint exercises to assisting Maldives with defence training and equipment requirements." The statement from MoD implies that the interaction between the armed forces of both nations will not only strengthen friendly relations but also deepen economic, cultural, and military cooperation.

 

Author: Swapnanil Chatterjee

The agreement involves the potential joint production of GE Aerospace's F414 engines in India, supporting the IAF's LCA Tejas MK2.

General Electric (GE) Aerospace has signed a memorrandum of Understanding (MOU) with Hindustan Aeronautics Limited (HAL) to produce fighter jet engines for the Indian Air Force (IAF). The agreement involves potential joint production of GE Aerospace's F414 engines in India, supporting the Light Combat Aircraft (LCA) Tejas Mk2 program.

This partnership strengthens defence collaboration between the US and India, aligning with President Biden and Prime Minister Narendra Modi's vision of closer coordination. This is a major milestone amid PM Modi's historic trip to the US. GE Aerospace has a long-standing presence in India and aims to create a family of products, including the F404 engine, and collaborate on the development of the AMCA program and other future programs. Over 1,600 F414 engines have been delivered globally.

 

Author: Eashaan Dhillon

Frank Kendall gave the opening address and said Indo-US ties are growing, & asserted there was enormous potential for startups of both nations to collaborate.

The India-US Defence Acceleration Ecosystem was launched at an event in Washington DC, US, on Wednesday, June 21. The INDUS-X event was co-organised by Innovations for Defence Excellence (iDEX), the Ministry of Defence and the US Department of Defence. It was hosted by the US-India Business Council.

A reception for Indian and US government representatives, defence startups, think tanks, incubators, investors, industries, and other stakeholders was organised on June 20. US Ambassador to India Eric Garcetti gave the keynote address during the reception and said that due to their shared diplomatic ideals, similar political views, and strong inter-ethnic ties, India and the United States have a strong worldwide strategic alliance that spans practically all facets of human effort, and strong strategic, economic, and military links exist between the two nations. The US and India are collaborating to advance harmony and peace in the Indo-Pacific region.

At #INDUSX being hosted at @USChamber, USIBC hosted a substantive discussion on procurement, export controls, and industrial security with government, industry, and academia.

About the Indo-US INDUS X Event

US Secretary of Air Force Frank Kendall, who gave the opening keynote address, said that the India-US partnership is growing exponentially. He emphasised that there was enormous potential for startups of both nations to collaborate in deep tech innovations, especially in the Space and Artificial Intelligence domain (AI).

Anurag Bajpai, Joint Secretary (Defence Industries Promotion), MoD, who led the Indian delegation in the two-day INDUS-X event, in his welcome remarks on ''Investing in the future of India-US defence relations'', hailed the launch of iCET as a landmark event in Indo-US defence ties. As the leaders of the biggest and oldest democracies in the world gather in Washington, he asserted that this is an opportune moment. The idea for a defence innovation bridge is a part of the initiative on critical and emerging technologies unveiled by the national security advisors Ajit Doval and Jake Sullivan in January and the Pentagon said that through INDUS-X, the ties will be strengthened between defence industrial ecosystem to make them more innovative, accessible and resilient.

In addition, the Pentagon also said that both Department of Defence and the Ministry of Defence along with external stakeholders will explore joint challenges for India and US startups that leverage common dual use cases for both the countries. An unprecedented joint presentation of cutting-edge technologies from startups in the US and India was presented during the event. The event also saw a first-of-its-kind joint showcasing of innovative technologies by Indian and American startups. Fifteen Indian and 10 US startups from multiple domains such as maritime, AI, autonomous systems and space showcased their technologies to Indian and US stakeholders.

Senior American officials watched the exhibition, including Congressman RO Khanna, co-chair of the Congressional Caucus on India and Indian Americans, and Radha Iyengar Plumb, deputy undersecretary of defence for acquisition and sustainment for the US Department of Defence. Khanna serves on the House Armed Services Committee. Two panel discussions and two roundtables were held, focussing on deepening collaborations across various domains including export control regulations. INDUS-X will also enhance connectivity between American and Indian defence startups to explore joint opportunities in high-tech defence innovation, research and development, and strengthen bilateral trade relationships and defence establishment linkages.

Also, a group of private stakeholders will engage investors to set up a joint innovation fund, while both governments will explore a public-private partnership model for funding deep tech defence startups. Both India and US also intend to explore standardising certification for technologies developed by defence innovation ecosystems of both countries, to accelerate their absorption. The statement by Pentagon says that the area of focus here will include Quality Assurance parameters, certification standards, and Program success memoranda.

1
submitted 2 years ago* (last edited 2 years ago) by root@lemmy.run to c/india@lemmy.run
 

Authors: Jonathan Evans and Neha Sahgal

Sikh devotees light candles at the Golden Temple in Amritsar, India, on June 25, 2021. (Narinder Nanu/AFP via Getty Images)

India’s massive population is diverse as well as devout. Not only do most of the world’s Hindus, Jains and Sikhs live in India, but it also is home to one of the world’s largest Muslim populations and to millions of Christians and Buddhists.

A new Pew Research Center report, based on a face-to-face survey of 29,999 Indian adults fielded between late 2019 and early 2020 – before the COVID-19 pandemic – takes a closer look at religious identity, nationalism and tolerance in Indian society. The survey was conducted by local interviewers in 17 languages and covered nearly all of India’s states and union territories. Here are key findings from the report.

How we did this

1. Indians value religious tolerance, though they also live religiously segregated lives.

Across the country, most people (84%) say that to be “truly Indian,” it is very important to respect all religions. Indians also are united in the view that respecting other religions is a very important part of what it means to be a member of their own religious community (80%). People in all six major religious groups overwhelmingly say they are very free to practice their faiths, and most say that people of other faiths also are very free to practice their own religion.

But Indians’ commitment to tolerance is accompanied by a strong preference for keeping religious communities segregated. For example, Indians generally say they do not have much in common with members of other religious groups, and large majorities in the six major groups say their close friends come mainly or entirely from their own religious community. That’s true not only for 86% of India’s large Hindu population, but also for smaller groups such as Sikhs (80%) and Jains (72%).

Moreover, roughly two-thirds of Hindus say it is very important to stop Hindu women (67%) or Hindu men (65%) from marrying into other religious communities. Even larger shares of Muslims oppose interreligious marriage: 80% say it is very important to stop Muslim women from marrying outside their religion, and 76% say it is very important to stop Muslim men from doing so.

2. For many Hindus, national identity, religion and language are closely connected.

Nearly two-thirds of Hindus (64%) say it is very important to be Hindu to be truly Indian. Among Hindus who say it is very important to be Hindu to be truly Indian, 80% also say it is very important to speak Hindi to be truly Indian. Most Hindus in India say being Hindu, being able to speak Hindi are very important to be ‘truly’ Indian

Hindus who strongly link Hindu and Indian identities express a keen desire for religious segregation. For instance, 76% of Hindus who say being Hindu is very important to being truly Indian feel it is very important to stop Hindu women from marrying into another religion. By comparison, 52% of Hindus who place less importance on Hinduism’s role in Indian identity hold this view about religious intermarriage.

Moreover, Hindus in the Northern (69%) and Central (83%) parts of the country are much more likely than those in the South (42%) to strongly link Hindu identity with national identity. Together, the Northern and Central regions cover the country’s “Hindi belt,” where Hindi, one of dozens of languages spoken in India, is most prevalent. The vast majority of Hindus in these regions strongly link Indian identity with being able to speak Hindi.

3. Among Hindus, views of national identity go hand-in-hand with politics.

Support for the ruling Bharatiya Janata Party (BJP) is greater among Hindus who closely associate their religious identity and the Hindi language with being truly Indian. In the 2019 national elections, 60% of Hindu voters who think it is very important to be Hindu and to speak Hindi to be truly Indian cast their vote for the BJP, compared with 33% among Hindu voters who feel less strongly about both these aspects of national identity. These views also map onto regional support for the BJP, which tends to be much higher in the Northern and Central parts of the country than in the South.

4. Dietary laws are central to Indians’ religious identity.

Hindus traditionally view cows as sacred, and laws on cow slaughter have recently been a flashpoint in India. Nearly three-quarters of Hindus (72%) in India say a person cannot be Hindu if they eat beef. That is larger than the shares of Hindus who say a person cannot be Hindu if they do not believe in God (49%) or never go to a temple (48%).

Similarly, three-quarters of Indian Muslims (77%) say that a person cannot be Muslim if they eat pork, which is greater than the share who say a person cannot be Muslim if they do not believe in God (60%) or never attend mosque (61%).

5. Muslims favor having access to their own religious courts.

Since 1937, India’s Muslims have had the option of resolving family and inheritance-related cases in officially recognized Islamic courts, known as dar-ul-qaza. These courts are overseen by religious magistrates known as qazi and operate under Shariah principles, although their decisions are not legally binding.

Whether or not Muslims should be allowed to go to their own religious courts remains a hotly debated topic. The survey finds that three-quarters of Muslims (74%) support having access to the existing system of Islamic courts, but followers of other religions are far less likely to support Muslim access to this separate court system.

6. Muslims are more likely than Hindus to say the 1947 partition establishing the separate states of India and Pakistan harmed Hindu-Muslim relations.

More than seven decades after the Indian subcontinent was divided into Hindu-majority India and Muslim-majority Pakistan at the end of British colonial rule, the predominant view among Indian Muslims is that the partition of the subcontinent was a bad thing for Hindu-Muslim relations (48%). Only three-in-ten Muslims say it was a good thing.

Hindus, however, lean in the opposite direction: 43% of Hindus say Partition was beneficial for Hindu-Muslim relations, while 37% say it was harmful. Sikhs, whose historical homeland of Punjab was split by Partition, are even more likely than Muslims to say the event was bad for Hindu-Muslim relations: Two-thirds of Sikhs (66%) take this position.

7. India’s caste system, an ancient social hierarchy with origins in Hindu writings, continues to fracture society.

Regardless of whether they are Hindu, Muslim, Christian, Sikh, Buddhist or Jain, Indians nearly universally identify with a caste. Members of lower caste groups historically have faced discrimination and unequal economic opportunities, but the survey finds that most people – including most members of lower castes – say there is not a lot of caste discrimination in India. The Indian Constitution prohibits caste-based discrimination, including untouchability, and in recent decades the government has enacted economic advancement policies like reserved seats in universities and government jobs for members of some lower-caste communities.

Still, a large majority of Indians overall (70%) say that most or all of their close friends share their caste. Much as they object to interreligious marriages, a large share of Indians (64%) say it is very important to stop women in their community from marrying into other castes, and about the same share (62%) say it is very important to stop men in their community from marrying into other castes. These figures vary only modestly across different castes.

8. Religious conversion is rare in India; to the extent that it is occurring, Hindus gain as many people as they lose.

Conversion of people belonging to lower castes away from Hinduism to other religions, especially Christianity, has been contentious in India, and some states have laws against proselytism. This survey, though, finds that religious switching has a minimal impact on the size of religious groups. Across India, 98% of survey respondents give the same answer when asked to identify their current religion and, separately, their childhood religion.

An overall pattern of stability in the share of religious groups is accompanied by little net change from movement into, or out of, most religious groups. Among Hindus, for instance, any conversion out of the group is matched by conversion into the group: 0.7% of respondents say they were raised Hindu but now identify as something else, and roughly the same share (0.8%) say they were not raised Hindu but now identify as Hindu. For Christians, however, there are some net gains from conversion: 0.4% of survey respondents are former Hindus who now identify as Christian, while 0.1% were raised Christian but have since left Christianity.

 

“India Global Forum’s annual UK-India Week is a highly anticipated fixture in the bilateral calendar of our two great nations,” said UK PM Rishi Sunak.

British Prime Minister Rishi Sunak on Wednesday said he is confident that the India-UK partnership will be a "defining one for our times", as he extended support to the upcoming UK-India Week. Sunak, then UK Chancellor of the Exchequer, was a special guest at the UK-India Awards during last year’s summit when he first spoke about his own Indian heritage and commitment to British Indian values.

In a statement from Downing Street, the 43-year-old leader described the annual event as a catalyst for forging new trade ties and long-term collaborations. “India Global Forum’s annual UK-India Week is a highly anticipated fixture in the bilateral calendar of our two great nations,” said Sunak.

“It is a catalyst for forging new trade ties, lasting collaborations, and a better future for our peoples. I'm confident this partnership will be a defining one for our times,” he said.

UK-India Week 2023 kick-starts with a Young Leaders Forum at the Nehru Centre in London on Saturday and will cover a full spectrum of bilateral issues, from tech and innovation to infrastructure and sustainability at events in London and Windsor. This year marks the fifth edition of the summit and UK-India Awards, which comes just days after the UK government issued a joint outcome statement at the conclusion of the tenth round of free trade agreement (FTA) negotiations with India.

“Technical discussions were held across 10 policy areas over 50 separate sessions. They included detailed draft treaty text discussions in these policy areas,” reads a statement from the Department for Business and Trade (DBT) issued earlier this week.

India and the UK have been negotiating an FTA since January last year, with a goal towards a comprehensive pact that is expected to significantly enhance the bilateral trading relationship, worth an estimated GBP 34 billion in 2022. The 11th round is now scheduled to take place next month, soon after UK-India Week next week.

“Given the geopolitical upheaval and economic turbulence around the world, I believe it is more important now than ever before that the UK and India forge closer and deeper ties. I am, therefore, grateful to Prime Minister Sunak for recognising the role that IGF is playing in bringing our two great democracies closer to unlocking the true potential of the partnership,” said IGF Founder Professor Manoj Ladwa. The six-day series of events will open with an address by Opposition Labour Party Leader Keir Starmer and will also involve interventions by UK Education Secretary Gillian Keegan and India’s Minister of Power, New & Renewable Energy R.K. Singh.

[–] root@lemmy.run 0 points 2 years ago
[–] root@lemmy.run 1 points 2 years ago

Yeap, but most of the time you end up trying to figure out issue on remote system, where you don't have ripgrep always installed, but if you have that available on the system you are working on. ripgrep is always a better alternative.

 

cross-posted from: https://lemmy.run/post/10868

Beginner's Guide to grep

grep is a powerful command-line tool used for searching and filtering text in files. It allows you to find specific patterns or strings within files, making it an invaluable tool for developers, sysadmins, and anyone working with text data. In this guide, we will cover the basics of using grep and provide you with some useful examples to get started.

Installation

grep is a standard utility on most Unix-like systems, including Linux and macOS. If you're using a Windows operating system, you can install it by using the Windows Subsystem for Linux (WSL) or through tools like Git Bash, Cygwin, or MinGW.

Basic Usage

The basic syntax of grep is as follows:

grep [options] pattern [file(s)]
  • options: Optional flags that modify the behavior of grep.
  • pattern: The pattern or regular expression to search for.
  • file(s): Optional file(s) to search within. If not provided, grep will read from standard input.

Examples

Searching in a Single File

To search for a specific pattern in a single file, use the following command:

grep "pattern" file.txt

Replace "pattern" with the text you want to search for and file.txt with the name of the file you want to search in.

Searching in Multiple Files

If you want to search for a pattern across multiple files, use the following command:

grep "pattern" file1.txt file2.txt file3.txt

You can specify as many files as you want, separating them with spaces.

Ignoring Case

By default, grep is case-sensitive. To perform a case-insensitive search, use the -i option:

grep -i "pattern" file.txt

Displaying Line Numbers

To display line numbers along with the matching lines, use the -n option:

grep -n "pattern" file.txt

This can be helpful when you want to know the line numbers where matches occur.

Searching Recursively

To search for a pattern in all files within a directory and its subdirectories, use the -r option (recursive search):

grep -r "pattern" directory/

Replace directory/ with the path to the directory you want to search in.

Using Regular Expressions

grep supports regular expressions for more advanced pattern matching. Here's an example using a regular expression to search for email addresses:

grep -E "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b" file.txt

In this case, the -E option enables extended regular expressions.

Conclusion

grep is a versatile tool that can greatly enhance your text searching and filtering capabilities. With the knowledge you've gained in this beginner's guide, you can start using grep to quickly find and extract the information you need from text files. Experiment with different options and explore more advanced regular expressions to further expand your skills with grep. Happy grepping!

 

cross-posted from: https://lemmy.run/post/10868

Beginner's Guide to grep

grep is a powerful command-line tool used for searching and filtering text in files. It allows you to find specific patterns or strings within files, making it an invaluable tool for developers, sysadmins, and anyone working with text data. In this guide, we will cover the basics of using grep and provide you with some useful examples to get started.

Installation

grep is a standard utility on most Unix-like systems, including Linux and macOS. If you're using a Windows operating system, you can install it by using the Windows Subsystem for Linux (WSL) or through tools like Git Bash, Cygwin, or MinGW.

Basic Usage

The basic syntax of grep is as follows:

grep [options] pattern [file(s)]
  • options: Optional flags that modify the behavior of grep.
  • pattern: The pattern or regular expression to search for.
  • file(s): Optional file(s) to search within. If not provided, grep will read from standard input.

Examples

Searching in a Single File

To search for a specific pattern in a single file, use the following command:

grep "pattern" file.txt

Replace "pattern" with the text you want to search for and file.txt with the name of the file you want to search in.

Searching in Multiple Files

If you want to search for a pattern across multiple files, use the following command:

grep "pattern" file1.txt file2.txt file3.txt

You can specify as many files as you want, separating them with spaces.

Ignoring Case

By default, grep is case-sensitive. To perform a case-insensitive search, use the -i option:

grep -i "pattern" file.txt

Displaying Line Numbers

To display line numbers along with the matching lines, use the -n option:

grep -n "pattern" file.txt

This can be helpful when you want to know the line numbers where matches occur.

Searching Recursively

To search for a pattern in all files within a directory and its subdirectories, use the -r option (recursive search):

grep -r "pattern" directory/

Replace directory/ with the path to the directory you want to search in.

Using Regular Expressions

grep supports regular expressions for more advanced pattern matching. Here's an example using a regular expression to search for email addresses:

grep -E "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b" file.txt

In this case, the -E option enables extended regular expressions.

Conclusion

grep is a versatile tool that can greatly enhance your text searching and filtering capabilities. With the knowledge you've gained in this beginner's guide, you can start using grep to quickly find and extract the information you need from text files. Experiment with different options and explore more advanced regular expressions to further expand your skills with grep. Happy grepping!

 

Beginner's Guide to grep

grep is a powerful command-line tool used for searching and filtering text in files. It allows you to find specific patterns or strings within files, making it an invaluable tool for developers, sysadmins, and anyone working with text data. In this guide, we will cover the basics of using grep and provide you with some useful examples to get started.

Installation

grep is a standard utility on most Unix-like systems, including Linux and macOS. If you're using a Windows operating system, you can install it by using the Windows Subsystem for Linux (WSL) or through tools like Git Bash, Cygwin, or MinGW.

Basic Usage

The basic syntax of grep is as follows:

grep [options] pattern [file(s)]
  • options: Optional flags that modify the behavior of grep.
  • pattern: The pattern or regular expression to search for.
  • file(s): Optional file(s) to search within. If not provided, grep will read from standard input.

Examples

Searching in a Single File

To search for a specific pattern in a single file, use the following command:

grep "pattern" file.txt

Replace "pattern" with the text you want to search for and file.txt with the name of the file you want to search in.

Searching in Multiple Files

If you want to search for a pattern across multiple files, use the following command:

grep "pattern" file1.txt file2.txt file3.txt

You can specify as many files as you want, separating them with spaces.

Ignoring Case

By default, grep is case-sensitive. To perform a case-insensitive search, use the -i option:

grep -i "pattern" file.txt

Displaying Line Numbers

To display line numbers along with the matching lines, use the -n option:

grep -n "pattern" file.txt

This can be helpful when you want to know the line numbers where matches occur.

Searching Recursively

To search for a pattern in all files within a directory and its subdirectories, use the -r option (recursive search):

grep -r "pattern" directory/

Replace directory/ with the path to the directory you want to search in.

Using Regular Expressions

grep supports regular expressions for more advanced pattern matching. Here's an example using a regular expression to search for email addresses:

grep -E "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b" file.txt

In this case, the -E option enables extended regular expressions.

Conclusion

grep is a versatile tool that can greatly enhance your text searching and filtering capabilities. With the knowledge you've gained in this beginner's guide, you can start using grep to quickly find and extract the information you need from text files. Experiment with different options and explore more advanced regular expressions to further expand your skills with grep. Happy grepping!

 

cross-posted from: https://lemmy.run/post/10475

Testing Service Accounts in Kubernetes

Service accounts in Kubernetes are used to provide a secure way for applications and services to authenticate and interact with the Kubernetes API. Testing service accounts ensures their functionality and security. In this guide, we will explore different methods to test service accounts in Kubernetes.

1. Verifying Service Account Existence

To start testing service accounts, you first need to ensure they exist in your Kubernetes cluster. You can use the following command to list all the available service accounts:

kubectl get serviceaccounts

Verify that the service account you want to test is present in the output. If it's missing, you may need to create it using a YAML manifest or the kubectl create serviceaccount command.

2. Checking Service Account Permissions

After confirming the existence of the service account, the next step is to verify its permissions. Service accounts in Kubernetes are associated with roles or cluster roles, which define what resources and actions they can access.

To check the permissions of a service account, you can use the kubectl auth can-i command. For example, to check if a service account can create pods, run:

kubectl auth can-i create pods --as=system:serviceaccount:<namespace>:<service-account>

Replace <namespace> with the desired namespace and <service-account> with the name of the service account.

3. Testing Service Account Authentication

Service accounts authenticate with the Kubernetes API using bearer tokens. To test service account authentication, you can manually retrieve the token associated with the service account and use it to authenticate requests.

To get the token for a service account, run:

kubectl get secret <service-account-token-secret> -o jsonpath="{.data.token}" | base64 --decode

Replace <service-account-token-secret> with the actual name of the secret associated with the service account. This command decodes and outputs the service account token.

You can then use the obtained token to authenticate requests to the Kubernetes API, for example, by including it in the Authorization header using tools like curl or writing a simple program.

4. Testing Service Account RBAC Policies

Role-Based Access Control (RBAC) policies govern the access permissions for service accounts. It's crucial to test these policies to ensure service accounts have the appropriate level of access.

One way to test RBAC policies is by creating a Pod that uses the service account you want to test and attempting to perform actions that the service account should or shouldn't be allowed to do. Observe the behavior and verify if the access is granted or denied as expected.

5. Automated Testing

To streamline the testing process, you can create automated tests using testing frameworks and tools specific to Kubernetes. For example, the Kubernetes Test Framework (KTF) provides a set of libraries and utilities for writing tests for Kubernetes components, including service accounts.

Using such frameworks allows you to write comprehensive test cases to validate service account behavior, permissions, and RBAC policies automatically.

Conclusion

Testing service accounts in Kubernetes ensures their proper functioning and adherence to security policies. By verifying service account existence, checking permissions, testing authentication, and validating RBAC policies, you can confidently use and rely on service accounts in your Kubernetes deployments.

Remember, service accounts are a critical security component, so it's important to regularly test and review their configuration to prevent unauthorized access and potential security breaches.

 

cross-posted from: https://lemmy.run/post/10206

Creating a Helm Chart for Kubernetes

In this tutorial, we will learn how to create a Helm chart for deploying applications on Kubernetes. Helm is a package manager for Kubernetes that simplifies the deployment and management of applications. By using Helm charts, you can define and version your application deployments as reusable templates.

Prerequisites

Before we begin, make sure you have the following prerequisites installed:

  • Helm: Follow the official Helm documentation for installation instructions.

Step 1: Initialize a Helm Chart

To start creating a Helm chart, open a terminal and navigate to the directory where you want to create your chart. Then, run the following command:

helm create my-chart

This will create a new directory named my-chart with the basic structure of a Helm chart.

Step 2: Customize the Chart

Inside the my-chart directory, you will find several files and directories. The most important ones are:

  • Chart.yaml: This file contains metadata about the chart, such as its name, version, and dependencies.
  • values.yaml: This file defines the default values for the configuration options used in the chart.
  • templates/: This directory contains the template files for deploying Kubernetes resources.

You can customize the chart by modifying these files and adding new ones as needed. For example, you can update the Chart.yaml file with your desired metadata and edit the values.yaml file to set default configuration values.

Step 3: Define Kubernetes Resources

To deploy your application on Kubernetes, you need to define the necessary Kubernetes resources in the templates/ directory. Helm uses the Go template language to generate Kubernetes manifests from these templates.

For example, you can create a deployment.yaml template to define a Kubernetes Deployment:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-deployment
spec:
  replicas: {{ .Values.replicaCount }}
  template:
    metadata:
      labels:
        app: {{ .Release.Name }}
    spec:
      containers:
        - name: {{ .Release.Name }}
          image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
          ports:
            - containerPort: {{ .Values.containerPort }}

This template uses the values defined in values.yaml to customize the Deployment's name, replica count, image, and container port.

Step 4: Package and Install the Chart

Once you have defined your Helm chart and customized the templates, you can package and install it on a Kubernetes cluster. To package the chart, run the following command:

helm package my-chart

This will create a .tgz file containing the packaged chart.

To install the chart on a Kubernetes cluster, use the following command:

helm install my-release my-chart-0.1.0.tgz

Replace my-release with the desired release name and my-chart-0.1.0.tgz with the name of your packaged chart.

Conclusion

Congratulations! You have learned how to create a Helm chart for deploying applications on Kubernetes. By leveraging Helm's package management capabilities, you can simplify the deployment and management of your Kubernetes-based applications.

Feel free to explore the Helm documentation for more advanced features and best practices.

Happy charting!

 

cross-posted from: https://lemmy.run/post/10475

Testing Service Accounts in Kubernetes

Service accounts in Kubernetes are used to provide a secure way for applications and services to authenticate and interact with the Kubernetes API. Testing service accounts ensures their functionality and security. In this guide, we will explore different methods to test service accounts in Kubernetes.

1. Verifying Service Account Existence

To start testing service accounts, you first need to ensure they exist in your Kubernetes cluster. You can use the following command to list all the available service accounts:

kubectl get serviceaccounts

Verify that the service account you want to test is present in the output. If it's missing, you may need to create it using a YAML manifest or the kubectl create serviceaccount command.

2. Checking Service Account Permissions

After confirming the existence of the service account, the next step is to verify its permissions. Service accounts in Kubernetes are associated with roles or cluster roles, which define what resources and actions they can access.

To check the permissions of a service account, you can use the kubectl auth can-i command. For example, to check if a service account can create pods, run:

kubectl auth can-i create pods --as=system:serviceaccount:<namespace>:<service-account>

Replace <namespace> with the desired namespace and <service-account> with the name of the service account.

3. Testing Service Account Authentication

Service accounts authenticate with the Kubernetes API using bearer tokens. To test service account authentication, you can manually retrieve the token associated with the service account and use it to authenticate requests.

To get the token for a service account, run:

kubectl get secret <service-account-token-secret> -o jsonpath="{.data.token}" | base64 --decode

Replace <service-account-token-secret> with the actual name of the secret associated with the service account. This command decodes and outputs the service account token.

You can then use the obtained token to authenticate requests to the Kubernetes API, for example, by including it in the Authorization header using tools like curl or writing a simple program.

4. Testing Service Account RBAC Policies

Role-Based Access Control (RBAC) policies govern the access permissions for service accounts. It's crucial to test these policies to ensure service accounts have the appropriate level of access.

One way to test RBAC policies is by creating a Pod that uses the service account you want to test and attempting to perform actions that the service account should or shouldn't be allowed to do. Observe the behavior and verify if the access is granted or denied as expected.

5. Automated Testing

To streamline the testing process, you can create automated tests using testing frameworks and tools specific to Kubernetes. For example, the Kubernetes Test Framework (KTF) provides a set of libraries and utilities for writing tests for Kubernetes components, including service accounts.

Using such frameworks allows you to write comprehensive test cases to validate service account behavior, permissions, and RBAC policies automatically.

Conclusion

Testing service accounts in Kubernetes ensures their proper functioning and adherence to security policies. By verifying service account existence, checking permissions, testing authentication, and validating RBAC policies, you can confidently use and rely on service accounts in your Kubernetes deployments.

Remember, service accounts are a critical security component, so it's important to regularly test and review their configuration to prevent unauthorized access and potential security breaches.

 

cross-posted from: https://lemmy.run/post/10475

Testing Service Accounts in Kubernetes

Service accounts in Kubernetes are used to provide a secure way for applications and services to authenticate and interact with the Kubernetes API. Testing service accounts ensures their functionality and security. In this guide, we will explore different methods to test service accounts in Kubernetes.

1. Verifying Service Account Existence

To start testing service accounts, you first need to ensure they exist in your Kubernetes cluster. You can use the following command to list all the available service accounts:

kubectl get serviceaccounts

Verify that the service account you want to test is present in the output. If it's missing, you may need to create it using a YAML manifest or the kubectl create serviceaccount command.

2. Checking Service Account Permissions

After confirming the existence of the service account, the next step is to verify its permissions. Service accounts in Kubernetes are associated with roles or cluster roles, which define what resources and actions they can access.

To check the permissions of a service account, you can use the kubectl auth can-i command. For example, to check if a service account can create pods, run:

kubectl auth can-i create pods --as=system:serviceaccount:<namespace>:<service-account>

Replace <namespace> with the desired namespace and <service-account> with the name of the service account.

3. Testing Service Account Authentication

Service accounts authenticate with the Kubernetes API using bearer tokens. To test service account authentication, you can manually retrieve the token associated with the service account and use it to authenticate requests.

To get the token for a service account, run:

kubectl get secret <service-account-token-secret> -o jsonpath="{.data.token}" | base64 --decode

Replace <service-account-token-secret> with the actual name of the secret associated with the service account. This command decodes and outputs the service account token.

You can then use the obtained token to authenticate requests to the Kubernetes API, for example, by including it in the Authorization header using tools like curl or writing a simple program.

4. Testing Service Account RBAC Policies

Role-Based Access Control (RBAC) policies govern the access permissions for service accounts. It's crucial to test these policies to ensure service accounts have the appropriate level of access.

One way to test RBAC policies is by creating a Pod that uses the service account you want to test and attempting to perform actions that the service account should or shouldn't be allowed to do. Observe the behavior and verify if the access is granted or denied as expected.

5. Automated Testing

To streamline the testing process, you can create automated tests using testing frameworks and tools specific to Kubernetes. For example, the Kubernetes Test Framework (KTF) provides a set of libraries and utilities for writing tests for Kubernetes components, including service accounts.

Using such frameworks allows you to write comprehensive test cases to validate service account behavior, permissions, and RBAC policies automatically.

Conclusion

Testing service accounts in Kubernetes ensures their proper functioning and adherence to security policies. By verifying service account existence, checking permissions, testing authentication, and validating RBAC policies, you can confidently use and rely on service accounts in your Kubernetes deployments.

Remember, service accounts are a critical security component, so it's important to regularly test and review their configuration to prevent unauthorized access and potential security breaches.

[–] root@lemmy.run 1 points 2 years ago

Hmm, OpenBSD commands sometime have different behavior than Linux.

I know as I had run into issues with rsync earlier where some options I used on Linux didn't work as same on FreeBSD/OpenBSD.

[–] root@lemmy.run 1 points 2 years ago
[–] root@lemmy.run 1 points 2 years ago (1 children)

Seems like you are trying to build the docker image locally for your service. And you missed the dockerfile which contains all the information about building the container.

[–] root@lemmy.run 1 points 2 years ago

This seems like a bug.

Also it could be that lemmy.world is overloaded and is stuck at processing to clear this.

Keep it documented and submit a bug report so that devs can look at it when they can.

[–] root@lemmy.run 1 points 2 years ago (2 children)

Yeap, this is definitely weird.

How about you try to login in private/incognito?

Do you still see it?

If it is, I would advise you to submit a bug report to lemmy devs here.

[–] root@lemmy.run 1 points 2 years ago (4 children)

Hmm, in that case, try to clean your browser cache.

[–] root@lemmy.run 1 points 2 years ago (6 children)

You can go to the notifications and mark it as read by clicking the checkmark. It should disappear after that.

view more: ‹ prev next ›