-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* K8s deployment resources. * Basic k8s deployment. * Move k8s deployment files to one folder.
- Loading branch information
Showing
16 changed files
with
480 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,5 +49,5 @@ c/client-node/packages/ | |
ed25519 | ||
ed25519.pub | ||
|
||
|
||
|
||
# k8s config | ||
kubeconfig.yaml |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,83 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: grafana-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: grafana | ||
name: grafana | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: grafana | ||
template: | ||
metadata: | ||
labels: | ||
app: grafana | ||
spec: | ||
securityContext: | ||
fsGroup: 472 | ||
supplementalGroups: | ||
- 0 | ||
containers: | ||
- name: grafana | ||
image: grafana/grafana:latest | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 3000 | ||
name: http-grafana | ||
protocol: TCP | ||
readinessProbe: | ||
failureThreshold: 3 | ||
httpGet: | ||
path: /robots.txt | ||
port: 3000 | ||
scheme: HTTP | ||
initialDelaySeconds: 10 | ||
periodSeconds: 30 | ||
successThreshold: 1 | ||
timeoutSeconds: 2 | ||
livenessProbe: | ||
failureThreshold: 3 | ||
initialDelaySeconds: 30 | ||
periodSeconds: 10 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: 3000 | ||
timeoutSeconds: 1 | ||
resources: | ||
requests: | ||
cpu: 250m | ||
memory: 750Mi | ||
volumeMounts: | ||
- mountPath: /var/lib/grafana | ||
name: grafana-pv | ||
volumes: | ||
- name: grafana-pv | ||
persistentVolumeClaim: | ||
claimName: grafana-pvc | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: grafana | ||
spec: | ||
ports: | ||
- port: 3000 | ||
protocol: TCP | ||
targetPort: 3000 | ||
nodePort: 30300 | ||
selector: | ||
app: grafana | ||
sessionAffinity: None | ||
type: LoadBalancer |
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,33 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: nats | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: nats | ||
template: | ||
metadata: | ||
labels: | ||
app: nats | ||
spec: | ||
containers: | ||
- name: nats | ||
image: nats:latest | ||
ports: | ||
- containerPort: 4222 | ||
env: | ||
- name: GOMAXPROCS | ||
value: "1" | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: nats | ||
spec: | ||
selector: | ||
app: nats | ||
ports: | ||
- port: 4222 |
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,57 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: node-exporter | ||
labels: | ||
app: node-exporter | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: node-exporter | ||
template: | ||
metadata: | ||
labels: | ||
app: node-exporter | ||
spec: | ||
containers: | ||
- name: node-exporter | ||
image: prom/node-exporter:latest | ||
args: | ||
- "--path.procfs=/host/proc" | ||
- "--path.rootfs=/rootfs" | ||
- "--path.sysfs=/host/sys" | ||
- "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($()|/)" | ||
env: | ||
- name: GOMAXPROCS | ||
value: "1" | ||
ports: | ||
- containerPort: 9100 | ||
volumeMounts: | ||
- mountPath: /host/proc | ||
name: node-exporter-0 | ||
- mountPath: /host/sys | ||
name: node-exporter-1 | ||
- mountPath: /rootfs | ||
name: node-exporter-2 | ||
restartPolicy: Always | ||
volumes: | ||
- name: node-exporter-0 | ||
emptyDir: {} | ||
- name: node-exporter-1 | ||
emptyDir: {} | ||
- name: node-exporter-2 | ||
emptyDir: {} | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: node-exporter | ||
spec: | ||
selector: | ||
app: node-exporter | ||
ports: | ||
- protocol: "TCP" | ||
port: 9100 | ||
targetPort: 9100 |
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,54 @@ | ||
|
||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: notary-node | ||
spec: | ||
ports: | ||
- name: "api" | ||
port: 8000 | ||
protocol: TCP | ||
targetPort: 8000 | ||
nodePort: 30080 | ||
- name: "gossip" | ||
port: 8080 | ||
protocol: TCP | ||
targetPort: 8080 | ||
nodePort: 30880 | ||
selector: | ||
app: notary-node | ||
sessionAffinity: ClientIP | ||
type: LoadBalancer | ||
|
||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: notary-node-deployment | ||
labels: | ||
app: nota-node | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: notary-node | ||
template: | ||
metadata: | ||
labels: | ||
app: notary-node | ||
spec: | ||
imagePullSecrets: | ||
- name: regcred | ||
containers: | ||
- name: notary-node | ||
image: alogorythmos/computantis | ||
env: | ||
- name: GOMAXPROCS | ||
value: "2" | ||
ports: | ||
- name: tcp-api | ||
containerPort: 8000 | ||
protocol: TCP | ||
- name: tcp-gossip | ||
containerPort: 8080 | ||
protocol: TCP |
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,51 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: prometheus-server-conf | ||
labels: | ||
name: prometheus-server-conf | ||
data: | ||
prometheus.rules: |- | ||
groups: | ||
- name: devopscube demo alert | ||
rules: | ||
- alert: High Pod Memory | ||
expr: sum(container_memory_usage_bytes) > 1 | ||
for: 1m | ||
labels: | ||
severity: slack | ||
annotations: | ||
summary: High Memory Usage | ||
prometheus.yml: |- | ||
global: | ||
scrape_interval: 1m | ||
scrape_configs: | ||
- job_name: 'prometheus' | ||
scrape_interval: 1m | ||
static_configs: | ||
- targets: ['localhost:9090'] | ||
- job_name: 'node' | ||
static_configs: | ||
- targets: ['node-exporter:9100'] | ||
- job_name: 'notary-genesis' | ||
static_configs: | ||
- targets: ['notary-node-genesis:2112'] | ||
- job_name: 'notary-one' | ||
static_configs: | ||
- targets: ['notary-node-one:2112'] | ||
- job_name: 'notary-two' | ||
static_configs: | ||
- targets: ['notary-node-two:2112'] | ||
- job_name: 'webhooks' | ||
static_configs: | ||
- targets: ['webhooks-node:2112'] | ||
- job_name: 'client' | ||
static_configs: | ||
- targets: ['client-node:2112'] |
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,54 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: prometheus-deployment | ||
labels: | ||
app: prometheus | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: prometheus | ||
template: | ||
metadata: | ||
labels: | ||
app: prometheus | ||
spec: | ||
containers: | ||
- name: prometheus | ||
image: prom/prometheus | ||
args: | ||
- "--config.file=/etc/prometheus/prometheus.yml" | ||
- "--storage.tsdb.path=/prometheus/" | ||
env: | ||
- name: GOMAXPROCS | ||
value: "1" | ||
ports: | ||
- containerPort: 9090 | ||
volumeMounts: | ||
- name: prometheus-config-volume | ||
mountPath: /etc/prometheus/ | ||
- name: prometheus-storage-volume | ||
mountPath: /prometheus/ | ||
restartPolicy: Always | ||
volumes: | ||
- name: prometheus-config-volume | ||
configMap: | ||
defaultMode: 420 | ||
name: prometheus-server-conf | ||
|
||
- name: prometheus-storage-volume | ||
emptyDir: {} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: prometheus-service | ||
spec: | ||
selector: | ||
app: prometheus | ||
ports: | ||
- protocol: "TCP" | ||
port: 9090 | ||
targetPort: 9090 | ||
|
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: Secret | ||
metadata: | ||
name: secret-zinc-auth | ||
data: | ||
username: YWRtaW4= | ||
password: emluY3NlcmNo |
Oops, something went wrong.