Part 1 — Getting Started

  1. Download Struts 2
  2. Create a dynamic web project in Eclipse
  3. Include struts jar files that are downloaded
  4. Create struts.xml file
  5. Write action classes
  6. Inside the struts.xml file, mention struts dtd and in <struts> tag mention package tag
  7. Inside the package tag, mention mapping between action and request…

A reference before exam

Why Azure?

  1. build on ur terms
  2. trust ur network
  3. operate hybrid seamlessly

Market place — partner solutions optimized to run in azure, over 8000 solutions so far

Infra —
uses virtualization
os and hardware separated using hypervisor

Each server rack is attached with fabric controller software
Multiple server racks…

Network Policy

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: test-network-policy
namespace: default
spec:
podSelector:
matchLabels:
role: db
policyTypes:
- Ingress
- Egress
ingress:
- from:
- ipBlock:
cidr: 172.17.0.0/16
except:
- 172.17.1.0/24
- namespaceSelector:
matchLabels:
project: myproject
- podSelector:
matchLabels:
role: frontend
ports:
- protocol: TCP
port: 6379
egress:
- to:
- ipBlock:
cidr: 10.0.0.0/24
ports:
- protocol: TCP
port: 5978

Config Maps

apiVersion: v1
kind: ConfigMap
metadata:
name: game-demo
data:
# property-like keys; each key maps to a simple value
player_initial_lives: "3"
ui_properties_file_name: "user-interface.properties"

# file-like keys
game.properties: |
enemy.types=aliens,monsters
player.maximum-lives=5

user-interface.properties: |
color.good=purple
color.bad=yellow
allow.textmode=true

The KUBECONFIG environment variable holds a list of kubeconfig files.

Node & Pod Affinity/Anti-Affinity, Taints and Tolerations

Scheduler is a Kubernetes controller listening if a new pod is created and figure out right node by filtering and scoring

Node Affinity/Anti-Affinity

Affinity: If we need a pod to be in a node, based on key-label and value-label
Anti-Affinity: We don't want two replicas of pods in the same node

Node Affinity

Pod Anti-Affinity

Load balancing, Networking plugins, CNI

Docker Networking

3 default networking types — None, Host, Bridge (docker0 network)

Containers are launched on Docker bridge

Advanced Concepts — Stateful applications

This article is part 2 of https://amulyareddyk97.medium.com/advanced-kubernetes-with-doks-d5fdd829eed4. Please go through the link.

  1. Volumes and Claims
  2. Life cycle of volumes and claims
  3. Provisioning types
  4. Binding and Mounting volume
  5. Statefulsets
# Containers are not persistent
# PV is accessible at cluster level, independent of pods
# PVs life cycle is not tied to container…

A distributed streaming platform

What is Kafka for?

Is a producer consumer system.

Terminology

  1. Partition — Topics are partitioned for faster read and write of the data

Kafka in Spring

Annotation : @KafkaListener

Logic

import org.springframework.core.task.SimpleAsyncTaskExecutor;
import org.springframework.core.task.TaskExecutor;
import org.springframework.kafka.annotation.KafkaListener;
import org.apache.kafka.clients.admin.NewTopic;
private final TaskExecutor exec = new SimpleAsyncTaskExecutor();@KafkaListener(id = "fooGroup", topics = "topic1")
public void listen(Foo2 foo) {
this.exec.execute(() -> {} );
}
@Bean
public NewTopic topic() {
return new NewTopic("topic1", 1, (short) 1);
}

Controller

@Autowired private KafkaTemplate<Object, Object> template; @PostMapping(path = "/send/foo/{what}") 
public void sendFoo(@PathVariable String what) {
this.template.send("topic1", new Foo1(what));
}

Kafka APIs

Admin API (inspect topics), Producer API (write), Consumer API (read), Kafka Streams API, Kafka Connect API

Shark, MLpack, Dlib, OpenCV Libraries

SHARK

Used in: Regression tasks

Installation:

sudo apt-get install cmake cmake-curses-gui libatlas-base-dev libboost-all-dev# Download package
mkdir build
cd build
cmake ..
make -j

Headers:

#include <shark/ObjectiveFunctions/Loss/SquaredLoss.h>
#include <shark/Algorithms/Trainers/LinearRegression.h>

Compile:

-std=c++11 -lboost_serialization -lshark -lcblas

MLPACK

Used in: Clustering tasks

Installation:

apt-get install libboost-math-dev libboost-program-options-dev libboost-test-dev libboost-serialization-dev libarmadillo-dev binutils-dev

Spring Boot

Parameters like password, db connection data, dev parameters, test parameters etc should be maintained in a separately called configuration. This is possible by maintaining .yml file or .properties file.

  1. .properties file contains the key value pairs and are accessed in the microservice by @Value(“$key”) annotation before a variable declaration.
  2. .yml

Amulya Reddy Konda

Consultant

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store