-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3e0333
commit a4c930f
Showing
28 changed files
with
765 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
12-Microservices-Deployment-on-EKS/kube-manifests-old/01-MySQL-externalName-Service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql | ||
spec: | ||
type: ExternalName | ||
externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com |
69 changes: 69 additions & 0 deletions
69
...ervices-Deployment-on-EKS/kube-manifests-old/02-UserManagementMicroservice-Deployment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: usermgmt-microservice | ||
labels: | ||
app: usermgmt-restapp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: usermgmt-restapp | ||
template: | ||
metadata: | ||
labels: | ||
app: usermgmt-restapp | ||
spec: | ||
initContainers: | ||
- name: init-db | ||
image: busybox:1.31 | ||
command: ['sh', '-c', 'echo -e "Checking for the availability of MySQL Server deployment"; while ! nc -z mysql 3306; do sleep 1; printf "-"; done; echo -e " >> MySQL DB Server has started";'] | ||
containers: | ||
- name: usermgmt-restapp | ||
image: stacksimplify/kube-usermanagement-microservice:1.0.0 | ||
ports: | ||
- containerPort: 8095 | ||
env: | ||
- name: DB_HOSTNAME | ||
value: "mysql" | ||
- name: DB_PORT | ||
value: "3306" | ||
- name: DB_NAME | ||
value: "usermgmt" | ||
- name: DB_USERNAME | ||
value: "dbadmin" | ||
- name: DB_PASSWORD | ||
valueFrom: | ||
secretKeyRef: | ||
name: mysql-db-password | ||
key: db-password | ||
- name: NOTIFICATION_SERVICE_HOST | ||
value: "notification-clusterip-service" | ||
- name: NOTIFICATION_SERVICE_PORT | ||
value: "8096" | ||
livenessProbe: | ||
exec: | ||
command: | ||
- /bin/sh | ||
- -c | ||
- nc -z localhost 8095 | ||
initialDelaySeconds: 60 | ||
periodSeconds: 10 | ||
readinessProbe: | ||
httpGet: | ||
path: /usermgmt/health-status | ||
port: 8095 | ||
initialDelaySeconds: 60 | ||
periodSeconds: 10 | ||
--- | ||
# Kubernetes Secrets | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: mysql-db-password | ||
#type: Opaque means that from kubernetes's point of view the contents of this Secret is unstructured, it can contain arbitrary key-value pairs. In contrast, there is the Secret storing ServiceAccount credentials, or the ones used as ImagePullSecret . These have a constrained contents. | ||
type: Opaque | ||
data: | ||
# Output of echo -n 'dbpassword11' | base64 | ||
db-password: ZGJwYXNzd29yZDEx | ||
|
16 changes: 16 additions & 0 deletions
16
12-Microservices-Deployment-on-EKS/kube-manifests-old/03-UserManagement-NodePort-Service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: usermgmt-restapp-nodeport-service | ||
labels: | ||
app: usermgmt-restapp | ||
annotations: | ||
#Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer | ||
alb.ingress.kubernetes.io/healthcheck-path: /usermgmt/health-status | ||
spec: | ||
type: NodePort | ||
selector: | ||
app: usermgmt-restapp | ||
ports: | ||
- port: 8095 | ||
targetPort: 8095 |
31 changes: 31 additions & 0 deletions
31
...oservices-Deployment-on-EKS/kube-manifests-old/04-NotificationMicroservice-Deployment.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: notification-microservice | ||
labels: | ||
app: notification-restapp | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: notification-restapp | ||
template: | ||
metadata: | ||
labels: | ||
app: notification-restapp | ||
spec: | ||
containers: | ||
- name: notification-service | ||
image: stacksimplify/kube-notifications-microservice:1.0.0 | ||
ports: | ||
- containerPort: 8096 | ||
imagePullPolicy: Always | ||
env: | ||
- name: AWS_MAIL_SERVER_HOST | ||
value: "smtp-service" | ||
- name: AWS_MAIL_SERVER_USERNAME | ||
value: "AKIASUF7HC7SQJ6BCLVS" | ||
- name: AWS_MAIL_SERVER_PASSWORD | ||
value: "BARcmLiC68wgmhTy/cQvz/E8vFzeizGqdeASNtCs6+Nv" | ||
- name: AWS_MAIL_SERVER_FROM_ADDRESS | ||
value: "[email protected]" |
7 changes: 7 additions & 0 deletions
7
...yment-on-EKS/kube-manifests-old/05-NotificationMicroservice-SMTP-externalName-Service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: smtp-service | ||
spec: | ||
type: ExternalName | ||
externalName: email-smtp.us-east-1.amazonaws.com |
13 changes: 13 additions & 0 deletions
13
...es-Deployment-on-EKS/kube-manifests-old/06-NotificationMicroservice-ClusterIP-Service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: notification-clusterip-service | ||
labels: | ||
app: notification-restapp | ||
spec: | ||
type: ClusterIP | ||
selector: | ||
app: notification-restapp | ||
ports: | ||
- port: 8096 | ||
targetPort: 8096 |
41 changes: 41 additions & 0 deletions
41
...services-Deployment-on-EKS/kube-manifests-old/07-ALB-Ingress-SSL-Redirect-ExternalDNS.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Annotations Reference: https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/ | ||
apiVersion: extensions/v1beta1 | ||
kind: Ingress | ||
metadata: | ||
name: eks-microservices-demo | ||
labels: | ||
app: usermgmt-restapp | ||
annotations: | ||
# Ingress Core Settings | ||
kubernetes.io/ingress.class: "alb" | ||
alb.ingress.kubernetes.io/scheme: internet-facing | ||
# Health Check Settings | ||
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP | ||
alb.ingress.kubernetes.io/healthcheck-port: traffic-port | ||
alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15' | ||
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5' | ||
alb.ingress.kubernetes.io/success-codes: '200' | ||
alb.ingress.kubernetes.io/healthy-threshold-count: '2' | ||
alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' | ||
## SSL Settings | ||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]' | ||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:180789647333:certificate/9f042b5d-86fd-4fad-96d0-c81c5abc71e1 | ||
#alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-1-2017-01 #Optional (Picks default if not used) | ||
# SSL Redirect Setting | ||
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}' | ||
# External DNS - For creating a Record Set in Route53 | ||
external-dns.alpha.kubernetes.io/hostname: services.kubeoncloud.com, ums.kubeoncloud.com | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /* # SSL Redirect Setting | ||
backend: | ||
serviceName: ssl-redirect | ||
servicePort: use-annotation | ||
- path: /* | ||
backend: | ||
serviceName: usermgmt-restapp-nodeport-service | ||
servicePort: 8095 | ||
# Important Note-1: In path based routing order is very important, if we are going to use "/*", try to use it at the end of all rules. | ||
|
34 changes: 19 additions & 15 deletions
34
...icroservices-Deployment-on-EKS/kube-manifests/07-ALB-Ingress-SSL-Redirect-ExternalDNS.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,45 @@ | ||
# Annotations Reference: https://kubernetes-sigs.github.io/aws-alb-ingress-controller/guide/ingress/annotation/ | ||
apiVersion: extensions/v1beta1 | ||
# Annotations Reference: https://kubernetes-sigs.github.io/aws-load-balancer-controller/latest/guide/ingress/annotations/ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: eks-microservices-demo | ||
labels: | ||
app: usermgmt-restapp | ||
runon: fargate | ||
namespace: ns-ums | ||
annotations: | ||
# Load Balancer Name | ||
alb.ingress.kubernetes.io/load-balancer-name: eks-microservices-demo | ||
# Ingress Core Settings | ||
kubernetes.io/ingress.class: "alb" | ||
#kubernetes.io/ingress.class: "alb" (OLD INGRESS CLASS NOTATION - STILL WORKS BUT RECOMMENDED TO USE IngressClass Resource) | ||
alb.ingress.kubernetes.io/scheme: internet-facing | ||
# Health Check Settings | ||
alb.ingress.kubernetes.io/healthcheck-protocol: HTTP | ||
alb.ingress.kubernetes.io/healthcheck-port: traffic-port | ||
#Important Note: Need to add health check path annotations in service level if we are planning to use multiple targets in a load balancer | ||
alb.ingress.kubernetes.io/healthcheck-interval-seconds: '15' | ||
alb.ingress.kubernetes.io/healthcheck-timeout-seconds: '5' | ||
alb.ingress.kubernetes.io/success-codes: '200' | ||
alb.ingress.kubernetes.io/healthy-threshold-count: '2' | ||
alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' | ||
alb.ingress.kubernetes.io/unhealthy-threshold-count: '2' | ||
## SSL Settings | ||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]' | ||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:180789647333:certificate/9f042b5d-86fd-4fad-96d0-c81c5abc71e1 | ||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:180789647333:certificate/d86de939-8ffd-410f-adce-0ce1f5be6e0d | ||
#alb.ingress.kubernetes.io/ssl-policy: ELBSecurityPolicy-TLS-1-1-2017-01 #Optional (Picks default if not used) | ||
# SSL Redirect Setting | ||
alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}' | ||
alb.ingress.kubernetes.io/ssl-redirect: '443' | ||
# External DNS - For creating a Record Set in Route53 | ||
external-dns.alpha.kubernetes.io/hostname: services.kubeoncloud.com, ums.kubeoncloud.com | ||
external-dns.alpha.kubernetes.io/hostname: services.kubeoncloud.com, ums.kubeoncloud.com | ||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /* # SSL Redirect Setting | ||
paths: | ||
- path: / | ||
pathType: Prefix | ||
backend: | ||
serviceName: ssl-redirect | ||
servicePort: use-annotation | ||
- path: /* | ||
backend: | ||
serviceName: usermgmt-restapp-nodeport-service | ||
servicePort: 8095 | ||
service: | ||
name: usermgmt-restapp-nodeport-service | ||
port: | ||
number: 8095 | ||
# Important Note-1: In path based routing order is very important, if we are going to use "/*", try to use it at the end of all rules. | ||
|
Binary file added
BIN
+6 KB
...-Distributed-Tracing-using-AWS-XRay-on-EKS/kube-manifests-old/01-XRay-DaemonSet/.DS_Store
Binary file not shown.
88 changes: 88 additions & 0 deletions
88
...Tracing-using-AWS-XRay-on-EKS/kube-manifests-old/01-XRay-DaemonSet/xray-k8s-daemonset.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: xray-daemon | ||
name: xray-daemon | ||
namespace: default | ||
# Update IAM Role ARN created for X-Ray access | ||
annotations: | ||
eks.amazonaws.com/role-arn: arn:aws:iam::180789647333:role/eksctl-eksdemo1-addon-iamserviceaccount-defa-Role1-VR2R60B6MMDV | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: xray-daemon | ||
namespace: default | ||
spec: | ||
updateStrategy: | ||
type: RollingUpdate | ||
selector: | ||
matchLabels: | ||
app: xray-daemon | ||
template: | ||
metadata: | ||
labels: | ||
app: xray-daemon | ||
spec: | ||
serviceAccountName: xray-daemon | ||
volumes: | ||
- name: config-volume | ||
configMap: | ||
name: "xray-config" | ||
containers: | ||
- name: xray-daemon | ||
image: amazon/aws-xray-daemon:3.2.0 | ||
command: ["/usr/bin/xray", "-c", "/aws/xray/config.yaml"] | ||
resources: | ||
requests: | ||
cpu: 256m | ||
memory: 32Mi | ||
limits: | ||
cpu: 512m | ||
memory: 64Mi | ||
ports: | ||
- name: xray-ingest | ||
containerPort: 2000 | ||
hostPort: 2000 | ||
protocol: UDP | ||
- name: xray-tcp | ||
containerPort: 2000 | ||
hostPort: 2000 | ||
protocol: TCP | ||
volumeMounts: | ||
- name: config-volume | ||
mountPath: /aws/xray | ||
readOnly: true | ||
--- | ||
# Configuration for AWS X-Ray daemon | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: xray-config | ||
namespace: default | ||
data: | ||
config.yaml: |- | ||
TotalBufferSizeMB: 24 | ||
Socket: | ||
UDPAddress: "0.0.0.0:2000" | ||
TCPAddress: "0.0.0.0:2000" | ||
Version: 2 | ||
--- | ||
# k8s service definition for AWS X-Ray daemon headless service | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: xray-service | ||
namespace: default | ||
spec: | ||
selector: | ||
app: xray-daemon | ||
clusterIP: None | ||
ports: | ||
- name: xray-ingest | ||
port: 2000 | ||
protocol: UDP | ||
- name: xray-tcp | ||
port: 2000 | ||
protocol: TCP |
7 changes: 7 additions & 0 deletions
7
...sing-AWS-XRay-on-EKS/kube-manifests-old/02-Applications/01-MySQL-externalName-Service.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: mysql | ||
spec: | ||
type: ExternalName | ||
externalName: usermgmtdb.cxojydmxwly6.us-east-1.rds.amazonaws.com |
Oops, something went wrong.