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

JohnNoel-Week10-SBA #7

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
80 changes: 80 additions & 0 deletions Docker-Image-Creating-with-Jenkins-consoleText.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Started by user jnoel
Running as SYSTEM
[EnvInject] - Loading node environment variables.
Building on the built-in node in workspace /var/lib/jenkins/workspace/jenkins-docker-integration
The recommended git tool is: NONE
No credentials specified
> git rev-parse --resolve-git-dir /var/lib/jenkins/workspace/jenkins-docker-integration/.git # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/johnenoel/sba2022.kubernetes-cluster-Jan10.git # timeout=10
Fetching upstream changes from https://github.com/johnenoel/sba2022.kubernetes-cluster-Jan10.git
> git --version # timeout=10
> git --version # 'git version 2.32.0'
> git fetch --tags --force --progress -- https://github.com/johnenoel/sba2022.kubernetes-cluster-Jan10.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
Checking out Revision 722e7b8d7aee9820b2bebfe31e26f31b879d220f (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f 722e7b8d7aee9820b2bebfe31e26f31b879d220f # timeout=10
Commit message: "2nd commit of the shell script"
> git rev-list --no-walk 722e7b8d7aee9820b2bebfe31e26f31b879d220f # timeout=10
[jenkins-docker-integration] $ /bin/sh -xe /tmp/jenkins9421910677313803355.sh
+ echo 'this is test'
this is test
[jenkins-docker-integration] $ docker build -t johnenoel/k8s-sba-image --pull=true /var/lib/jenkins/workspace/jenkins-docker-integration
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
Sending build context to Docker daemon 7.437MB
Step 1/5 : FROM python
latest: Pulling from library/python
Digest: sha256:6d2551cd76593672929813669bf7fbbd2f2c454a400b084a87122dc12fef8563
Status: Image is up to date for python:latest
---> a5d7930b60cc
Step 2/5 : COPY . /app
---> Using cache
---> 3acfc4d05bc6
Step 3/5 : WORKDIR /app
---> Using cache
---> 23a591d3fb04
Step 4/5 : RUN pip install -r requirements.txt
---> Using cache
---> b9ab70f27040
Step 5/5 : CMD ["python","web.py"]
---> Using cache
---> 5772a83e34bb
Successfully built 5772a83e34bb
Successfully tagged johnenoel/k8s-sba-image:latest
[jenkins-docker-integration] $ docker inspect 5772a83e34bb
WARNING: Support for the legacy ~/.dockercfg configuration file and file-format is deprecated and will be removed in an upcoming release
[jenkins-docker-integration] $ docker push johnenoel/k8s-sba-image
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/johnenoel/k8s-sba-image]
76d92eb4a1e9: Preparing
e6ff401964bc: Preparing
db8d0fe6cf95: Preparing
00901a4c6fc7: Preparing
7e7decd61f68: Preparing
aedcb370b058: Preparing
c3a0d593ed24: Preparing
26a504e63be4: Preparing
8bf42db0de72: Preparing
31892cc314cb: Preparing
11936051f93b: Preparing
aedcb370b058: Waiting
c3a0d593ed24: Waiting
26a504e63be4: Waiting
8bf42db0de72: Waiting
31892cc314cb: Waiting
11936051f93b: Waiting
00901a4c6fc7: Mounted from johnenoel/next-image
e6ff401964bc: Mounted from johnenoel/next-image
7e7decd61f68: Mounted from johnenoel/next-image
76d92eb4a1e9: Mounted from johnenoel/next-image
db8d0fe6cf95: Mounted from johnenoel/next-image
8bf42db0de72: Mounted from johnenoel/next-image
26a504e63be4: Mounted from johnenoel/next-image
aedcb370b058: Mounted from johnenoel/next-image
c3a0d593ed24: Mounted from johnenoel/next-image
31892cc314cb: Mounted from johnenoel/next-image
11936051f93b: Mounted from johnenoel/next-image
latest: digest: sha256:c2dd5771a5a4fd138ad76052fefc012d073d214b46b9b2ab19baea878bed47c6 size: 2640
Finished: SUCCESS
Expand Down
9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM python

COPY . /app

WORKDIR /app

RUN pip install -r requirements.txt

CMD ["python","web.py"]
Binary file added Spinning_Flask_Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 70 additions & 0 deletions kubernetes-cluster-information-output
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
====================NAME: JOHN E NOEL ==================================================
==================== Cloud DevOps Program =============================================
========================================================================================
==================== Getting: kubectl cluster-info =====================================
Kubernetes control plane is running at https://127.0.0.1:62168
CoreDNS is running at https://127.0.0.1:62168/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
========================================================================================
========================================================================================
==================== Getting: kubectl get services =====================================
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
balanced LoadBalancer 10.104.184.132 <pending> 8080:31814/TCP 6d12h
hello-minikube NodePort 10.98.116.34 <none> 8080:32224/TCP 6d12h
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 6d13h
mysql ClusterIP None <none> 3306/TCP 34h
========================================================================================
========================================================================================
===================== Getting: kubectl get services -o wide ============================
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
balanced LoadBalancer 10.104.184.132 <pending> 8080:31814/TCP 6d12h app=balanced
hello-minikube NodePort 10.98.116.34 <none> 8080:32224/TCP 6d12h app=hello-minikube
kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 6d13h <none>
mysql ClusterIP None <none> 3306/TCP 34h app=mysql
========================================================================================
========================================================================================
==================== Getting: minikube IP Address =====================================
192.168.49.2
========================================================================================
========================================================================================
==================== Getting: kubectl get deployments info =============================
NAME READY UP-TO-DATE AVAILABLE AGE
myk8sapp-deployment 3/3 3 3 20m
mysql 1/1 1 1 34h
========================================================================================
========================================================================================
==================== Getting: kubectl get pods info ====================================
NAME READY STATUS RESTARTS AGE
myk8sapp-deployment-7cc57899dd-5vqxc 1/1 Running 0 20m
myk8sapp-deployment-7cc57899dd-jdnkq 1/1 Running 0 20m
myk8sapp-deployment-7cc57899dd-vvs9r 1/1 Running 0 20m
mysql-68579b78bb-6n5lc 1/1 Running 0 34h
========================================================================================
========================================================================================
==================== Getting: kubectl get pod -o wide info =============================
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
myk8sapp-deployment-7cc57899dd-5vqxc 1/1 Running 0 20m 172.17.0.14 minikube <none> <none>
myk8sapp-deployment-7cc57899dd-jdnkq 1/1 Running 0 20m 172.17.0.15 minikube <none> <none>
myk8sapp-deployment-7cc57899dd-vvs9r 1/1 Running 0 20m 172.17.0.8 minikube <none> <none>
mysql-68579b78bb-6n5lc 1/1 Running 0 34h 172.17.0.5 minikube <none> <none>
========================================================================================
========================================================================================
==================== Getting kubectl get pods -l app=myk8sapp =============================
NAME READY STATUS RESTARTS AGE
myk8sapp-deployment-7cc57899dd-5vqxc 1/1 Running 0 20m
myk8sapp-deployment-7cc57899dd-jdnkq 1/1 Running 0 20m
myk8sapp-deployment-7cc57899dd-vvs9r 1/1 Running 0 20m
========================================================================================
========================================================================================
==================== Getting: kubectl get nodes info ===================================
NAME STATUS ROLES AGE VERSION
minikube Ready control-plane,master 6d13h v1.22.3
========================================================================================
========================================================================================
==================== Getting: kubectl get replicaset info ==============================
NAME DESIRED CURRENT READY AGE
myk8sapp-deployment-7cc57899dd 3 3 3 20m
mysql-68579b78bb 1 1 1 34h
========================================================================================
========================================================================================
47 changes: 47 additions & 0 deletions kubernetes-cluster-information.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#! /bin/bash

echo ====================NAME: JOHN E NOEL ==================================================
echo ==================== Cloud DevOps Program =============================================
echo ========================================================================================
echo ==================== Getting: kubectl cluster-info =====================================
kubectl cluster-info
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting: kubectl get services =====================================
kubectl get services
echo ========================================================================================
echo ========================================================================================
echo ===================== Getting: kubectl get services -o wide ============================
kubectl get services -o wide
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting: minikube IP Address =====================================
minikube ip
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting: kubectl get deployments info =============================
kubectl get deployments
echo ========================================================================================
echo ========================================================================================

echo ==================== Getting: kubectl get pods info ====================================
kubectl get pods
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting: kubectl get pod -o wide info =============================
kubectl get pod -o wide
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting kubectl get pods -l app=myk8sapp =============================
kubectl get pods -l app=myk8sapp
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting: kubectl get nodes info ===================================
kubectl get nodes
echo ========================================================================================
echo ========================================================================================
echo ==================== Getting: kubectl get replicaset info ==============================
kubectl get replicaset
echo ========================================================================================
echo ========================================================================================

21 changes: 21 additions & 0 deletions kubernetes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: myk8sapp-deployment
spec:
selector:
matchLabels:
app: myk8sapp
replicas: 3 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
app: myk8sapp
spec:
containers:
- name: myk8sapp
image: johnenoel/k8s-sba-image
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