Skip to content
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

SBA for 1/11/22 #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3.7

COPY . /app

WORKDIR /app

RUN pip install -r requirements.txt

CMD ["python","web.py"]

Binary file added Screenshot-of-spinning-flask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 113 additions & 0 deletions docker-image-created-using-jenkins-consoleText.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
Started by user Christopher Yang
Running as SYSTEM
Building in workspace C:\ProgramData\Jenkins\.jenkins\workspace\SBA Image
The recommended git tool is: NONE
No credentials specified
> git.exe rev-parse --resolve-git-dir C:\ProgramData\Jenkins\.jenkins\workspace\SBA Image\.git # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/cyanggit/sba2022.kubernetes-cluster.git # timeout=10
Fetching upstream changes from https://github.com/cyanggit/sba2022.kubernetes-cluster.git
> git.exe --version # timeout=10
> git --version # 'git version 2.34.1.windows.1'
> git.exe fetch --tags --force --progress -- https://github.com/cyanggit/sba2022.kubernetes-cluster.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
Checking out Revision ee2e72264551c020e98d0357eace792f279a1d98 (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f ee2e72264551c020e98d0357eace792f279a1d98 # timeout=10
Commit message: "Merge branch 'platformps:master' into master"
> git.exe rev-list --no-walk ee2e72264551c020e98d0357eace792f279a1d98 # timeout=10
[SBA Image] $ docker build -t yang97docker/jenkinsimage --pull=true "C:\ProgramData\Jenkins\.jenkins\workspace\SBA Image"
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
#1 [internal] load build definition from Dockerfile
#1 sha256:ca67fbc9ab29d99e73e4d88c797d3541e0b632cf9635f264fa8cac4bede9412f
#1 transferring dockerfile: 31B 0.0s done
#1 DONE 0.1s

#2 [internal] load .dockerignore
#2 sha256:3632dc56d3f03700df7806be550192e352cb71aa8555006dac426f84d8ace91f
#2 transferring context:
#2 transferring context: 2B 0.0s done
#2 DONE 0.2s

#3 [internal] load metadata for docker.io/library/python:3.7
#3 sha256:2e83735093f2e645c7660e349795ae80186113afc054af8bdc7501e99da12131
#3 ...

#4 [auth] library/python:pull token for registry-1.docker.io
#4 sha256:0cbe15f75b0b6461b5b83c0cdb16a3a73bb8680ddb5c3b172f6cad4ed1077fad
#4 DONE 0.0s

#3 [internal] load metadata for docker.io/library/python:3.7
#3 sha256:2e83735093f2e645c7660e349795ae80186113afc054af8bdc7501e99da12131
#3 DONE 1.6s

#5 [1/4] FROM docker.io/library/python:3.7@sha256:d9abbc0737ff8d23a546859c85903f1b8235a1495a405d5a47cbc55747f27b20
#5 sha256:78d96b187172f9edacdca7a5631287c4e89e2d243ee494fd9a7c621ddb88a1e6
#5 DONE 0.0s

#6 [internal] load build context
#6 sha256:4ce2910355653fa81e1f027237f8f8c65818918f83e2cdb9eb36bbd949a5c984
#6 transferring context: 13.82kB 1.7s done
#6 DONE 2.0s

#7 [2/4] COPY . /app
#7 sha256:3e07cacc8ca823d2d01ea2832fd91615d9e9aceab7d5646ade4da3970cc82cf0
#7 CACHED

#8 [3/4] WORKDIR /app
#8 sha256:48db1fc14292defe75d059206c8ca75b8115c5be8f6446cf43a0752135446b28
#8 CACHED

#9 [4/4] RUN pip install -r requirements.txt
#9 sha256:6165e185e8f18806499a9f2208b4531996e1ecc7a6438bab2abd7604be211414
#9 CACHED

#10 exporting to image
#10 sha256:e8c613e07b0b7ff33893b694f7759a10d42e180f2b4dc349fb57dc6b71dcab00
#10 exporting layers done
#10 writing image sha256:b0fbd0510b03626dd3c81c4959a757a27bfc134e2c373bd9fde40863ed6bb2d6 0.1s done
#10 naming to docker.io/yang97docker/jenkinsimage done
#10 DONE 0.6s
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release

Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[SBA Image] $ docker push yang97docker/jenkinsimage
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
Using default tag: latest
The push refers to repository [docker.io/yang97docker/jenkinsimage]
126c5cad3edf: Preparing
5f70bf18a086: Preparing
b5a2ab634b07: Preparing
11088eb5307c: Preparing
d86f8b9fa813: Preparing
86c81640d929: Preparing
aedcb370b058: Preparing
c3a0d593ed24: Preparing
26a504e63be4: Preparing
8bf42db0de72: Preparing
31892cc314cb: Preparing
11936051f93b: Preparing
86c81640d929: Waiting
aedcb370b058: Waiting
c3a0d593ed24: Waiting
26a504e63be4: Waiting
8bf42db0de72: Waiting
31892cc314cb: Waiting
11936051f93b: Waiting
11088eb5307c: Mounted from yang97docker/sbaimage
d86f8b9fa813: Mounted from yang97docker/sbaimage
5f70bf18a086: Mounted from yang97docker/sbaimage
c3a0d593ed24: Mounted from yang97docker/sbaimage
86c81640d929: Mounted from yang97docker/sbaimage
aedcb370b058: Mounted from yang97docker/sbaimage
26a504e63be4: Mounted from yang97docker/sbaimage
8bf42db0de72: Mounted from yang97docker/sbaimage
31892cc314cb: Mounted from yang97docker/sbaimage
11936051f93b: Mounted from yang97docker/sbaimage
126c5cad3edf: Pushed
b5a2ab634b07: Pushed
latest: digest: sha256:b0e3e1efff4316530a15d1a775e4518a4c85500e5cb6ca37cac2b3425e9b155e size: 2846
Finished: SUCCESS
30 changes: 30 additions & 0 deletions kubernetes-cluster-information-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
==================== Getting the state of the cluster ==================================
Kubernetes control plane is running at https://127.0.0.1:1033
CoreDNS is running at https://127.0.0.1:1033/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
========================================================================================
==================== Getting the list of created services ==============================
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 6d7h
========================================================================================
==================== Getting the list of deployment ====================================
NAME READY UP-TO-DATE AVAILABLE AGE
myapp-deployment 3/3 3 3 10m
========================================================================================
==================== Getting the list of the pods ======================================
NAME READY STATUS RESTARTS AGE
myapp-deployment-d86866f9c-bn4m8 1/1 Running 0 10m
myapp-deployment-d86866f9c-gmqhm 1/1 Running 0 10m
myapp-deployment-d86866f9c-xvflt 1/1 Running 0 10m
========================================================================================
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
myapp-deployment-d86866f9c-bn4m8 1/1 Running 0 10m 172.17.0.5 minikube <none> <none>
myapp-deployment-d86866f9c-gmqhm 1/1 Running 0 10m 172.17.0.4 minikube <none> <none>
myapp-deployment-d86866f9c-xvflt 1/1 Running 0 10m 172.17.0.3 minikube <none> <none>
========================================================================================
NAME READY STATUS RESTARTS AGE
myapp-deployment-d86866f9c-bn4m8 1/1 Running 0 10m
myapp-deployment-d86866f9c-gmqhm 1/1 Running 0 10m
myapp-deployment-d86866f9c-xvflt 1/1 Running 0 10m
======================
18 changes: 18 additions & 0 deletions kubernetes-cluster-information.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#! /bin/bash

echo ==================== Getting the state of the cluster ==================================
kubectl cluster-info
echo ========================================================================================
echo ==================== Getting the list of created services ==============================
kubectl get services
echo ========================================================================================
echo ==================== Getting the list of deployment ====================================
kubectl get deployments
echo ========================================================================================
echo ==================== Getting the list of the pods ======================================
kubectl get pods
echo ========================================================================================
kubectl get pod -o wide
echo ========================================================================================
kubectl get pods -l app=myapp
echo ======================
20 changes: 20 additions & 0 deletions kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: myapp-deployment
spec:
selector:
matchLabels:
app: myapp
replicas: 3 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: myapp
spec:
containers:
- name: myapp
image: yang97docker/sbaimage
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Flask==0.12