Skip to content

Instantly share code, notes, and snippets.

View goindwalia's full-sized avatar

Gursimran Singh goindwalia

  • India
View GitHub Profile
FROM microsoft/dotnet:1.1-sdk
# Setting Home Directory for application
WORKDIR /app
# copy csproj and restore as distinct layers
COPY dotnetapp.csproj .
RUN dotnet restore
# copy and build everything else
COPY . .
< name of your application >-1349584344-uah2u 1/1 Running 0 22d 10.233.84.18 k8-master
$ kubectl get svc --namespace=<namespace of kubernetes> | grep <application name>
$ kubectl get po --namespace=<namespace of kubernetes> | grep <application name>
$ kubectl create -f <name of application>.deployment.yml
$ kubectl create -f <name of application>.service.yml
apiVersion: v1
kind: Service
metadata:
labels:
k8s-app: <name of application>
name: <name of application>
namespace: <namespace of Kubernetes>
spec:
type: NodePort
ports:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: <name of application>
namespace: <namespace of Kubernetes>
spec:
replicas: 1
template:
metadata:
labels:
$ docker push <your docker account >/<name of your repository >:<version of your application>
$ docker tag <name of your application>:<version of your application> <your docker hub account >/<name of your repository >:<version of your application>