This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-deployment | |
spec: | |
selector: | |
matchLabels: | |
app: hello | |
template: | |
metadata: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: v1-deployment | |
spec: | |
replicas: 4 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxSurge: 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# kubectl patch service blue-green-service -p '{"spec":{"selector":{"app":"green"}}}' | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: blue-deployment | |
spec: | |
replicas: 4 | |
strategy: | |
type: RollingUpdate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#kubectl set image deployment recreate-deployment lgwm-image=gcr.io/google-samples/hello-app:2.0 | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: recreate-deployment | |
spec: | |
replicas: 4 | |
strategy: | |
type: Recreate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#kubectl set image deployment rolling-update-deployment lgwm-image=gcr.io/google-samples/hello-app:2.0 | |
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: rolling-update-deployment | |
spec: | |
replicas: 4 | |
strategy: | |
type: RollingUpdate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH device_details AS ( | |
SELECT 'deviceA' AS unique_id, '{"data":"deviceA"}' AS data, '2022-02-03 11:00:00' as event_time | |
UNION ALL select 'deviceA', '{"data":"deviceA"}', '2022-02-03 11:00:00' --duplicate | |
UNION ALL select 'deviceB', '{"data":"deviceB"}', '2022-02-02 10:00:00' | |
UNION ALL select 'deviceA', '{"data":"deviceA"}', '2022-02-02 10:00:00' | |
UNION ALL select 'deviceB', '{"data":"deviceB"}', '2022-02-02 10:00:00' --duplicate | |
UNION ALL select 'deviceC', '{"data":"deviceC"}', '2022-02-04 10:00:00' | |
UNION ALL select 'deviceB', '{"data":"deviceB"}', '2022-02-02 10:00:00' --duplicate | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH device_details AS ( | |
SELECT 'deviceA' AS unique_id, '{"data":"deviceA"}' AS data, '2022-02-03 11:00:00' as event_time | |
UNION ALL select 'deviceA', '{"data":"deviceA"}', '2022-02-03 11:00:00' --duplicate | |
UNION ALL select 'deviceB', '{"data":"deviceB"}', '2022-02-02 10:00:00' | |
UNION ALL select 'deviceA', '{"data":"deviceA"}', '2022-02-02 10:00:00' | |
UNION ALL select 'deviceB', '{"data":"deviceB"}', '2022-02-02 10:00:00' --duplicate | |
UNION ALL select 'deviceC', '{"data":"deviceC"}', '2022-02-04 10:00:00' | |
UNION ALL select 'deviceB', '{"data":"deviceB"}', '2022-02-02 10:00:00' --duplicate | |
), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Zone=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/zone -H "Metadata-Flavor: Google") | |
echo "Your CloudShell is in "$Zone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Pod | |
metadata: | |
name: hello | |
labels: | |
name: hello | |
spec: | |
containers: | |
- name: hello | |
image: gcr.io/google-samples/hello-app:2.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: hello-deployment | |
spec: | |
replicas: 3 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxSurge: 25% |
NewerOlder