Skip to content

k #7

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

k #7

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added 14 namespaces.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified README.md
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
https://github.com/kubernetes/heapster deprecated



Resource Monitoring using Metrics Server

https://github.com/kubernetes/metrics
Empty file modified affinity/node-affinity.yaml
100644 → 100755
Empty file.
Empty file modified affinity/pod-affinity.yaml
100644 → 100755
Empty file.
Empty file modified affinity/pod-anti-affinity-5.yaml
100644 → 100755
Empty file.
Empty file modified affinity/pod-anti-affinity.yaml
100644 → 100755
Empty file.
Empty file modified autoscaling/hpa-example.yml
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions configmap/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
to create ConfigMap for nginx-app
kubectl create configmap nginx-config --from-file=reverseproxy.conf
2 changes: 1 addition & 1 deletion configmap/nginx-service.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: helloworld-nginx-service
spec:
ports:
- port: 80
- port: 8080
protocol: TCP
selector:
app: helloworld-nginx
Expand Down
2 changes: 1 addition & 1 deletion configmap/nginx.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ spec:
- name: nginx
image: nginx:1.11
ports:
- containerPort: 80
- containerPort: 8080
volumeMounts:
- name: config-volume
mountPath: /etc/nginx/conf.d
Expand Down
2 changes: 1 addition & 1 deletion configmap/reverseproxy.conf
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 80;
listen 8080;
server_name localhost;

location / {
Expand Down
Empty file modified dashboard/README.md
100644 → 100755
Empty file.
34 changes: 34 additions & 0 deletions dashboard/ingress.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: kubernetes-dashboard
namespace: kube-system
annotations:
spec:
rules:
- host: dashboard.ktest.progressoft.com
http:
paths:
- path: /
backend:
serviceName: kubernetes-dashboard
servicePort: 443
# apiVersion: extensions/v1beta1
# kind: Ingress
# metadata:
# name: tomcat
# namespace: tomcat
# annotations:
# # letsencrypt support enabled (https://github.com/jetstack/kube-lego)
# #kubernetes.io/tls-acme: "true"
# # use the Kubernetes ingress "nginx"
# #kubernetes.io/ingress.class: "nginx"
# spec:
# rules:
# - host: tomcat.kjenkins.progressoft.com
# http:
# paths:
# - path: /
# backend:
# serviceName: tomcat-svc
# servicePort: 8080
163 changes: 163 additions & 0 deletions dashboard/kuberntes-dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# ------------------- Dashboard Secret ------------------- #

apiVersion: v1
kind: Secret
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard-certs
namespace: kube-system
type: Opaque

---
# ------------------- Dashboard Service Account ------------------- #

apiVersion: v1
kind: ServiceAccount
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system

---
# ------------------- Dashboard Role & Role Binding ------------------- #

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kubernetes-dashboard-minimal
namespace: kube-system
rules:
# Allow Dashboard to create 'kubernetes-dashboard-key-holder' secret.
- apiGroups: [""]
resources: ["secrets"]
verbs: ["create"]
# Allow Dashboard to create 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create"]
# Allow Dashboard to get, update and delete Dashboard exclusive secrets.
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["kubernetes-dashboard-key-holder", "kubernetes-dashboard-certs"]
verbs: ["get", "update", "delete"]
# Allow Dashboard to get and update 'kubernetes-dashboard-settings' config map.
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["kubernetes-dashboard-settings"]
verbs: ["get", "update"]
# Allow Dashboard to get metrics from heapster.
- apiGroups: [""]
resources: ["services"]
resourceNames: ["heapster"]
verbs: ["proxy"]
- apiGroups: [""]
resources: ["services/proxy"]
resourceNames: ["heapster", "http:heapster:", "https:heapster:"]
verbs: ["get"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubernetes-dashboard-minimal
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: kubernetes-dashboard-minimal
subjects:
- kind: ServiceAccount
name: kubernetes-dashboard
namespace: kube-system

---
# ------------------- Dashboard Deployment ------------------- #

kind: Deployment
apiVersion: apps/v1beta2
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
k8s-app: kubernetes-dashboard
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
spec:
containers:
- name: kubernetes-dashboard
image: k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0
ports:
- containerPort: 8443
protocol: TCP
args:
- --auto-generate-certificates
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
volumeMounts:
- name: kubernetes-dashboard-certs
mountPath: /certs
# Create on-disk volume to store exec logs
- mountPath: /tmp
name: tmp-volume
livenessProbe:
httpGet:
scheme: HTTPS
path: /
port: 8443
initialDelaySeconds: 30
timeoutSeconds: 30
volumes:
- name: kubernetes-dashboard-certs
secret:
secretName: kubernetes-dashboard-certs
- name: tmp-volume
emptyDir: {}
serviceAccountName: kubernetes-dashboard
# Comment the following tolerations if Dashboard must not be deployed on master
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule

---
# ------------------- Dashboard Service ------------------- #

kind: Service
apiVersion: v1
metadata:
labels:
k8s-app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
# type: NodePort
ports:
- port: 443
targetPort: 8443
selector:
k8s-app: kubernetes-dashboard
Empty file modified dashboard/sample-user.yaml
100644 → 100755
Empty file.
Empty file modified deployment/helloworld-healthcheck.yml
100644 → 100755
Empty file.
Empty file modified deployment/helloworld-liveness-readiness.yml
100644 → 100755
Empty file.
Empty file modified deployment/helloworld-nodeselector.yml
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions deployment/helloworld-secrets-volumes.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ kind: Deployment
metadata:
name: helloworld-deployment
spec:
replicas: 3
replicas: 2
template:
metadata:
labels:
app: helloworld
spec:
containers:
- name: k8s-demo
image: wardviaene/k8s-demo
image: ammarqqqq/ammar
ports:
- name: nodejs-port
containerPort: 3000
Expand Down
Empty file modified deployment/helloworld-secrets.yml
100644 → 100755
Empty file.
Empty file modified deployment/helloworld.yml
100644 → 100755
Empty file.
Empty file modified elb-tls/helloworld-service.yml
100644 → 100755
Empty file.
Empty file modified elb-tls/helloworld.yml
100644 → 100755
Empty file.
Empty file modified external-dns/README.md
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions external-dns/external-dns.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ spec:
args:
- --source=service
- --source=ingress
- --domain-filter=kubernetes.newtech.academy # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
- --domain-filter=dev.psamman.com # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
- --provider=aws
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
- --aws-zone-type=public # only look at public hosted zones (valid values are public, private or no value for both)
- --registry=txt
- --txt-owner-id=kubernetes.newtech.academy
- --txt-owner-id=dev.psamman.com
4 changes: 2 additions & 2 deletions external-dns/ingress.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ metadata:
name: helloworld-rules
spec:
rules:
- host: helloworld-v1.kubernetes.newtech.academy
- host: hello1.dev.psamman.com
http:
paths:
- path: /
backend:
serviceName: helloworld-v1
servicePort: 80
- host: helloworld-v2.kubernetes.newtech.academy
- host: hello2.dev.psamman.com
http:
paths:
- path: /
Expand Down
2 changes: 1 addition & 1 deletion external-dns/put-node-policy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
DEFAULT_REGION="eu-west-1"
AWS_REGION="${AWS_REGION:-${DEFAULT_REGION}}"

NODE_ROLE="nodes.kubernetes.newtech.academy"
NODE_ROLE="nodes.dev.psamman.com"

export AWS_REGION

Expand Down
2 changes: 1 addition & 1 deletion external-dns/service-l4.yaml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
# Increase the ELB idle timeout to avoid issues with WebSockets or Server-Sent Events.
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: '3600'
# external-dns
external-dns.alpha.kubernetes.io/hostname: ingress.kubernetes.newtech.academy
external-dns.alpha.kubernetes.io/hostname: ingress.dev.psamman.com
spec:
type: LoadBalancer
selector:
Expand Down
Empty file modified first-app/helloworld-nodeport-service.yml
100644 → 100755
Empty file.
Empty file modified first-app/helloworld-service.yml
100644 → 100755
Empty file.
Empty file modified first-app/helloworld.yml
100644 → 100755
Empty file.
Empty file modified helm/README.md
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/.gitignore
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/.helmignore
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/Chart.yaml
100644 → 100755
Empty file.
6 changes: 6 additions & 0 deletions helm/demo-chart/README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ helm install .
```
helm upgrade --set image.tag=v0.0.2,mariadb.db.password=$DB_APP_PASS RELEASE .
```
Initialize helm

kubectl create helm-rbac.yml

helm init --service-account tiller

Empty file modified helm/demo-chart/requirements.lock
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/requirements.yaml
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/templates/NOTES.txt
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/templates/_helpers.tpl
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/templates/deployment.yaml
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/templates/ingress.yaml
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/templates/service.yaml
100644 → 100755
Empty file.
Empty file modified helm/demo-chart/values.yaml
100644 → 100755
Empty file.
Empty file modified helm/helm-rbac.yaml
100644 → 100755
Empty file.
Empty file modified helm/jenkins/Jenkinsfile.build
100644 → 100755
Empty file.
Empty file modified helm/jenkins/Jenkinsfile.deploy
100644 → 100755
Empty file.
Empty file modified helm/jenkins/README.md
100644 → 100755
Empty file.
Empty file modified helm/jenkins/serviceaccount.yaml
100644 → 100755
Empty file.
21 changes: 21 additions & 0 deletions helm/mychart/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
5 changes: 5 additions & 0 deletions helm/mychart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "1.0"
description: A Helm chart for Kubernetes
name: mychart
version: 0.1.0
19 changes: 19 additions & 0 deletions helm/mychart/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range .Values.ingress.hosts }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ . }}{{ $.Values.ingress.path }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "mychart.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc -w {{ template "mychart.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "mychart.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "mychart.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl port-forward $POD_NAME 8080:80
{{- end }}
32 changes: 32 additions & 0 deletions helm/mychart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "mychart.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "mychart.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "mychart.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Loading