![]() |
VOOZH | about |
We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.
Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.
Follow TNS on your favorite social media networks.
Become a TNS follower on LinkedIn.
Check out the latest featured and trending stories while you wait for your first TNS newsletter.
export PROJECT=’<Your GCP Project ID>’ gcloud container --project $PROJECT clusters create "tns-demo" \ --zone "asia-south1-a" \ --username "admin" \ --cluster-version "1.11.7-gke.4" \ --machine-type "n1-standard-4" \ --image-type "UBUNTU" \ --disk-type "pd-ssd" \ --disk-size "50" \ --scopes "https://www.googleapis.com/auth/compute","https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" \ --num-nodes "3" \ --enable-cloud-logging \ --enable-cloud-monitoring \ --network "default" \ --addons HorizontalPodAutoscaling,HttpLoadBalancing,KubernetesDashboard
gcloud container clusters get-credentials tns-demo \ --zone asia-south1-a \ --project $PROJECT
kubectl create clusterrolebinding cluster-admin-binding \ --clusterrole cluster-admin \ --user $(gcloud config get-value account)
kubectl version --short | awk -Fv '/Server Version: / {print $3}'
kind: StorageClass apiVersion: storage.k8s.io/v1beta1 metadata: name: px-sc provisioner: kubernetes.io/portworx-volume parameters: repl: "3"
kubectl create -f px-sc.yaml
kind: PersistentVolumeClaim apiVersion: v1 metadata: name: px-mongo-pvc annotations: volume.beta.kubernetes.io/storage-class: px-sc spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi
kubectl create -f px-mongo-pvc.yaml
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: db labels: name: mongo app: todoapp spec: strategy: rollingUpdate: maxSurge: 1 maxUnavailable: 1 type: RollingUpdate replicas: 1 template: metadata: labels: name: mongo app: todoapp spec: schedulerName: stork containers: - name: mongo image: mongo imagePullPolicy: "Always" ports: - containerPort: 27017 volumeMounts: - mountPath: /data/db name: mongodb volumes: - name: mongodb persistentVolumeClaim: claimName: px-mongo-pvc
kubectl create -f db-pod.yaml
apiVersion: v1 kind: Service metadata: name: db labels: name: mongo app: todoapp spec: selector: name: mongo type: ClusterIP ports: - name: db port: 27017 targetPort: 27017
kubectl create -f db-svc.yaml
apiVersion: apps/v1 kind: Deployment metadata: name: web labels: name: web app: todoapp spec: replicas: 3 selector: matchLabels: name: web template: metadata: labels: name: web spec: containers: - name: web image: janakiramm/todo ports: - containerPort: 3000
apiVersion: v1 kind: Service metadata: name: web labels: name: web app: todoapp spec: selector: name: web type: LoadBalancer ports: - name: http port: 80 targetPort: 3000 protocol: TCP
Portworx is a sponsor of The New Stack.
Feature image via Pixabay.