Skip to content

Instantly share code, notes, and snippets.

View Zhbert's full-sized avatar

Konstantin Nezhbert Zhbert

View GitHub Profile
@Zhbert
Zhbert / hello.sh
Created March 22, 2022 11:27
hello.sh script
#!/bin/sh
RESPONSE="Hello, werfer!"
while true; do
printf "HTTP/1.1 200 OK\n\n$RESPONSE\n" | ncat -lp 8000
done
@Zhbert
Zhbert / Dockerfile
Created March 22, 2022 11:32
Dockefile werf
FROM alpine:3.14
WORKDIR /app
# Install application dependencies.
RUN apk add --no-cache --update nmap-ncat
# Add the application script for running an echo server to the image
# and set permission to execute.
COPY hello.sh .
RUN chmod +x hello.sh
@Zhbert
Zhbert / werf.yaml
Created March 22, 2022 11:33
werf.yaml
project: werf-first-app
configVersion: 1
---
image: app
dockerfile: Dockerfile
@Zhbert
Zhbert / werf build output
Created March 22, 2022 11:35
werf build output
┌ ⛵ image app
│ ┌ Building stage app/dockerfile
│ │ app/dockerfile Sending build context to Docker daemon 4.096kB
│ │ app/dockerfile Step 1/13 : FROM alpine:3.14
│ │ app/dockerfile ---> 0a97eee8041e
│ │ app/dockerfile Step 2/13 : WORKDIR /app
│ │ app/dockerfile ---> Running in d4c535c0d754
│ │ app/dockerfile Removing intermediate container d4c535c0d754
│ │ app/dockerfile ---> 5a2a81813edc
│ │ app/dockerfile Step 3/13 : RUN apk add --no-cache --update nmap-ncat
@Zhbert
Zhbert / gist:83b7baef229697bc3648e2a12966f96e
Created March 22, 2022 11:53
kubectl get --all-namespaces pod
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-78fcd69978-qldbj 1/1 Running 0 14m
kube-system etcd-minikube 1/1 Running 0 14m
kube-system kube-apiserver-minikube 1/1 Running 0 14m
kube-system kube-controller-manager-minikube 1/1 Running 0 14m
kube-system kube-proxy-5hrfd 1/1 Running 0 14m
kube-system kube-scheduler-minikube 1/1 Running 0 14m
kube-system storage-provisioner 1/1 Running 1 (13m ago) 14m
@Zhbert
Zhbert / gist:fb1aac45b0beda747e0c36fd850ef022
Created March 22, 2022 12:04
kubectl -n ingress-nginx get pod
NAME READY STATUS RESTARTS AGE
ingress-nginx-admission-create--1-xn4wr 0/1 Completed 0 6m19s
ingress-nginx-admission-patch--1-dzxt6 0/1 Completed 0 6m19s
ingress-nginx-controller-69bdbc4d57-bp27q 1/1 Running 0 6m19s
@Zhbert
Zhbert / error.html
Created March 22, 2022 12:09
404 error html
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
.
├── Dockerfile
├── .dockerignore
├── hello.sh
├── .helm
│ └── templates
│ ├── deployment.yaml
│ ├── ingress.yaml
│ └── service.yaml
└── werf.yaml
@Zhbert
Zhbert / deployment.yaml
Created March 22, 2022 12:18
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: werf-first-app
spec:
replicas: 1
selector:
matchLabels:
app: werf-first-app
template:
@Zhbert
Zhbert / Service.yaml
Created March 22, 2022 12:26
Service
apiVersion: v1
kind: Service
metadata:
name: werf-first-app
spec:
selector:
app: werf-first-app
ports:
- name: http
port: 8000