Keeping up with ChatGPT and Other Technology

Author: W. Jenks Gibbons Dedicated to: Praneet

W. Jenks Gibbons
7 min readFeb 2, 2023
ChatGPT session — https://chat.openai.com/chat

Similarly to many people, I began hearing about ChatGPT a month or two ago. While interesting, I didn’t give it much thought. When I was ready to publish “Creating a Linux and Windows Kubernetes Cluster” I asked someone to review it. Their response was, “Have you tried ChatGPT?”

I thought he was joking, until unfortunately I discovered he wasn’t. I am not going to go into it much here, but I tried…. it really didn’t work. ChatGPT asked for the material to review. Initially, I tried a URL — response “No Internet Access.” Next, I passed in the entire article — response “Too long.” Finally, I tried the first paragraph — response was an answer that “kind” of repeated what I entered but mostly was a rewrite. OK, I could see how that is/may not be a very valid use-case. So, I moved on to the bash script.

Bash and the Azure CLI

My question to ChatGPT: “use the azure cli and a service principle in a bash script to create a kubernetes cluster with linux and windows nodes”

The response:

#!/bin/bash

# Replace with your Azure subscription ID
subscription_id="your_subscription_id"

# Replace with the name of your resource group
resource_group_name="your_resource_group_name"

# Replace with the name of your Kubernetes cluster
cluster_name="your_cluster_name"

# Replace with the name of your service principle
sp_name="your_service_principle_name"

# Replace with the password for your service principle
sp_password="your_service_principle_password"

# Login to Azure using the service principle
az login --service-principal -u $sp_name -p $sp_password --tenant your_tenant_id

# Set the default subscription
az account set --subscription $subscription_id

# Create the resource group for the Kubernetes cluster
az group create --name $resource_group_name --location eastus

# Create the Kubernetes cluster
az aks create --resource-group $resource_group_name --name $cluster_name --node-count 3 --generate-ssh-keys --windows-admin-password <password> --windows-admin-username <username>

# Enable the Kubernetes dashboard
az aks enable-addons --addons dashboard --name $cluster_name --resource-group $resource_group_name

# Get the credentials for the Kubernetes cluster
az aks get-credentials --name $cluster_name --resource-group $resource_group_name

Thanks ChatGPT… does it work?

First Execution

After populating the necessary variables (e.g. subscription_id) I ran the script. Success-No…, Errors-Yes… Let’s see what happened by breaking it up and commenting (e.g. ###<comment>).

$ sh c.sh

### Not sure here, it looks like the service principle was not found but
### the login succeeded... odd

AADSTS700016: Application with identifier '' was not found in the directory ''. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
Trace ID:
Correlation ID:
Timestamp: 2023-01-31 20:30:01Z
To re-authenticate, please run:
az login
{
"id": "",
"location": "eastus",
"managedBy": null,
"name": "",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
Trace ID:
To re-authenticate, please run:
az login
"location": "eastus",
"managedBy": null,
"name": "",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}
{
{
"osDiskType": "Managed",
"code": "Running"
"spotMaxPrice": null,
"vmSize": "Standard_DS2_v2",
"vnetSubnetId": null,
"autoUpgradeProfile": null,
"disableLocalAccounts": false,
"diskEncryptionSetId": null,
"identity": {
"principalId": "",
"tenantId": "",
"type": "SystemAssigned",
}
},
{
}
"managedOutboundIPs": {
"powerState": {
"code": "Running"
},
"privateFqdn": null,
"privateLinkResources": null,
"provisioningState": "Succeeded",
"securityProfile": {
"servicePrincipalProfile": {
"clientId": "msi",
"secret": null
},
"tier": "Free"
"type": "Microsoft.ContainerService/ManagedClusters",
The command failed with an unexpected error. Here is the traceback:
cmd_result = self.invocation.execute(args)

### Base dependency issue... For a Windows agent pool you must
### use the network-plugin azure or none

File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/The behavior of this command has been altered by the following extension: aks-preview
(WindowsAgentPoolOnlyAzureOrNone) Windows agent pools can only be added to AKS clusters using network-plugin azure or none
Code: WindowsAgentPoolOnlyAzureOrNone
Message: Windows agent pools can only be added to AKS clusters using network-plugin azure or none
The behavior of this command has been altered by the following extension: aks-preview

### We keep chugging along since there is no error checking... but I did not
### ask for any so expected.

The addon "dashboard" is not a recognized addon option. Did you mean 'kube-dashboard'? Possible options: 'http_application_routing', 'monitoring', 'virtual-node', 'azure-policy', 'kube-dashboard', 'ingress-appgw', 'open-service-mesh', 'confcom', 'gitops', 'azure-keyvault-secrets-provider'
The behavior of this command has been altered by the following extension: aks-preview
(ResourceNotFound) The Resource 'Microsoft.ContainerService/managedClusters/' under resource group '' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
Code: ResourceNotFound
Message: The Resource 'Microsoft.ContainerService/managedClusters/' under resource group '' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix

ChatGPT left me with no cluster. The code, if you are familiar with the Azure CLI commands, for the task is easy to get running by making this change:

# Create the Kubernetes cluster
#az aks create --resource-group $resource_group_name --name $cluster_name --node-count 3 --generate-ssh-keys --windows-admin-password <password> --windows-admin-username <username>

# Create the Kubernetes cluster (don't need 3 nodes but 1 is weird)
az aks create --resource-group $resource_group_name --name $cluster_name --node-count 2 #--generate-ssh-keys --windows-admin-password <password> --windows-admin-username <username>

Second Run

$ sh c.sh
AADSTS700016: Application with identifier '' was not found in the directory ''. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
Trace ID:
Correlation ID:
Timestamp: 2023-01-31 20:31:39Z
To re-authenticate, please run:
az login
{
"id": "",
"location": "eastus",
"managedBy": null,
"name": "",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}

### Now a cluster is spinning up

The behavior of this command has been altered by the following extension: aks-preview
{
"aadProfile": null,
"addonProfiles": null,
"agentPoolProfiles": [
{
"availabilityZones": null,
"count": 2,
...
...
"windowsProfile": null
}

The behavior of this command has been altered by the following extension: aks-preview

### Oh... I guess this is actually a command not just a dependency error

The addon "dashboard" is not a recognized addon option. Did you mean 'kube-dashboard'? Possible options: 'http_application_routing', 'monitoring', 'virtual-node', 'azure-policy', 'kube-dashboard', 'ingress-appgw', 'open-service-mesh', 'confcom', 'gitops', 'azure-keyvault-secrets-provider'
The behavior of this command has been altered by the following extension: aks-preview

### Expected... need sudo to overwrite that file

The command failed with an unexpected error. Here is the traceback:
[Errno 13] Permission denied: '.kube/config'
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.37.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "///.azure/cliextensions/aks-preview/azext_aks_preview/custom.py", line 1894, in aks_get_credentials
_print_or_merge_credentials(
File "///.azure/cliextensions/aks-preview/azext_aks_preview/custom.py", line 3236, in _print_or_merge_credentials
with os.fdopen(os.open(path, os.O_CREAT | os.O_WRONLY, 0o600), 'wt'):
PermissionError: [Errno 13] Permission denied: '///.kube/config'
To open an issue, please run: 'az feedback'

Now, I have a two node Linux Kubernetes cluster. I still don’t have a Windows node pool however.

jenks@Azure:~$ kubectl get nodes \
> -o custom-columns="NODE NAME":.metadata.name,\
> "Operating System":.status.nodeInfo.operatingSystem
NODE NAME Operating System
aks-nodepool1-41306600-vmss000000 linux
aks-nodepool1-41306600-vmss000001 linux

While a quick change gave me a running Linux cluster, ChatGPT did not successfully complete the task. That being said, it is still interesting and impressive.

Thoughts

Will ChatGPT, or similar technologies, replace jobs? Will these technologies change the world? In a nutshell, yes. This is nothing new. The world changes, software changes, employment opportunities change etc. Therefore, I can and do change with them.

ChatGPT didn’t complete the requested task. I completed it by combining multiple informational sources. Maybe in a week, maybe after I asked, maybe in a year further training will enable ChatGPT to complete it. As it learns and changes, so may we. I say may as it is a choice.

As a Sales Engineer, I can choose to work with legacy and/or emerging technologies (e.g. ChatGPT and related technologies). It is a choice to:

  • work with Cobol on on-premise, bare-steel hosts
  • work with Cobol on private or public cloud infrastructure
  • work with Java/Python/Rust on managed Kubernetes

These examples are extreme, but highlight an adaptation that correlates to an increase in opportunity.

This can also be seen by looking at the difference between technical and product knowledge. This is an idea a colleague introduced to me years ago and is often overlooked. Failure to understand this can and may leave me in a world of decreasing opportunity.

For example, I can explain how a product’s Kubernetes agent is deployed via helm as a daemonset. I understand the product and help customers use it. In order to be at my best every time I interview, I need more than product knowledge. I can work towards this by understanding the technology used by the product. I understand why it uses a daemonset, I understand why a pod was not scheduled on a particular Linux node in the cluster, I understand why the daemonset was not installed on nodes in the Windows nodepool in the cluster, I understand how to use other helm charts or add values to a helm template in Terraform…

Yes, technology will change the world in positive and negative ways. I need to adapt as well ensuring that if I am left behind it is of my own volition.

--

--

W. Jenks Gibbons

I listen to the music of the Dead and write about technology.... maybe I will write about other things someday too :)