Migrate Existing Prometheus Monitoring Workloads to Google Cloud

Overview
In this lab, you will explore how to use Managed Service for Prometheus in a self-deployed data collection mode. You can also utilize managed data collection as well.

With self-deployed data collections, you manage your Prometheus installation as usual. The only difference from upstream Prometheus is that you run the Managed Service for Prometheus drop-in replacement binary instead of the upstream Prometheus binary.

You can find more information on considerations to make when choosing a managed vs. self-managed data collection at the following documentation link: Data collection with Managed Service for Prometheus.


Deploy the Managed Service for Prometheus
Create a self managed data collection for scraping metrics
Understand considerations to make when using managed vs. self-managed data collections
Utilize Grafana to query Prometheus metrics data




ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/prometheus-engine/v0.4.3-gke.0/examples/example-app.yaml

deployment.apps/prom-example created

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/prometheus-engine/v0.4.3-gke.0/examples/prometheus.yaml

clusterrole.rbac.authorization.k8s.io/gmp-test:prometheus-test created
clusterrolebinding.rbac.authorization.k8s.io/gmp-test:prometheus-test created
service/prometheus-test created
statefulset.apps/prometheus-test created
configmap/prometheus-test created

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test get pod

NAME                              READY   STATUS    RESTARTS      AGE
helloworld-gke-5f574446d7-97gx7   1/1     Running   0             80m
prom-example-7987cfb88f-6wnq2     1/1     Running   0             54s
prom-example-7987cfb88f-bv5f5     1/1     Running   0             54s
prom-example-7987cfb88f-thsqv     1/1     Running   0             54s
prometheus-test-0                 2/2     Running   1 (11s ago)   20s

ketan_patel@cloudshell:~ (new-user-learning)$ export PROJECT_ID=$(gcloud config get-value project)

Your active configuration is: [cloudshell-533]

ketan_patel@cloudshell:~ (new-user-learning)$ curl https://raw.githubusercontent.com/GoogleCloudPlatform/prometheus-engine/v0.4.3-gke.0/examples/frontend.yaml |

sed "s/\$PROJECT_ID/$PROJECT_ID/" | kubectl apply -n gmp-test -f -
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1514  100  1514    0     0   8096      0 --:--:-- --:--:-- --:--:--  8096
deployment.apps/frontend created
service/frontend created

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test port-forward svc/frontend 9090

Forwarding from 127.0.0.1:9090 -> 9090
Handling connection for 9090
Handling connection for 9090






ketan_patel@cloudshell:~/kube-prometheus (new-user-learning)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/GoogleCloudPlatform/prometheus-engine/v0.4.3-gke.0/examples/grafana.yaml
deployment.apps/grafana created
service/grafana created


ketan_patel@cloudshell:~/kube-prometheus (new-user-learning)$ kubectl -n gmp-test port-forward svc/grafana 3001:3000
error: unable to forward port because pod is not running. Current status=Pending


ketan_patel@cloudshell:~/kube-prometheus (new-user-learning)$ kubectl get pods -n gmp-test
NAME                              READY   STATUS    RESTARTS        AGE
frontend-694bd6ff76-2wcr5         1/1     Running   0               8m17s
frontend-694bd6ff76-qp4bs         1/1     Running   0               8m17s
grafana-9fdc4b86b-22wwr           1/1     Running   0               31s
helloworld-gke-5f574446d7-97gx7   1/1     Running   0               90m
prom-example-7987cfb88f-6wnq2     1/1     Running   0               10m
prom-example-7987cfb88f-bv5f5     1/1     Running   0               10m
prom-example-7987cfb88f-thsqv     1/1     Running   0               10m
prometheus-test-0                 2/2     Running   1 (9m42s ago)   9m51s
 
ketan_patel@cloudshell:~/kube-prometheus (new-user-learning)$ kubectl -n gmp-test port-forward svc/grafana 3001:3000
Forwarding from 127.0.0.1:3001 -> 3000
Handling connection for 3001
Handling connection for 3001






Gcloud commands


ketan_patel@cloudshell:~ (new-user-learning)$ gcloud config list compute/region
[compute]
region (unset)

Your active configuration is: [cloudshell-22327]
ketan_patel@cloudshell:~ (new-user-learning)$ gcloud config list compute/zone
[compute]
zone (unset)

Your active configuration is: [cloudshell-22327]

ketan_patel@cloudshell:~ (new-user-learning)$ gcloud config set compute/region us-west1
Updated property [compute/region].


ketan_patel@cloudshell:~ (new-user-learning)$ gcloud config set compute/zone us-west1-b
Updated property [compute/zone].

ketan_patel@cloudshell:~ (new-user-learning)$ gcloud config list
[accessibility]
screen_reader = True
[component_manager]
disable_update_check = True
[compute]
gce_metadata_read_timeout_sec = 30
region = us-west1
zone = us-west1-b
[core]
account = ketan.patel@supernal.aero
disable_usage_reporting = True
project = new-user-learning
[metrics]
environment = devshell

Your active configuration is: [cloudshell-22327]
ketan_patel@cloudshell:~ (new-user-learning)$ 

GCP - Workshop notes

 




Using Prometheus for Monitoring on Google Cloud: Qwik Start

Overview

Set up a Google Kubernetes Engine cluster, then deploy the Managed Service for Prometheus to ingest metrics from a simple application.

Managed Service for Prometheus is Google Cloud's fully managed storage and query service for Prometheus metrics. This service is built on top of Monarch, the same globally scalable data store as Cloud Monitoring.

A thin fork of Prometheus replaces existing Prometheus deployments and sends data to the managed service with no user intervention. This data can then be queried by using PromQL through the Prometheus Query API supported by the managed service and by using the existing Cloud Monitoring query mechanisms.


Objectives
Deploy the Managed Service for Prometheus to a GKE cluster
Deploy a Python application to monitor
Create a Cloud Monitoring dashboard to view metrics collected



student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ gcloud auth list
Credentialed Accounts

ACTIVE: *
ACCOUNT: student-04-61f5f7cf52ff@qwiklabs.net

To set the active account, run:



student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ gcloud config list project
[core]
project = qwiklabs-gcp-00-a051edc2be39

Your active configuration is: [cloudshell-8839]



Run the following command to deploy a standard GKE cluster, which will prompt you to authorize and enable the GKE API:


student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ gcloud beta container clusters create gmp-cluster --num-nodes=1 --zone us-east1-b --enable-managed-prometheus

Default change: VPC-native is the default mode during cluster creation for versions greater than 1.21.0-gke.1500. To create advanced routes based clusters, please pass the `--no-enable-ip-alias` flag
Default change: During creation of nodepools or autoscaling configuration changes for cluster versions greater than 1.24.1-gke.800 a default location policy is applied. For Spot and PVM it defaults to ANY, and for all other VM kinds a BALANCED policy is used. To change the default values use the `--location-policy` flag.Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
Creating cluster gmp-cluster in us-east1-b... Cluster is being health-checked (master is healthy)...done.                       
Created [https://container.googleapis.com/v1beta1/projects/qwiklabs-gcp-00-a051edc2be39/zones/us-east1-b/clusters/gmp-cluster].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-east1-b/gmp-cluster?project=qwiklabs-gcp-00-a051edc2be39
kubeconfig entry generated for gmp-cluster.
NAME: gmp-cluster
LOCATION: us-east1-b
MASTER_VERSION: 1.27.3-gke.100
MASTER_IP: 35.196.141.45
MACHINE_TYPE: e2-medium
NODE_VERSION: 1.27.3-gke.100
NUM_NODES: 1
STATUS: RUNNING
student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ 

Run the following command to authenticate to the cluster:

 student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ gcloud container clusters get-credentials gmp-cluster --zone us-east1-b
Fetching cluster endpoint and auth data.
kubeconfig entry generated for gmp-cluster.

Task 2. Deploy the Prometheus service

Run the following command to create a namespace to do the work in:



student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl create ns gmp-test
namespace/gmp-test created
student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl get ns
NAME              STATUS   AGE
default           Active   5m36s
gmp-public        Active   4m31s
gmp-system        Active   4m31s
gmp-test          Active   8s
kube-node-lease   Active   5m36s
kube-public       Active   5m36s
kube-system       Active   5m37s
student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$


Task 3. Deploy the application

Deploy a simple application which emits metrics at the /metrics endpoint:

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/flask_deployment.yaml

deployment.apps/helloworld-gke created

--------------------- ----------------------------------------
# This file configures the hello-world app which serves public web traffic.
apiVersion: apps/v1
kind: Deployment
metadata:
  name: helloworld-gke
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello
  template:
    metadata:
      labels:
        app: hello
    spec:
      containers:
      - name: hello-app
        image: gcr.io/ops-demo-330920/flask_telemetry:61a2a7aabc7077ef474eb24f4b69faeab47deed9
        # This app listens on port 4000 for web traffic by default.
        ports:
        - containerPort: 4000
          name: flaskport
        env:
          - name: PORT
            value: "4000"

----------------------------- ----------------------------------------


student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/flask_service.yaml

service/hello created

--------------------- --------------------------------------
# The hello service provides a load-balancing proxy over the hello-app
# pods. By specifying the type as a 'LoadBalancer', Kubernetes Engine will
# create an external HTTP load balancer.
apiVersion: v1
kind: Service
metadata:
  name: hello
spec:
  type: LoadBalancer
  selector:
    app: hello
  ports:
  - port: 80
    targetPort: 4000
------------------------- ---------------------------------------------

Verify that this simple Python Flask app is serving metrics with the following command:

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ url=$(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}')


student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ echo $url
34.148.86.126

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ curl $url/metrics

# HELP flask_exporter_info Multiprocess metric
# TYPE flask_exporter_info gauge
flask_exporter_info{version="0.18.5"} 1.0


Tell Prometheus where to begin scraping the metrics from by applying the PodMonitoring file:

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/prom_deploy.yaml

podmonitoring.monitoring.googleapis.com/prom-example created


Before finishing up here, generate some load on the application with a really simple interaction with the app:


student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ timeout 120 bash -c -- 'while true; do curl $(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}'); sleep $((RANDOM % 4)) ; done'

{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 17:35:19 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 17:35:20 GMT"}

<TRUNCATED...>

{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 17:37:14 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 17:37:17 GMT"}


Task 4. Observing the app via metrics

In this last section, quickly use gcloud to deploy a custom monitoring dashboard that shows the metrics from this application in a line chart.

Be sure to copy the entirety of this code block:



student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ gcloud monitoring dashboards create --config='''
{
  "category": "CUSTOM",
  "displayName": "Prometheus Dashboard Example",
  "mosaicLayout": {
    "columns": 12,
    "tiles": [
      {
        "height": 4,
        "widget": {
          "title": "prometheus/flask_http_request_total/counter [MEAN]",
          "xyChart": {
            "chartOptions": {
              "mode": "COLOR"
            },
            "dataSets": [
              {
                "minAlignmentPeriod": "60s",
                "plotType": "LINE",
                "targetAxis": "Y1",
                "timeSeriesQuery": {
                  "apiSource": "DEFAULT_CLOUD",
                  "timeSeriesFilter": {
                    "aggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_NONE",
                      "perSeriesAligner": "ALIGN_RATE"
                    },
                    "filter": "metric.type=\"prometheus.googleapis.com/flask_http_request_total/counter\" resource.type=\"prometheus_target\"",
                    "secondaryAggregation": {
                      "alignmentPeriod": "60s",
''' ] } "yPos": 0,,e": "LINEAR", "0s",r": "ALIGN_MEAN"AN",

Created [a2cc4385-f866-4095-b946-361a9f7fb883].
student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ 









\student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl get deployment -A

NAMESPACE     NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
gmp-system    gmp-operator                    1/1     1            1           46m
gmp-system    rule-evaluator                  1/1     1            1           46m
gmp-test      helloworld-gke                  1/1     1            1           40m
kube-system   event-exporter-gke              1/1     1            1           46m
kube-system   konnectivity-agent              1/1     1            1           46m
kube-system   konnectivity-agent-autoscaler   1/1     1            1           46m
kube-system   kube-dns                        1/1     1            1           46m
kube-system   kube-dns-autoscaler             1/1     1            1           46m
kube-system   l7-default-backend              1/1     1            1           46m
kube-system   metrics-server-v0.5.2           1/1     1            1           46m

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl get nodes 

NAME                                         STATUS   ROLES    AGE   VERSION
gke-gmp-cluster-default-pool-59dbcd3c-ldx9   Ready    <none>   45m   v1.27.3-gke.100

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl get pods -A

NAMESPACE     NAME                                                    READY   STATUS    RESTARTS      AGE
gmp-system    alertmanager-0                                          2/2     Running   0             46m
gmp-system    collector-95mp5                                         2/2     Running   0             45m
gmp-system    gmp-operator-5f89fc5d7c-9zhkx                           1/1     Running   0             46m
gmp-system    rule-evaluator-f578d69c7-jpxjq                          2/2     Running   1 (45m ago)   45m
gmp-test      helloworld-gke-5f574446d7-rqhc8                         1/1     Running   0             41m
kube-system   event-exporter-gke-7bf6c99dcb-5rhwn                     2/2     Running   0             46m
kube-system   fluentbit-gke-zjp76                                     2/2     Running   0             45m
kube-system   gke-metrics-agent-8hfcd                                 2/2     Running   0             45m
kube-system   konnectivity-agent-5fc7ff9689-zrmj9                     1/1     Running   0             46m
kube-system   konnectivity-agent-autoscaler-5d9dbcc6d8-tt7h2          1/1     Running   0             46m
kube-system   kube-dns-5bfd847c64-wb726                               4/4     Running   0             46m
kube-system   kube-dns-autoscaler-84b8db4dc7-c42rz                    1/1     Running   0             46m
kube-system   kube-proxy-gke-gmp-cluster-default-pool-59dbcd3c-ldx9   1/1     Running   0             44m
kube-system   l7-default-backend-d86c96845-9h7p9                      1/1     Running   0             46m
kube-system   metrics-server-v0.5.2-6bf74b5d5f-tppp8                  2/2     Running   0             45m
kube-system   pdcsi-node-nb5dd                                        2/2     Running   0             45m

student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ kubectl get services -A

NAMESPACE     NAME                   TYPE           CLUSTER-IP    EXTERNAL-IP     PORT(S)            AGE
default       kubernetes             ClusterIP      10.0.0.1      <none>          443/TCP            47m
gmp-system    alertmanager           ClusterIP      None          <none>          9093/TCP           46m
gmp-system    gmp-operator           ClusterIP      10.0.13.221   <none>          8443/TCP,443/TCP   46m
gmp-test      hello                  LoadBalancer   10.0.8.51     34.148.86.126   80:30976/TCP       40m
kube-system   default-http-backend   NodePort       10.0.5.244    <none>          80:30154/TCP       46m
kube-system   kube-dns               ClusterIP      10.0.0.10     <none>          53/UDP,53/TCP      47m
kube-system   metrics-server         ClusterIP      10.0.3.242    <none>          443/TCP            46m
student_04_61f5f7cf52ff@cloudshell:~ (qwiklabs-gcp-00-a051edc2be39)$ 







===================== ===================== =====================

 
ketan_patel@cloudshell:~ (new-user-learning)$ gcloud beta container clusters create gmp-cluster --num-nodes=1  --enable-managed-prometheus
Default change: VPC-native is the default mode during cluster creation for versions greater than 1.21.0-gke.1500. To create advanced routes based clusters, please pass the `--no-enable-ip-alias` flag
Default change: During creation of nodepools or autoscaling configuration changes for cluster versions greater than 1.24.1-gke.800 a default location policy is applied. For Spot and PVM it defaults to ANY, and for all other VM kinds a BALANCED policy is used. To change the default values use the `--location-policy` flag.
Note: Your Pod address range (`--cluster-ipv4-cidr`) can accommodate at most 1008 node(s).
Creating cluster gmp-cluster in us-west1-b... Cluster is being health-checked (master is healthy)...done.                                                                                     
Created [https://container.googleapis.com/v1beta1/projects/new-user-learning/zones/us-west1-b/clusters/gmp-cluster].
To inspect the contents of your cluster, go to: https://console.cloud.google.com/kubernetes/workload_/gcloud/us-west1-b/gmp-cluster?project=new-user-learning
kubeconfig entry generated for gmp-cluster.
NAME: gmp-cluster
LOCATION: us-west1-b
MASTER_VERSION: 1.27.3-gke.100
MASTER_IP:  X.X.X.X
MACHINE_TYPE: e2-medium
NODE_VERSION: 1.27.3-gke.100
NUM_NODES: 1
STATUS: RUNNING





ketan_patel@cloudshell:~ (new-user-learning)$ gcloud container clusters get-credentials gmp-cluster
Fetching cluster endpoint and auth data.
kubeconfig entry generated for gmp-cluster.


ketan_patel@cloudshell:~ (new-user-learning)$ kubectl config current-context
gke_new-user-learning_us-west1-b_gmp-cluster

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get deployment
No resources found in default namespace.
ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get deployment -A
NAMESPACE     NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
gmp-system    gmp-operator                    1/1     1            1           29m
gmp-system    rule-evaluator                  1/1     1            1           29m
kube-system   event-exporter-gke              1/1     1            1           30m
kube-system   konnectivity-agent              1/1     1            1           29m
kube-system   konnectivity-agent-autoscaler   1/1     1            1           29m
kube-system   kube-dns                        1/1     1            1           30m
kube-system   kube-dns-autoscaler             1/1     1            1           30m
kube-system   l7-default-backend              1/1     1            1           29m
kube-system   metrics-server-v0.5.2           1/1     1            1           29m

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get nodes
NAME                                         STATUS   ROLES    AGE   VERSION
gke-gmp-cluster-default-pool-4defca36-jkbh   Ready    <none>   29m   v1.27.3-gke.100


ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get services -A
NAMESPACE     NAME                   TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)            AGE
default       kubernetes             ClusterIP   10.0.0.1     <none>        443/TCP            30m
gmp-system    alertmanager           ClusterIP   None         <none>        9093/TCP           29m
gmp-system    gmp-operator           ClusterIP   10.0.9.243   <none>        8443/TCP,443/TCP   29m
kube-system   default-http-backend   NodePort    10.0.6.173   <none>        80:31366/TCP       30m
kube-system   kube-dns               ClusterIP   10.0.0.10    <none>        53/UDP,53/TCP      30m
kube-system   metrics-server         ClusterIP   10.0.10.0    <none>        443/TCP            29m

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get pods -A
NAMESPACE     NAME                                                    READY   STATUS    RESTARTS      AGE
gmp-system    alertmanager-0                                          2/2     Running   0             29m
gmp-system    collector-gr6zl                                         2/2     Running   0             28m
gmp-system    gmp-operator-6888d59866-8982x                           1/1     Running   0             30m
gmp-system    rule-evaluator-77976dd4d9-qsqmx                         2/2     Running   2 (28m ago)   28m
kube-system   event-exporter-gke-7bf6c99dcb-cksqf                     2/2     Running   0             30m
kube-system   fluentbit-gke-bmcr6                                     2/2     Running   0             29m
kube-system   gke-metrics-agent-2cwx7                                 2/2     Running   0             29m
kube-system   konnectivity-agent-758789cc74-xwk4w                     1/1     Running   0             30m
kube-system   konnectivity-agent-autoscaler-5d9dbcc6d8-9qltt          1/1     Running   0             30m
kube-system   kube-dns-5bfd847c64-jjr4j                               4/4     Running   0             30m
kube-system   kube-dns-autoscaler-84b8db4dc7-wp45d                    1/1     Running   0             30m
kube-system   kube-proxy-gke-gmp-cluster-default-pool-4defca36-jkbh   1/1     Running   0             28m
kube-system   l7-default-backend-d86c96845-rgqwf                      1/1     Running   0             30m
kube-system   metrics-server-v0.5.2-6bf74b5d5f-wpp9p                  2/2     Running   0             28m
kube-system   pdcsi-node-h95cv                                        2/2     Running   0             29m

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl create ns gmp-test
namespace/gmp-test created

ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get ns
NAME              STATUS   AGE
default           Active   31m
gmp-public        Active   30m
gmp-system        Active   30m
gmp-test          Active   24s
kube-node-lease   Active   31m
kube-public       Active   31m
kube-system       Active   31m



ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/flask_deployment.yaml
deployment.apps/helloworld-gke created






ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/flask_service.yaml
service/hello created









ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get pods -n gmp-test
NAME                              READY   STATUS    RESTARTS   AGE
helloworld-gke-5f574446d7-97gx7   1/1     Running   0          21s
ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get services -n gmp-test
NAME    TYPE           CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGE
hello   LoadBalancer   10.0.7.206   <pending>     80:30322/TCP   18s
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get services -n gmp-test
NAME    TYPE           CLUSTER-IP   EXTERNAL-IP   PORT(S)        AGE
hello   LoadBalancer   10.0.7.206   <pending>     80:30322/TCP   31s
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ url=$(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}')
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ echo $url

ketan_patel@cloudshell:~ (new-user-learning)$ echo $url

ketan_patel@cloudshell:~ (new-user-learning)$ url=$(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}')
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ echo $url
35.199.168.92
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ curl $url/metrics
# HELP flask_exporter_info Multiprocess metric
# TYPE flask_exporter_info gauge
flask_exporter_info{version="0.18.5"} 1.0
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/prom_deploy.yaml
podmonitoring.monitoring.googleapis.com/prom-example created
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ timeout 120 bash -c -- 'while true; do curl $(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}'); sleep $((RANDOM % 4)) ; done'
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:20 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:23 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:24 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:26 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:27 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:29 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:31 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:34 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:35 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:38 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:41 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:42 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:43 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:46 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:48 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:50 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:50 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:54 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:54 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:56 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:57 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:59 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:28:59 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:02 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:05 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:05 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:08 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:09 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:12 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:15 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:18 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:21 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:22 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:25 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:28 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:29 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:31 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:31 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:33 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:33 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:36 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:36 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:38 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:40 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:41 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:43 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:46 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:47 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:49 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:52 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:54 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:55 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:57 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:57 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:29:58 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:01 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:01 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:02 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:03 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:04 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:06 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:07 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:10 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:10 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:12 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:15 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:15 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:16 GMT"}
{"message":"Hello World!","severity":"info","timestamp":"Thu, 26 Oct 2023 19:30:19 GMT"}
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$  
ketan_patel@cloudshell:~ (new-user-learning)$ 
ketan_patel@cloudshell:~ (new-user-learning)$  
ketan_patel@cloudshell:~ (new-user-learning)$ gcloud monitoring dashboards create --config='''
{
  "category": "CUSTOM",
  "displayName": "Prometheus Dashboard Example",
  "mosaicLayout": {
    "columns": 12,
    "tiles": [
      {
        "height": 4,
        "widget": {
          "title": "prometheus/flask_http_request_total/counter [MEAN]",
          "xyChart": {
            "chartOptions": {
              "mode": "COLOR"
            },
            "dataSets": [
              {
                "minAlignmentPeriod": "60s",
                "plotType": "LINE",
                "targetAxis": "Y1",
                "timeSeriesQuery": {
                  "apiSource": "DEFAULT_CLOUD",
                  "timeSeriesFilter": {
                    "aggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_NONE",
                      "perSeriesAligner": "ALIGN_RATE"
                    },
                    "filter": "metric.type=\"prometheus.googleapis.com/flask_http_request_total/counter\" resource.type=\"pro''' ] } "yPos": 0,,e": "LINEAR", "0s",r": "ALIGN_MEAN"AN",
Created [7ac033b1-4bd1-4116-b236-397d55fb783c].
ketan_patel@cloudshell:~ (new-user-learning)$ 





523  gcloud beta container clusters create gmp-cluster --num-nodes=1  --enable-managed-prometheus
  524  gcloud container clusters get-credentials gmp-cluster
  525  kubectl config current-context
  526  kubectl get deployment
  527  kubectl get deployment -A
  528  kubectl get nodes
  529  kubectl get services -A
  530  kubectl get pods -A
  531  kubectl create ns gmp-test
  532  kubectl get ns
  533  kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/flask_deployment.yaml
  534  kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/flask_service.yaml
  535  kubectl get pods -n gmp-test
  536  kubectl get services -n gmp-test
  537  url=$(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}')
  538  echo $url
  539  url=$(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}')
  540  echo $url
  541  curl $url/metrics
  542  kubectl -n gmp-test apply -f https://raw.githubusercontent.com/kyleabenson/flask_telemetry/master/gmp_prom_setup/prom_deploy.yaml
  543  timeout 120 bash -c -- 'while true; do curl $(kubectl get services -n gmp-test -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}'); sleep $((RANDOM % 4)) ; done'
  544  gcloud monitoring dashboards create --config='''
{
  "category": "CUSTOM",
  "displayName": "Prometheus Dashboard Example",
  "mosaicLayout": {
    "columns": 12,
    "tiles": [
      {
        "height": 4,
        "widget": {
          "title": "prometheus/flask_http_request_total/counter [MEAN]",
          "xyChart": {
            "chartOptions": {
              "mode": "COLOR"
            },
            "dataSets": [
              {
                "minAlignmentPeriod": "60s",
                "plotType": "LINE",
                "targetAxis": "Y1",
                "timeSeriesQuery": {
                  "apiSource": "DEFAULT_CLOUD",
                  "timeSeriesFilter": {
                    "aggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_NONE",
                      "perSeriesAligner": "ALIGN_RATE"
                    },
                    "filter": "metric.type=\"prometheus.googleapis.com/flask_http_request_total/counter\" resource.type=\"prometheus_target\"",
                    "secondaryAggregation": {
                      "alignmentPeriod": "60s",
                      "crossSeriesReducer": "REDUCE_MEAN",
                      "groupByFields": [
                        "metric.label.\"status\""
                      ],
                      "perSeriesAligner": "ALIGN_MEAN"
                    }
                  }
                }
              }
            ],
            "thresholds": [],
            "timeshiftDuration": "0s",
            "yAxis": {
              "label": "y1Axis",
              "scale": "LINEAR"
            }
          }
        },
        "width": 6,
        "xPos": 0,
        "yPos": 0
      }
    ]
  }
}
'''
  545  history
ketan_patel@cloudshell:~ (new-user-learning)




ketan_patel@cloudshell:~ (new-user-learning)$ kubectl get pods -n gmp-test
NAME                              READY   STATUS    RESTARTS   AGE
helloworld-gke-5f574446d7-97gx7   1/1     Running   0          68m
ketan_patel@cloudshell:~ (new-user-learning)$ kubectl describe pod -n gmp-test
Name:             helloworld-gke-5f574446d7-97gx7
Namespace:        gmp-test
Priority:         0
Service Account:  default
Node:             gke-gmp-cluster-default-pool-4defca36-jkbh/10.138.0.32
Start Time:       Thu, 26 Oct 2023 19:26:29 +0000
Labels:           app=hello
                  pod-template-hash=5f574446d7
Annotations:      <none>
Status:           Running
IP:               10.124.0.16
IPs:
  IP:           10.124.0.16
Controlled By:  ReplicaSet/helloworld-gke-5f574446d7
Containers:
  hello-app:
    Container ID:   containerd://292d9ebcbda1b1ad6438ba5e28b56a4dc22c63ed9442c3b34bd88314866c5e02
    Image:          gcr.io/ops-demo-330920/flask_telemetry:61a2a7aabc7077ef474eb24f4b69faeab47deed9
    Image ID:       gcr.io/ops-demo-330920/flask_telemetry@sha256:ff5bc984a8aecc0a5d3d32b2ad5ea81ff16574dc71351f23fb79c45489a29f8c
    Port:           4000/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Thu, 26 Oct 2023 19:26:47 +0000
    Ready:          True
    Restart Count:  0
    Environment:
      PORT:  4000
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-c7snr (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             True 
  ContainersReady   True 
  PodScheduled      True 
Volumes:
  kube-api-access-c7snr:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:                      <none>
ketan_patel@cloudshell:~ (new-user-learning)$ 

Install Install and Launch Ubuntu 22.04 Desktop on Google Cloud


https://medium.com/cloudnloud/install-and-launch-ubuntu-22-04-desktop-on-google-cloud-1fba8c0f9585

ketan_patel@matlab-debian-ubutun-license-server:~$ history
    2  sudo apt update
    3  sudo apt install --assume-yes wget tasksel
    4  wget https://dl.google.com/linux/direct/chrome-remote-desktop_current_amd64.deb
    5  sudo apt-get install --assume-yes ./chrome-remote-desktop_current_amd64.deb
    6  sudo apt update && sudo apt upgrade
    7  sudo apt install slim
    8  sudo apt install ubuntu-desktop
    9  sudo reboot
   10  sudo service slim start
   11  DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/0AfJohXmAb9TSGxAGv65fGQYf8QVS26c206rOvEXKj8Fn5GD9ySKKcuJfmnosXrPbhYaauw" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$(hostname)

(ENTER PIN AND SAVE IT)

ketan_patel@matlab-debian-ubutun-license-server:~$







ketan_patel@matlab-debian-ubutun-license-server:~$ sudo service slim start

ketan_patel@matlab-debian-ubutun-license-server:~$ DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/0AfJohXmAb9TSGxAGv65fGQYf8QVS26c206rOvEXKj8Fn5GD9ySKKcuJfmnosXrPbhYaauw" --redirect-url="https://remotedesktop.google.com/_/oauthredirect" --name=$(hostname)
[1023/224057.701495:ERROR:usage_stats_consent_linux.cc(37)] No host config file found.
Enter a PIN of at least six digits: 
Enter the same PIN again: 
[1023/224107.335482:INFO:daemon_controller_delegate_linux.cc(97)] Created symlink /etc/systemd/system/multi-user.target.wants/chrome-remote-desktop@ketan_patel.service → /lib/systemd/system/chrome-remote-desktop@.service.


Configure the Chrome Remote Desktop service and Connect to your Ubuntu Desktop

To start the remote desktop connection, you need to have an authorization key for your Google account.


1. In the Cloud Console, click the SSH button to connect to your instance.

2. On your local computer, using the Chrome browser, go to the Chrome Remote Desktop command line setup page:
https://remotedesktop.google.com/headless

ArgoCD

PS C:\Users\Ketan.Patel> .\kubectl.exe create namespace argocd

namespace/argocd created

PS C:\Users\Ketan.Patel> .\kubectl.exe apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

customresourcedefinition.apiextensions.k8s.io/applications.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/applicationsets.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/appprojects.argoproj.io created
serviceaccount/argocd-application-controller created
serviceaccount/argocd-applicationset-controller created
serviceaccount/argocd-dex-server created
serviceaccount/argocd-notifications-controller created
serviceaccount/argocd-redis created
serviceaccount/argocd-repo-server created
serviceaccount/argocd-server created
role.rbac.authorization.k8s.io/argocd-application-controller created
role.rbac.authorization.k8s.io/argocd-applicationset-controller created
role.rbac.authorization.k8s.io/argocd-dex-server created
role.rbac.authorization.k8s.io/argocd-notifications-controller created
role.rbac.authorization.k8s.io/argocd-server created
clusterrole.rbac.authorization.k8s.io/argocd-application-controller created
clusterrole.rbac.authorization.k8s.io/argocd-server created
rolebinding.rbac.authorization.k8s.io/argocd-application-controller created
rolebinding.rbac.authorization.k8s.io/argocd-applicationset-controller created
rolebinding.rbac.authorization.k8s.io/argocd-dex-server created
rolebinding.rbac.authorization.k8s.io/argocd-notifications-controller created
rolebinding.rbac.authorization.k8s.io/argocd-server created
clusterrolebinding.rbac.authorization.k8s.io/argocd-application-controller created
clusterrolebinding.rbac.authorization.k8s.io/argocd-server created
configmap/argocd-cm created
configmap/argocd-cmd-params-cm created
configmap/argocd-gpg-keys-cm created
configmap/argocd-notifications-cm created
configmap/argocd-rbac-cm created
configmap/argocd-ssh-known-hosts-cm created
configmap/argocd-tls-certs-cm created
secret/argocd-notifications-secret created
secret/argocd-secret created
service/argocd-applicationset-controller created
service/argocd-dex-server created
service/argocd-metrics created
service/argocd-notifications-controller-metrics created
service/argocd-redis created
service/argocd-repo-server created
service/argocd-server created
service/argocd-server-metrics created
deployment.apps/argocd-applicationset-controller created
deployment.apps/argocd-dex-server created
deployment.apps/argocd-notifications-controller created
deployment.apps/argocd-redis created
deployment.apps/argocd-repo-server created
deployment.apps/argocd-server created
statefulset.apps/argocd-application-controller created
networkpolicy.networking.k8s.io/argocd-application-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-applicationset-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-dex-server-network-policy created
networkpolicy.networking.k8s.io/argocd-notifications-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-redis-network-policy created
networkpolicy.networking.k8s.io/argocd-repo-server-network-policy created
networkpolicy.networking.k8s.io/argocd-server-network-policy created
PS C:\Users\Ketan.Patel>


PS C:\Users\Ketan.Patel> .\kubectl.exe -n argocd get all

NAME                                                    READY   STATUS    RESTARTS   AGE
pod/argocd-application-controller-0                     1/1     Running   0          32s
pod/argocd-applicationset-controller-5877955b59-wvbkq   1/1     Running   0          33s
pod/argocd-dex-server-6c87968c75-qh4rw                  1/1     Running   0          33s
pod/argocd-notifications-controller-64bb8dcf46-ghzvd    1/1     Running   0          33s
pod/argocd-redis-7d8d46cc7f-mrfh6                       1/1     Running   0          33s
pod/argocd-repo-server-665d6b7b59-vl4hh                 1/1     Running   0          33s
pod/argocd-server-5986f74c99-5r5hw                      1/1     Running   0          33s

NAME                                              TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
service/argocd-applicationset-controller          ClusterIP   10.0.183.193   <none>        7000/TCP,8080/TCP            34s
service/argocd-dex-server                         ClusterIP   10.0.143.202   <none>        5556/TCP,5557/TCP,5558/TCP   34s
service/argocd-metrics                            ClusterIP   10.0.174.184   <none>        8082/TCP                     34s
service/argocd-notifications-controller-metrics   ClusterIP   10.0.98.202    <none>        9001/TCP                     34s
service/argocd-redis                              ClusterIP   10.0.87.202    <none>        6379/TCP                     33s
service/argocd-repo-server                        ClusterIP   10.0.61.210    <none>        8081/TCP,8084/TCP            33s
service/argocd-server                             ClusterIP   10.0.68.253    <none>        80/TCP,443/TCP               33s
service/argocd-server-metrics                     ClusterIP   10.0.7.140     <none>        8083/TCP                     33s

NAME                                               READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/argocd-applicationset-controller   1/1     1            1           33s
deployment.apps/argocd-dex-server                  1/1     1            1           33s
deployment.apps/argocd-notifications-controller    1/1     1            1           33s
deployment.apps/argocd-redis                       1/1     1            1           33s
deployment.apps/argocd-repo-server                 1/1     1            1           33s
deployment.apps/argocd-server                      1/1     1            1           33s

NAME                                                          DESIRED   CURRENT   READY   AGE
replicaset.apps/argocd-applicationset-controller-5877955b59   1         1         1       33s
replicaset.apps/argocd-dex-server-6c87968c75                  1         1         1       33s
replicaset.apps/argocd-notifications-controller-64bb8dcf46    1         1         1       33s
replicaset.apps/argocd-redis-7d8d46cc7f                       1         1         1       33s
replicaset.apps/argocd-repo-server-665d6b7b59                 1         1         1       33s
replicaset.apps/argocd-server-5986f74c99                      1         1         1       33s

NAME                                             READY   AGE
statefulset.apps/argocd-application-controller   1/1     33s
PS C:\Users\Ketan.Patel> .\kubectl.exe get pods -n argocd
NAME                                                READY   STATUS    RESTARTS   AGE
argocd-application-controller-0                     1/1     Running   0          79s
argocd-applicationset-controller-5877955b59-wvbkq   1/1     Running   0          80s
argocd-dex-server-6c87968c75-qh4rw                  1/1     Running   0          80s
argocd-notifications-controller-64bb8dcf46-ghzvd    1/1     Running   0          80s
argocd-redis-7d8d46cc7f-mrfh6                       1/1     Running   0          80s
argocd-repo-server-665d6b7b59-vl4hh                 1/1     Running   0          80s
argocd-server-5986f74c99-5r5hw                      1/1     Running   0          80s

PS C:\Users\Ketan.Patel> .\kubectl.exe get services

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.0.0.1     <none>        443/TCP   66d

PS C:\Users\Ketan.Patel> .\kubectl.exe get services -n argocd

NAME                                      TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                      AGE
argocd-applicationset-controller          ClusterIP   10.0.183.193   <none>        7000/TCP,8080/TCP            95s
argocd-dex-server                         ClusterIP   10.0.143.202   <none>        5556/TCP,5557/TCP,5558/TCP   95s
argocd-metrics                            ClusterIP   10.0.174.184   <none>        8082/TCP                     95s
argocd-notifications-controller-metrics   ClusterIP   10.0.98.202    <none>        9001/TCP                     95s
argocd-redis                              ClusterIP   10.0.87.202    <none>        6379/TCP                     94s
argocd-repo-server                        ClusterIP   10.0.61.210    <none>        8081/TCP,8084/TCP            94s
argocd-server                             ClusterIP   10.0.68.253    <none>        80/TCP,443/TCP               94s
argocd-server-metrics                     ClusterIP   10.0.7.140     <none>        8083/TCP                     94s

PS C:\Users\Ketan.Patel> .\kubectl.exe config current-context

ketancoder0814k8scl

PS C:\Users\Ketan.Patel> .\kubectl.exe -n argocd port-forward service/argocd-server 8080:80

Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080
Handling connection for 8080


 Get password using following command.

$ kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d




Login 127.0.0.1:8080 with admin/v1UNXdLfgzmsMih3











  Id CommandLine
  -- -----------
   1 git clone https://github.com/staticwebdev/vanilla-api.git
   2 az login
   3 az --version
   4 az account show
   5 az account list
   6 az webapp create --resource-group dataplatformrg  --plan dataplatformplan --name ketanpatel1012 --deployment-co...
   7 az acr login --name supernalacr.azurecr.io
   8 az acr login --name supernalacr.azurecr.io
   9 az acr login -n supernalacr --expose-token
  10 TOKEN=$(az acr login --name supernalacr --expose-token --output tsv --query accessToken)
  11 TOKEN=$(az acr login --name supernalacr.azurecr.io --expose-token --output tsv --query accessToken)
  12 docker login supernalacr.azurecr.io --username supernalacr --password eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZ...
  13 TOKEN=$(az acr login --name supernalacr.azurecr.io --expose-token --output tsv --query accessToken)
  14 az acr login
  15 az acr login -n supernalacr
  16 docker
  17 mkdir ketanjenkins
  18 ls -l
  19 git clone https://github.com/azure-devops/javawebappsample.git
  20 az login
  21 az account show
  22   az webapp create --resource-group dataplatformrg  --plan ASPdataplatform  --name ketanpatel101323 --deploymen...
  23 az network private-endpoint create --name ketanpatel101323PE --resource-group dataplatformrg --vnet-name USS-Vn...
  24 az login
  25 az account show
  26 az account set
  27 az account set --subscription Supernal-ERD
  28 az account show
  29   az webapp create --resource-group ketanrg  --plan ketanappserviceplan --name ketanpatel1010 --deployment-cont...
  30   az webapp create --resource-group ketanrg  --plan ketanappserviceplan --name ketanpatel1010 --deployment-cont...
  31 az network private-endpoint create --name ketanpatel1010PE --resource-group jmh-ketan-west-rg --vnet-name jmh-w...
  32 az network private-endpoint create --name ketanpatel1010PE --resource-group jmh-ketan-west-rg --vnet-name jmh-w...
  33 az network private-endpoint dns-zone-group create --name ketanpatel1010ZoneGroup --resource-group jmh-ketan-wes...
  34 az login
  35 az account show
  36 az ad sp create-for-rbac
  37 az login
  38 az account set --subscription 0c5ebcaa-6e92-49ca-8daf-1633d038989f
  39 az aks get-credentials --resource-group ketancoder0814rg --name ketancoder0814k8scl
  40 cd .kube
  41 ls
  42 cat config
  43 cd
  44 ./kubectl.exe
  45 .\kubectl.exe
  46 cd
  47 cd ..
  48 .\kubectl.exe config current-context
  49 .\kubectl.exe get pods -A
  50 .\kubectl.exe get nodes
  51 .\kubectl.exe get namespace
  52 .\kubectl.exe -n coder get all
  53 kubectl create namespace argocd
  54 .\kubectl.exe create namespace argocd
  55 .\kubectl.exe apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  56 .\kubectl.exe -n argocd get all
  57 .\kubectl.exe get pods -n argocd
  58 .\kubectl.exe get services
  59 .\kubectl.exe get services -n argocd
  60 .\kubectl.exe config current-context
  61 .\kubectl.exe -n argocd port-forward service/argocd-server 8080:80


PS C:\Users\Ketan.Patel>
PS C:\Users\Ketan.Patel>
PS C:\Users\Ketan.Patel>
PS C:\Users\Ketan.Patel> argocd login
argocd : The term 'argocd' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ argocd login
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (argocd:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Ketan.Patel> argocd login argocd.supernal.aero
argocd : The term 'argocd' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ argocd login argocd.supernal.aero
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (argocd:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS C:\Users\Ketan.Patel>
PS C:\Users\Ketan.Patel>
PS C:\Users\Ketan.Patel> history

  Id CommandLine
  -- -----------
   1 git clone https://github.com/staticwebdev/vanilla-api.git
   2 az login
   3 az --version
   4 az account show
   5 az account list
   6 az webapp create --resource-group dataplatformrg  --plan dataplatformplan --name ketanpatel1012 --deployment-co...
   7 az acr login --name supernalacr.azurecr.io
   8 az acr login --name supernalacr.azurecr.io
   9 az acr login -n supernalacr --expose-token
  10 TOKEN=$(az acr login --name supernalacr --expose-token --output tsv --query accessToken)
  11 TOKEN=$(az acr login --name supernalacr.azurecr.io --expose-token --output tsv --query accessToken)
  12 docker login supernalacr.azurecr.io --username supernalacr --password eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZ...
  13 TOKEN=$(az acr login --name supernalacr.azurecr.io --expose-token --output tsv --query accessToken)
  14 az acr login
  15 az acr login -n supernalacr
  16 docker
  17 mkdir ketanjenkins
  18 ls -l
  19 git clone https://github.com/azure-devops/javawebappsample.git
  20 az login
  21 az account show
  22   az webapp create --resource-group dataplatformrg  --plan ASPdataplatform  --name ketanpatel101323 --deploymen...
  23 az network private-endpoint create --name ketanpatel101323PE --resource-group dataplatformrg --vnet-name USS-Vn...
  24 az login
  25 az account show
  26 az account set
  27 az account set --subscription Supernal-ERD
  28 az account show
  29   az webapp create --resource-group ketanrg  --plan ketanappserviceplan --name ketanpatel1010 --deployment-cont...
  30   az webapp create --resource-group ketanrg  --plan ketanappserviceplan --name ketanpatel1010 --deployment-cont...
  31 az network private-endpoint create --name ketanpatel1010PE --resource-group jmh-ketan-west-rg --vnet-name jmh-w...
  32 az network private-endpoint create --name ketanpatel1010PE --resource-group jmh-ketan-west-rg --vnet-name jmh-w...
  33 az network private-endpoint dns-zone-group create --name ketanpatel1010ZoneGroup --resource-group jmh-ketan-wes...
  34 az login
  35 az account show
  36 az ad sp create-for-rbac
  37 az login
  38 az account set --subscription 0c5ebcaa-6e92-49ca-8daf-1633d038989f
  39 az aks get-credentials --resource-group ketancoder0814rg --name ketancoder0814k8scl
  40 cd .kube
  41 ls
  42 cat config
  43 cd
  44 ./kubectl.exe
  45 .\kubectl.exe
  46 cd
  47 cd ..
  48 .\kubectl.exe config current-context
  49 .\kubectl.exe get pods -A
  50 .\kubectl.exe get nodes
  51 .\kubectl.exe get namespace
  52 .\kubectl.exe -n coder get all
  53 kubectl create namespace argocd
  54 .\kubectl.exe create namespace argocd
  55 .\kubectl.exe apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
  56 .\kubectl.exe -n argocd get all
  57 .\kubectl.exe get pods -n argocd
  58 .\kubectl.exe get services
  59 .\kubectl.exe get services -n argocd
  60 .\kubectl.exe config current-context
  61 .\kubectl.exe -n argocd port-forward service/argocd-server 8080:80
  62 history
  63 argocd login
  64 argocd login argocd.supernal.aero


PS C:\Users\Ketan.Patel> !61
False
PS C:\Users\Ketan.Patel> .\kubectl.exe -n argocd port-forward service/argocd-server 8080:80
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080
Handling connection for 8080










































































AppEngine - Python

tudent_04_347b5286260a@cloudshell:~/python-docs-samples/appengine/standard_python3/hello_world (qwiklabs-gcp-00-88834e0beca1)$ sudo apt upda...